Note: LucasForums Archive Project
The content here was reconstructed by scraping the Wayback Machine in an effort to restore some of what was lost when LF went down. The LucasForums Archive Project claims no ownership over the content or assets that were archived on archive.org.

This project is meant for research purposes only.

Editing git files and rebuilding

Page: 1 of 1
 envida
01-25-2005, 10:43 PM
#1
I have a question about the git files. I have been editing an existing git file for one of the modules in the game so I can add some extra footlockers and I'm not sure what I should do now. Can I just put the edited git file in the override folder or do I need to rebuild the mod/erf file for that module? If I need to rebuild it, how would I do that?
Hope I’m not asking a stupid question, I have looked at some of the tutorials but haven't found anything.
 Darkkender
01-25-2005, 10:48 PM
#2
you would need to rebuild the module.

Now are you talking about changing one of the original modules in the game? If so you might be better served by having a script that spawns the items for you activated from something like a door within that module.
 RedHawke
01-25-2005, 10:55 PM
#3
No it's not a stupid question... at least it isn't to me. Though editing a modules .git file just to add some footlockers/placeables for anything but a custom module is a little extreme IMHO.

I think you should be able to place the modded .git and the footlockers .utp files into your override, but I'm not sure that would work as desired, and possibly it could cause some strange unforseen effects.

I don't know if you can re-pack the games .rim files.

My suggestion, also Darkkender's I see, would be to script your Footlockers into the area, if the area has an on-enter script this is easy to do, otherwise you will have to find a dialogue or something to fire your script. This is usually easier than editing the games modules.

Just my guesses, and 2 cents! :D
 envida
01-26-2005, 4:53 AM
#4
Thanks guys for your quick replies!

Originally posted by RedHawke

I think you should be able to place the modded .git and the footlockers .utp files into your override, but I'm not sure that would work as desired, and possibly it could cause some strange unforseen effects.

Yeah that is what I did and it is working now. Initial I had some problems because there where some in games scenes in the module that acted weird in that you didn’t see anything but I found out that when you edit a git file with a gff editor it corrupts the camera. After I used the CAMedit by TK102 it is now working fine

Originally posted by Darkkender

Now are you talking about changing one of the original modules in the game? If so you might be better served by having a script that spawns the items for you activated from something like a door within that module.
Originally posted by RedHawke

No it's not a stupid question... at least it isn't to me. Though editing a modules .git file just to add some footlockers/placeables for anything but a custom module is a little extreme IMHO.

My suggestion, also Darkkender's I see, would be to script your Footlockers into the area, if the area has an on-enter script this is easy to do, otherwise you will have to find a dialogue or something to fire your script. This is usually easier than editing the games modules.

When you say it is overkill I found it very easy this way when I wanted to add some extra items to a footlocker or similar that isn’t unique in the game. I just open the git file for the module find the utp file name, change it to a unique name and then add my modified old utp file with the new name in the override folder.

But if it is easier with a script I’m all for it. There is a cut scene triggered just before where I want my stuff so I guess it would be easy to use that. I just haven’t found anything on how to do it that way, so I don’t really know where to start.

If you guys have any suggestion I’ll welcome those. But if this has been asked about several times already just ignore me and I’ll find it.
 tk102
01-26-2005, 4:58 AM
#5
As Redhawke mentioned, having .git file in your override can have side-effects. I recall that every time I entered the area, it was if I was entering it for the first time... people who had been killed were still alive, doors that were open were closed, etc.

To get around this "feature" you have to pack the entire module into a .mod file and put it in the modules folder. And that's what RH meant as overkill. :)

Good job though editing and fixing the .git file!
 Darkkender
01-26-2005, 7:51 AM
#6
Another reason not to throw the GIT file in the overide is when somebody makes a new area module since we are reusing original module area's the git and are file keep there original name so if you use an area that is being used by another mods module your git file will overide the one in that area as well as the original area which very well may mess up the mod.
 Leviathan
01-26-2005, 8:01 AM
#7
RedHawke, you said "I don't know if you can re-pack the games .rim files." I've seen a tool named "Input / Output Tools" (iotools.tar.gz) which can extract and compile *.RIM files ; But I do not know any more where I saw it ...
 Darkkender
01-26-2005, 8:17 AM
#8
Originally posted by Galakmech
RedHawke, you said "I don't know if you can re-pack the games .rim files." I've seen a tool named "Input / Output Tools" (iotools.tar.gz) which can extract and compile *.RIM files ; But I do not know any more where I saw it ...

I missed that originally in Redhawke's post.

But you don't need another tool to do it when you use the ERF builder in KOTOR tool it give you the option to build as a rim file.

So here's what you do extract all files from a RIM into a empty folder. Then add your new files for that rim into the same folder. Use erf builder to create your RIM file there. Then copy your new RIM file to the modules folder overwriting the original. Or you can keep a copy of the original in a seperate folder if your smart.
 envida
01-26-2005, 2:40 PM
#9
I see there is more than enough reasons not to just put the git file in the override folder. Guess I have to learn how to script now :)

Also I didn’t check what would happen if re-entered the module for the git file belonged. But come to think of it I read somewhere that the game makes new git files with new values after you been to an area that it puts in you saves to remember where you been, so having another git file in override folder would overwrite the new one and make it seem as you haven't been to that module yet.
 RedHawke
01-26-2005, 7:30 PM
#10
envida,

If you want to spawn your own Footlocker, try this;

Extract a game footlocker, remove any items from it's invantory and scripts from the scripts fields, then change the templateresref and resref to footlker099, then change it's tag to Footlocker99 then save the .utp file as footlker099.utp.

Here is the basic script to spawn a footlocker that uses the .utp you created above in the game and place some items into it, therefore you can use the same footlocker .utp all throughout the game and it all works the same as it is the script that denotes what is in the footlocker / metalbox / plastic cylender / etc.


void main()
{
float x=0.00f; //Here is where you add the 'whereami' cheat coordinate 1.
float y=0.00f; //Here is where you add the 'whereami' cheat coordinate 2.
float z=0.00f; //Here is where you add the 'whereami' cheat coordinate 3.
float r=0.0f; // This is where you set the orientation of the placeable, set in degrees.
vector MyVec = Vector(x,y,z); //line 1
location MyLoc = Location(MyVec, r); //line 2
CreateObject(OBJECT_TYPE_PLACEABLE, "footlker099", MyLoc); //line3

CreateItemOnObject("g_w_lghtsbr05", GetObjectByTag("Footlocker99"));
CreateItemOnObject("g_a_mstrrobe01", GetObjectByTag("Footlocker99"));
CreateItemOnObject("g_w_sbrcrstl04", GetObjectByTag("Footlocker99"), 2);

}

Copy this text paste it to notepad and then edit the file to taste, you will have to enter the coordinates for your footlocker in the appropriate lines that you got from the 'whereami' cheat.

You will likely have to test the script a couple of times to get the Footlocker's orientation correct, I suggest sticking to North or 0.00, East or 90.00, South or 180.00, and West or 270.00, but you can use any others.

Regarding the items you wish to place in the Footlocker, you can easily add more of the CreateItemOnObject lines... hundreds if you want to, all you have to do is change the item tags in the first set of quotations. The ones that look like the 'giveitem' cheat codes.

Also note the last CreateItemOnObject line in the script has a 2 on the end, this is if you wish a certain quantity of the same item to be placed into the container, so in this line when run it would place 2 of those saber crystals with the item tag of g_w_sbrcrstl04 in the locker, you can use any number, I have used up to 500 with no problems.

Save your script as... say ev_footlkr1.nss make sure you save it as an .nss file and not .txt.

Next you will have to compile it a good thread to help you with that is here. (http://www.lucasforums.com/showthread.php?s=&threadid=143221)

Once you have your script compiled and you have your ev_footlkr1.ncs, you can move on to the last parts.

FYI you can celete the .ndb files that the compiler generates.

Next you will need the .dlg file from the cutscene you are talking about, open it up in the dialogue editor of your choice, Fred's or tk102's and search for a line that is certain to be spoken, and you should see somewhere a place that says "script to run for this node" (I know in the dialogue editor in KT it says this) and make sure it is blank, if it is then you can easily enter your script name in there, in your case it would be ev_footlkr1. Save the edited .dlg file.

Place the .dlg file you edited, the ev_footlkr1.ncs, the footlker099.utp, and all of your possible custom item files you want to place in the Footlocker into your override.

Fire up the game, and then load your save you have before entering that area or activating that dialogue, and see what happens, as I stated above you may have to test the orientation of your placeable a couple of times, but that is just a simple number change in the script and a recompile.

This is why I personally favor useing the Metal Box placeable as it's orientation doesn't really matter. ;)

Once you get the hang of it you will find this easy to do. :eyeraise: Wow... this is a mini-tutorial isn't it? :)

EDIT: Here is the same script example, except it is useable in situations where the dialogue can be repeated and you want the script to fire only once, then you would use this;

void main()
{
//Conditional Spawn NPC Script By TK102, Darth333, and RedHawke
int nBoolSlot=6; //any number 0-7 can be used here
int nCheck=GetLocalBoolean(GetFirstPC(),nBoolSlot);
if (nCheck) { return; } //exit if TRUE

float x=0.00f; //Here is where you add the 'whereami' cheat coordinate 1.
float y=0.00f; //Here is where you add the 'whereami' cheat coordinate 2.
float z=0.00f; //Here is where you add the 'whereami' cheat coordinate 3.
float r=0.0f; // This is where you set the orientation of the placeable, set in degrees.
vector MyVec = Vector(x,y,z); //line 1
location MyLoc = Location(MyVec, r); //line 2
CreateObject(OBJECT_TYPE_PLACEABLE, "footlker099", MyLoc); //line3

CreateItemOnObject("g_w_lghtsbr05", GetObjectByTag("Footlocker99"));
CreateItemOnObject("g_a_mstrrobe01", GetObjectByTag("Footlocker99"));
CreateItemOnObject("g_w_sbrcrstl04", GetObjectByTag("Footlocker99"), 2);

// now close the door so we can't re-enter
SetLocalBoolean(GetFirstPC(),nBoolSlot,TRUE);
}

This script is identical to the one I gave above, only this version will run only once... handy in certain areas of the game.

I hope this helps! :D
 Darkkender
01-26-2005, 8:53 PM
#11
Originally posted by RedHawke

Once you get the hang of it you will find this easy to do. :eyeraise: Wow... this is a mini-tutorial isn't it? :)

I hope this helps! :D

Actually it helps me as well Redhawke. Because I wasn't aware of the orientation angles. That and that script is handy as well. So I would say this fits as a mini-tut.
 envida
01-27-2005, 12:35 AM
#12
Thanks Redhawke I really appreciate that. A very helpful tutorial and I have now managed to create my script and edit the dlg file. Haven’t had chance to test it yet.

I just have a couple of more questions if it’s ok, you already been more then helpful enough :)

Can I use the same method to add extra stuff to a container that is already in the game or will this remove the stuff that is already in the container and just add the stuff that I have in my script?

Second thing is; using this method requires that the dlg file has a unique name right?
 tk102
01-27-2005, 10:06 AM
#13
Can I use the same method to add extra stuff to a container that is already in the game

Sure you can. The code is similar to what Redhawke posted. In that case, you wouldn't need the CreateObject function, but only the CreateItemOnObject function in the same way that Redhawke outlined. The non-scripted items in that container will not be disturbed at all.

I used this scripting method in "Zaalbar Finds Items" technique where a dialog with Zaalbar spawns an item into a container. You can download the original Darkside Choker mod to see that example here (http://www.pcgamemods.com/5271/).

The only difference here that I think is worth pointing out, is that Redhawke's script allows for re-entry, but hopefully the cutscene dialog only fires once, so that's not a problem. In the link I gave you, you'll see the use of the SetLocalBoolean (in the spawn script) and GetLocalBoolean (in conditional dialog script). These are used to prevent you from speaking the dialog branch that would respawn the items in the container. Since you plan on using a cutscene dialog, I won't go into great detail about all of this, but I'll save it for the tutorial that this thread will assuredly become. :)

As for your second question: No, Redhawke suggested that you use the existing dialog, modify it, save it with the same name, and place it in your Override. That way the game will implement your modified dialog as if it were the original.


@Redhawke:
Thank you for writing this up!

As a point of convenience: the CreateObject function returns the object that it created so you could simplify your code a bit like this

object oLocker=
CreateObject(OBJECT_TYPE_PLACEABLE, "footlker099", MyLoc); //line3

CreateItemOnObject("g_w_lghtsbr05", oLocker);
CreateItemOnObject("g_a_mstrrobe01", oLocker);
CreateItemOnObject("g_w_sbrcrstl04", oLocker, 2);
 RedHawke
01-27-2005, 6:41 PM
#14
Thanks people, I'm glad I could help! :D

And envida this using the games dialogues to fire your scripts is the most convienient and prudent way to add your items all throughout the game, on my game I have placeables spawning with stuff all over the place. ;)

@tk102 I know the script example I gave will fire more than once, I figured since envida was refrencing a cutscene it wouldn't need to be the run once kind...

But just in case I'm adding that type of script, so it'll give the reader the option, into my mini-tutorial above.

:D
Page: 1 of 1