Jump to content

KOTOR2 Ending Mod: Help Requested


Recommended Posts

While I know next to nothing about programming, I thought I would go ahead and add my name to the ranks of people who are offering up their help. I am also a creative writing major (and theatre as well, not that that's relevant), and I would be happy to offer whatever help I can give within the bounds of my abilities. Anyhoo, feel free to drop me a line and let's get this project on the road! (w00t)

Link to comment
Share on other sites

Just an update on what I've found so far. Using the available tools, I've scoured about 50% of the files in K2 and haven't been able to find a simple solution such as commented out code or GOTO statements that circumvent the original endgame. The dialogue tree is there for the original endgame, but there is an ominous message from the programmer:

 

{[Gameplay Programmer: DO NOT SCRIPT THIS. Kreia is sitting in the middle of the Trayus Core, meditating.]}

 

(904kreia.dlg in the ERF directory under 907MAL_dlg.erf under 9 )

 

I'm not sure what this means. I *think* it means that while the dialogue is there, that the actual ACTIONS spawned from the dialogue are not to be created which would greatly complicate things. But I want to make it clear I don't know enough to say this with any degree of certainty.

 

The biggest problem is I can't find the main handler loop. I found the main AI loop easy enough, k_ai_master, but there should be a main loop for the whole game in there somewhere. I have to find that to be able to see how the logic of the game works in creating scenes. Does anyone know where this is? Like I've said, I've gone through about 50% of the files and checked all the obvious ones.

 

Actually, the best hope is over in the holowan forum, but I've been waiting 2 days for my registration to be processed. Those folks have a ton of experience modding K1. If anyone is registered over there, it would be very helpful to ask this question for me:

 

In what file is the main logic of the game handled for K2?

Link to comment
Share on other sites

Beware the wrath of Lucas Arts...

Just out of curiousity (since I don't have any expertise about this really), would LucasArts really throw thunderbolts if someone modded in some dialogue/scripted events, which would mostly just utilize assets already present in the game discs?

 

 

Wait, Atris was supposed to be the final boss??? Hmm... what else was different in Obsidian's original intentions? Care to explain?

Link to comment
Share on other sites

I'm beginning to wonder if k_ai_master.nss IS the main loop for the entire game. I thought k_ai_master.nss was just for combat as it talks a lot about henchmen. The following code seems to add additional functionality to the dialogue making it dependent on location. In other words, the commented out function at the bottom is replaced by everything on top of it. So there is a default handler for dialogue and this here specialized one that is dependent on location and mental state. I wonder if there would be some way to insert the deleted endgame here in an additional else-if statement?

 

//:: k_hen_kreiadlg

/*

DJS-OEI 2/19/2004

This is a specialized On Dialogue Script for henchmen

in KotOR2. The designers wanted a method for allowing the

DLG to be selected based on the current area (or

anything else for that matter). This helps split up the

dialogues to make them more manageable. Since the default henchman

script calls k_ai_master, there was no way to use anything

other than the attached DLG. Below, I have copied all of the

relevant script from k_ai_master, allowing selection of the

DLG without compromising the current functionality. We just

need to be sure that if the k_ai_master script changes in the

Henchman OnDialogue event, we'll need to mirror that here. It's

unlikely to happen, though.

*/

 

#include "k_inc_debug"

#include "k_inc_generic"

 

void SelectAndRunDLG() {

 

//prevent FMP 7722 kds

if ( GetPartyLeader() == OBJECT_SELF )

{

BeginConversation();

return;

}

 

// If player has done psychotic behavior, call the react script.

// JAB-OEI 7/27/04

// this needs to happen so things don't break when we use debug warp

if ( GetFirstPC() == OBJECT_SELF )

{

BeginConversation("");

return;

}

else if( GetGlobalNumber ( "000_Psychotic" ) == 1 ) {

BeginConversation( "000react" );

return;

}

 

// If Kreia is in the rebuilt Jedi Enclave and all the masters are dead.

else if ( ( GetModuleName() == "650DAN" ) && ( GetGlobalNumber ("650DAN_Revelation" ) == 1 ) ) {

BeginConversation( "krealone" );

}

 

// If Kreia is in the icy plateau that hides the Jedi Academy!

else if( GetModuleName() == "262TEL" ) {

BeginConversation( "262Kreia" );

}

 

// If Kreia is on the Ebon Hawk after escaping Peragus.

else if( (GetModuleName() == "003EBO") && (GetGlobalNumber("262TEL_Escape_Telos") == 0) )

{

BeginConversation( "003Kreia" );

}

 

// If Kreia is on 101PER and hasn't joined your party yet.

else if( GetModuleName() == "101PER" && GetGlobalNumber("101PER_Kreia_Joined") == 0 ) {

BeginConversation( "101Kreia" );

}

 

// Add as many else if()'s as you want for selecting

// various DLGs, but leave the 'else' below as the default

// case.

else {

 

// This uses the DLG attached in the editor.

BeginConversation();

}

}

 

void main()

{

int nMatch = GetListenPatternNumber();

if(!GN_GetSpawnInCondition(SW_FLAG_AI_OFF))

{

if(GetCommandable())

{

object oShouter = GetLastSpeaker();

object oIntruder;

if (nMatch == -1)

{

ClearAllActions();

SelectAndRunDLG();

// JAB-OEI 6/4/04

// user defined event needs to be called

if(GN_GetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE))

{

SignalEvent(OBJECT_SELF, EventUserDefined(1004));

}

return;

}

else

{

GN_RespondToShout(oShouter, nMatch, GetLastHostileActor(oShouter));

}

}

}

if( nMatch == -1 )

{

ResetDialogState();

}

if(GN_GetSpawnInCondition(SW_FLAG_EVENT_ON_DIALOGUE))

{

SignalEvent(OBJECT_SELF, EventUserDefined(1004));

}

 

// Original script

// ExecuteScript("k_ai_master", OBJECT_SELF, KOTOR_HENCH_EVENT_ON_DIALOGUE);

}

Link to comment
Share on other sites

Beware the wrath of Lucas Arts...

Just out of curiousity (since I don't have any expertise about this really), would LucasArts really throw thunderbolts if someone modded in some dialogue/scripted events, which would mostly just utilize assets already present in the game discs?

 

 

Wait, Atris was supposed to be the final boss??? Hmm... what else was different in Obsidian's original intentions? Care to explain?

I'm guessing it was a choice between Atris and Kreia. If you were Light and saved Kreia, you got Atris, if you were dark and flipped Kreia the bird, Kreia gets PMS. Lots of things were changed. Go to the cut ending topic in the spoilers forum.

Link to comment
Share on other sites

Just an update on what I've found so far.  Using the available tools, I've scoured about 50% of the files in K2 and haven't been able to find a simple solution such as commented out code or GOTO statements that circumvent the original endgame.  The dialogue tree is there for the original endgame, but there is an ominous message from the programmer:

 

{[Gameplay Programmer: DO NOT SCRIPT THIS. Kreia is sitting in the middle of the Trayus Core, meditating.]}

 

(904kreia.dlg in the ERF directory under 907MAL_dlg.erf under 9 )

 

I'm not sure what this means.  I *think* it means that while the dialogue is there, that the actual ACTIONS spawned from the dialogue are not to be created which would greatly complicate things.  But I want to make it clear I don't know enough to say this with any degree of certainty.

 

The biggest problem is I can't find the main handler loop.  I found the main AI loop easy enough, k_ai_master, but there should be a main loop for the whole game in there somewhere.  I have to find that to be able to see how the logic of the game works in creating scenes.  Does anyone know where this is?  Like I've said, I've gone through about 50% of the files and checked all the obvious ones.

 

Actually, the best hope is over in the holowan forum, but I've been waiting 2 days for my registration to be processed.  Those folks have a ton of experience modding K1.  If anyone is registered over there, it would be very helpful to ask this question for me:

 

In what file is the main logic of the game handled for K2?

 

Check out the Modules for Malachor (especially 904MAL.rim and and Dynamic Area info, check 904mal.git). I haven't read through all of them, but it seems like the event data loop is loaded through those files.

"Some men see things as they are and say why?"
"I dream things that never were and say why not?"
- George Bernard Shaw

"Hope in reality is the worst of all evils because it prolongs the torments of man."
- Friedrich Nietzsche

 

"The amount of energy necessary to refute bull**** is an order of magnitude bigger than to produce it."

- Some guy 

Link to comment
Share on other sites

Great find! It sure looks like all the data is here for the ACTION as well as the Dialogue. The waypoints etc. for all the characters are there contained in an array of structures. Well, what the heck is missing?

 

The problem now is where is that code invoked? Where did the deviation first occur? I'm guessing right before boarding the Ravager.

Link to comment
Share on other sites

Actually, the best hope is over in the holowan forum, but I've been waiting 2 days for my registration to be processed.

 

Here's a technical problem I can help with: check your spam/bulk mail folder. Things like forum registration messages are often processed as spam in hotmail and yahoo.

I am following my fish.

 

A temporary home for stranded ML'ers

Link to comment
Share on other sites

Hey im really glad you are doing this or at least trying, there are other things in the game that need fixing is well

 

One of them being why did i meat general tobin on the ravenger when i watch a beast kill him on onderon when i tried to storm the queens chamber with him.

And theres plenty more where that came from

 

I don't have any modding knowledge. I was attempting to catalouge all the files that hinted to aspects of the game being left out due to rushing and make a post on where they could be found and how to open them. I cant open half the files though and can't find programs taht will open them (lack of knowledge).

So if any of you modders read this and have a second please tag on some instructions at the end of your next post on where the missing dialouge files can be found im searching through the voice stream with miles audio player atm and its taking a long time.

 

P.S. I did manage to get RAD tools to open the bik movie folders and notice dthat MalMov11a.bik, MalMov11b.bik and MalMov12.bik are all to do with the alternate ending. Incase that helps.

Link to comment
Share on other sites

A cool idea, but a little unrealistic in my opinion. Even with a full team working on the mod it would take a lot of time to put it together and bug test it. Heck, it would probably take Obsidian a fair amount of time to put it together. Don't forget Obsidian ran out of time and they had a dedicated team working probably 15 hour days, seven days a week trying to complete it. (In case you don't know the game industry works long hours) A completely new ending is extremely ambitious.

 

Aurora, it is a great idea but you really need to focus in on what you want to do. Maybe add one or two cutscenes or a dialog. Something along those lines is possible. Really scope out what you want to do and post it over at Holowan. Start small, and build on it.

 

Trom, you should really come over to Holowan and check it out once you get your user ID. The k_ai_master is the main script driver so to speak, but there is a lot more to it than that. Also, I really doubt that there is one GOTO statement that you can unblock that would add all of this content back in. It looks like Obsidian stoped half way through and switched directions completely. But I guess it can not hurt to look, who knows you just might get lucky. :cool:

Link to comment
Share on other sites

One of them being why did i meat general tobin on the ravenger when i watch a beast kill him on onderon when i tried to storm the queens chamber with him.

And theres plenty more where that came from

That one is explained.

You were supposed to see a cutscene of Kreia talking with the not-dead-yet Tobin after the confrontation with Vaklu.

Maybe you got bit by the fast-forwarded-cutscene bug?

Link to comment
Share on other sites

Bah, when I read that Obsidian or LA will take "care" of someone who will mod Kotor 2 i had attack of laugh. And idea of adding new ending? Wish you luck, I think that new film-ending isnt necesseary just some more dialogue (even without voice) about things that should be resolved (PC and Handmaiden especially :) ) I can help in anything that dont need scripting, just PM! I can write dialogues, scenario and anything what ya wand 'umie coz da ork is da besd wrider! ;)

Link to comment
Share on other sites

A cool idea, but a little unrealistic in my opinion.  Even with a full team working on the mod it would take a lot of time to put it together and bug test it. Heck, it would probably take Obsidian a fair amount of time to put it together.  Don't forget Obsidian ran out of time and they had a dedicated team working probably 15 hour days, seven days a week trying to complete it.  (In case you don't know the game industry works long hours)  A completely new ending is extremely ambitious. 

 

Aurora, it is a great idea but you really need to focus in on what you want to do.  Maybe add one or two cutscenes or a dialog.  Something along those lines is possible.  Really scope out what you want to do and post it over at Holowan.  Start small, and build on it.

 

Trom, you should really come over to Holowan and check it out once you get your user ID.  The k_ai_master is the main script driver so to speak, but there is a lot more to it than that.  Also, I really doubt that there is one GOTO statement that you can unblock that would add all of this content back in.  It looks like Obsidian stoped half way through and switched directions completely.  But I guess it can not hurt to look, who knows you just might get lucky.  :cool:

 

Thanks Beancounter!

Link to comment
Share on other sites

"A cool idea, but a little unrealistic in my opinion. Even with a full team working on the mod it would take a lot of time to put it together and bug test it. Heck, it would probably take Obsidian a fair amount of time to put it together. Don't forget Obsidian ran out of time and they had a dedicated team working probably 15 hour days, seven days a week trying to complete it."

 

I'm not so sure I agree with that. Obsidian had a lot more to work on than this when they ran out of time. It will probably take months before these guys (and gals) will have anything solid in their hands, but I believe it's doable.

9/30 -- NEVER FORGET!

Link to comment
Share on other sites

Thanks Beancounter!  I finally got registered.  Unfortunately, it's my anniversary and the wife is making noises about taking her out.  Women!  Doesn't she know the fate of the KOTOR universe hangs in the balance???  At any rate, now I can get some questions answered, I hope, not to mention to see what those talented folks are doing over there.  The first thing I need to figure out is where how those data structures connect.  But the biggest thing is to figure out the programming logic so I can hunt down to find where the substitution began.
Link to comment
Share on other sites

Right, well: I created the channel #K2Mod on irc.gamesurge.net for people who want to come and help out. Nothing really deep going on so far, but I want to have a meeting sometime, perhaps as early as next week.

 

A cool idea, but a little unrealistic in my opinion.  Even with a full team working on the mod it would take a lot of time to put it together and bug test it. Heck, it would probably take Obsidian a fair amount of time to put it together.  Don't forget Obsidian ran out of time and they had a dedicated team working probably 15 hour days, seven days a week trying to complete it.  (In case you don't know the game industry works long hours)  A completely new ending is extremely ambitious. 

 

Aurora, it is a great idea but you really need to focus in on what you want to do.  Maybe add one or two cutscenes or a dialog.  Something along those lines is possible.  Really scope out what you want to do and post it over at Holowan.  Start small, and build on it.

 

I'm well aware that Obsidian didn't drop all this stuff just because it could've cut into their three-hour lunch breaks. I know that it's a huge project. I've watched many huge projects lead by people with sparkling eyes and epic goals (we will make a better game than any studio can! we will add over 40 hours of new content! we will add 4 full romances with ten times the depth of any current romance!) crumble into dust as time passed for lack of organization, of clear aim, of ability. I can't guarantee that this won't happen here. The people who want to work on this, including myself, are not professional game designers, are working with scavenged and third-party tools and material, are not getting paid, and (presumably) do not have a ton of free time.

 

But a lot of us are creepily devoted to this idea and ready to work hard. Start small, sure: but not with the idea that we're just going to aim for adding one or two scenes back in, because you have to add multiple scenes to make even one of the variant endings make sense. We'll see how it turns out.

I am following my fish.

 

A temporary home for stranded ML'ers

Link to comment
Share on other sites

Wow, Aruora this is bigger project thna I thought, you will really need a lot of help if you won't find anyone who has a lot of expirence on KOTOR forums try everywhere, some people mod games just because they like modding. I am a worst coder etc. in Net so I can help in this only by testing and writting scenario/dialogue stuff, so if you want count me in!

Link to comment
Share on other sites

Right, well: I created the channel #K2Mod on irc.gamesurge.net for people who want to come and help out.  Nothing really deep going on so far, but I want to have a meeting sometime, perhaps as early as next week.

 

A cool idea, but a little unrealistic in my opinion.  Even with a full team working on the mod it would take a lot of time to put it together and bug test it. Heck, it would probably take Obsidian a fair amount of time to put it together.  Don't forget Obsidian ran out of time and they had a dedicated team working probably 15 hour days, seven days a week trying to complete it.  (In case you don't know the game industry works long hours)  A completely new ending is extremely ambitious. 

 

Aurora, it is a great idea but you really need to focus in on what you want to do.  Maybe add one or two cutscenes or a dialog.  Something along those lines is possible.  Really scope out what you want to do and post it over at Holowan.  Start small, and build on it.

 

I'm well aware that Obsidian didn't drop all this stuff just because it could've cut into their three-hour lunch breaks. I know that it's a huge project. I've watched many huge projects lead by people with sparkling eyes and epic goals (we will make a better game than any studio can! we will add over 40 hours of new content! we will add 4 full romances with ten times the depth of any current romance!) crumble into dust as time passed for lack of organization, of clear aim, of ability. I can't guarantee that this won't happen here. The people who want to work on this, including myself, are not professional game designers, are working with scavenged and third-party tools and material, are not getting paid, and (presumably) do not have a ton of free time.

 

But a lot of us are creepily devoted to this idea and ready to work hard. Start small, sure: but not with the idea that we're just going to aim for adding one or two scenes back in, because you have to add multiple scenes to make even one of the variant endings make sense. We'll see how it turns out.

 

Great idea about the IRC Aurora! Your ongoing commitment to this project is *very* encouraging and appreciated. It's been a long time since I've used IRC, so I hope I can participate.

 

As for beancounter, I think I may be responsible for some of his well-inentioned response. He's really a good guy over at Holowan Labs. Initially, I was the one running around saying there might be a quick-fix or magic switch in the code that could restore the original ending. That was very naive of me. I can't speak for beancounter, but I think he was trying to reduce expectations because of posts like mine.

 

To set the record straight, there is no easy way to mod in the original endgame. What it will take is your continued leadership commitment which you've demonstrated repeatedly on these forums, help from the Holowan community some of who have detailed knowledge of the Aurora(!) engine, and continued support from the gaming community at large.

 

I'm guessing the general idea at this point is to figure out what the actual endgame was, something I think you're parsing right now, and then see if we can take that and find the code to implement it.

 

Codewise, the biggest problem is that while most of the scripts are there in compiled and uncompiled states, some of the compiled scripts don't have accompanying source code. In other words, if some of the restored ending would take modifying the compiled source code, it would have to be manipulated at the byte level. A daunting task, but even that I've been told can be done.

 

Well, I hope this post has served to aid the cause and not impede it.

Link to comment
Share on other sites

Codewise, the biggest problem is that while most of the scripts are there in compiled and uncompiled states, some of the compiled scripts don't have accompanying source code.  In other words, if some of the restored ending would take modifying the compiled source code, it would have to be manipulated at the byte level.

 

Someone wrote a decompiler for NWScript. I don't know if it would work on Odyssey scripts.

Link to comment
Share on other sites

Codewise, the biggest problem is that while most of the scripts are there in compiled and uncompiled states, some of the compiled scripts don't have accompanying source code.  In other words, if some of the restored ending would take modifying the compiled source code, it would have to be manipulated at the byte level.

 

Someone wrote a decompiler for NWScript. I don't know if it would work on Odyssey scripts.

 

Is the source code for this available? And/or for the other tools? If so then there should be little trouble.

 

I am also a pr0grammer and I'd be glad to help, but I now nothing at all about the NWN/KotOR engines and so I wouldn't be much help without studying prior art. Although I have some experience deciphering file formats and writing file format parsers (including a decompiler for FoxPro/VFP) I am a complete greenhorn with regard to Aurora/Odyssey.

 

Aurora mentioned problems with KOTORTool... Where's the home site for that tool? What are the problems? It might be a good place to start.

Link to comment
Share on other sites

Is the source code for this available? And/or for the other tools? If so then there should be little trouble.

 

I am also a pr0grammer and I'd be glad to help, but I now nothing at all about the NWN/KotOR engines and so I wouldn't be much help without studying prior art. Although I have some experience deciphering file formats and writing file format parsers (including a decompiler for FoxPro/VFP) I am a complete greenhorn with regard to Aurora/Odyssey.

 

Aurora mentioned problems with KOTORTool... Where's the home site for that tool? What are the problems? It might be a good place to start.

 

You should have no trouble picking up scripting for KOTOR. The language style is very simlar to C++. I am a programmer myself and it did not take long to pick it up. Dealing with the source scripts are pretty straight forward, the hard part is trying to Mod the decompiled scripts. The code is very simular to assembly, and it relies on the stack pointer to retrieve variables. It is not fun to play with. This website is the best one I have found that explains the decompiled files.

 

http://www.torlack.com/index.html?topics=nwndata_ncs

 

 

 

Here is the link to Fred Tetras great program Kotor Tool.

 

http://kotortool.home.comcast.net/

 

Aurora, good luck on the Mod. It would be awsome if you make it. If you get stuck, just post your question over at Holowan. There are plenty of people over there who would be willing to help out on a specific problem.

Link to comment
Share on other sites

Someone who's familiar with assembler would be a great asset for this project IMO.

"Some men see things as they are and say why?"
"I dream things that never were and say why not?"
- George Bernard Shaw

"Hope in reality is the worst of all evils because it prolongs the torments of man."
- Friedrich Nietzsche

 

"The amount of energy necessary to refute bull**** is an order of magnitude bigger than to produce it."

- Some guy 

Link to comment
Share on other sites

Beware the wrath of Lucas Arts...

Just out of curiousity (since I don't have any expertise about this really), would LucasArts really throw thunderbolts if someone modded in some dialogue/scripted events, which would mostly just utilize assets already present in the game discs?

 

They haven't in the past...but I don't recall anything as major as a new ending. But F them for not giving us that ending in the first place.

Link to comment
Share on other sites

While I'd like the ending to be restored, I'd also like other things left out of the game put back in.  By this, I mean... things like Atris being a possible final-final boss, depending on gameplay.  Since apparently her voice is recorded for all those parts as well, the VA work is already done.  That's also part of the ending, but I don't know if the "dark" model of her... as seen in the old strat. guide... is there on the CDs with the rest of it.

 

I'm also curious if other various little chatter scenes were left out for any particular reason, and still have the material there.  How much is "unfinished" and how much is unimplemented.  For instance, while I wish the droid planet was in the game, if the whole thing is just entirely missing since it was never worked on... I would rather the lead-ins just be cut from HK's conversation tree... that's the neater thing to do.  On the other hand, if Master Vash has... a model (she's in a cutscene), and all her voice work recorded, it should be possible to add her back in... rather than have her be a perpetual corpse.

 

I know this thread is geared towards fixing the ending, but I wonder if it would be possible to "fix" other things... since I doubt broken quests will be patched to fix (like Mandalore leadership quest... goes nowhere, and leaves a box in your quest window).

 

 

You know it's pretty freaken sad when the fans have to "FIX" the game they bought.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...