Jump to content

Home

Confused Neophyte Has Questions


CaptainPike

Recommended Posts

Hi, new here. As always, I'm years behind the groove in modding games, but so be it. I'm who I am.

 

I'm little more than a neophyte, but I have studied computer programming a bit (gwBasic, QuickBasic, VisualBasic) and I have modded "Medieval Total War" and "Baldur's Gate" (another infinity game), so I have a bit of background to work with.

 

So, I have some great ideas for modding KOTOR I. I grabbed KOTOR Tool Version 1.0.2210.16738 and was ready to get to work, but to no avail. I can't seem to get anywhere where I can actually start coding; it seems I don't decompile, and if I do, only partially. However, some words and keywords, etc. seem very understandable.

 

Here's what happens:

 

I go to my KOTOR tool and grab something (in this case, let's say danm13.rim) then click "Extract Module for Editing". I get a message that says, "A map is not supported for this module. Continue?" I say, "Yes". Under "Resource Type Selector", I choose, "Select All" then save it somewhere -- a folder on my desktop. When it says, "Would you like the .GIT file cleaned of all non-extracted entities?" (whatever that means), I click "No". Now, a bunch of .utp files that I can't seem to open from within kotor tool; and when I open it with a text editor, I, of course, see hex codes and some keywords.

 

Do I have the right tool for the job? How do I get to the point of scripting?

 

(For reference, this is about what I see):

 

UTP V3.28 P ; ; Ä m 1 ì ÿÿÿÿ 8 à

$ 0

 

1 C 5 ! 6 " 7 # 8 $ 9 % : & ; ' < ( = ) > * ? + @ , - . / 0 1 2 A 3 B 4 C 5 6 D 7 8 9

: U Tag LocName Description TemplateResRef AutoRemoveKey CloseLockDC Conversation Interruptable Faction Plot Min1HP KeyRequired Lockable Locked OpenLockDC PortraitId TrapDetectable TrapDetectDC TrapDisarmable DisarmDC TrapFlag TrapOneShot TrapType KeyName AnimationState Appearance HP CurrentHP Hardness Fort Ref Will OnClosed OnDamaged OnDeath OnDisarm OnHeartbeat OnLock OnMeleeAttacked OnOpen OnSpellCastAt OnTrapTriggered OnUnlock OnUserDefined HasInventory PartyInteract BodyBag Static Type Useable OnEndDialogue OnInvDisturbed OnUsed ItemList InventoryRes Repos_PosX Repos_Posy PaletteID Comment LockerLg Ô ÿÿÿÿ lockerlg002 g_i_drdltplat001 Large standup locker

 

! " # $ % & ' ( ) * + , - . / 0 1 2 3 4 5 9 : 6 7 8

Link to comment
Share on other sites

Hi, new here. As always, I'm years behind the groove in modding games, but so be it. I'm who I am.

 

I'm little more than a neophyte, but I have studied computer programming a bit (gwBasic, QuickBasic, VisualBasic) and I have modded "Medieval Total War" and "Baldur's Gate" (another infinity game), so I have a bit of background to work with.

 

I go to my KOTOR tool and grab something (in this case, let's say danm13.rim) then click "Extract Module for Editing". I get a message that says, "A map is not supported for this module. Continue?" I say, "Yes". Under "Resource Type Selector", I choose, "Select All" then save it somewhere -- a folder on my desktop. When it says, "Would you like the .GIT file cleaned of all non-extracted entities?" (whatever that means), I click "No". Now, a bunch of .utp files that I can't seem to open from within kotor tool; and when I open it with a text editor, I, of course, see hex codes and some keywords.

 

Do I have the right tool for the job? How do I get to the point of scripting?

 

Welcome to the Forums!

 

Yes, you have the right tool.

 

The .utp file is in the GFF format used by Bioware for the base engine they've used in pretty much all of the their games. The following file types are in GFF format:

  • .dlg - Dialog/conversation
  • .jrl - Journal(basically, your quest log)
  • .utc - Creatures(beasts, people, droids, .etc)
  • .utd - Doors
  • .ute - Encounters(ambushes)
  • .uti - Items
  • .utm - Merchants(really, just an object whose inventory becomes the "store" and is linked to a Creature through scripting)
  • .utp - Placeables(chairs, tables, plants, .etc)
  • .uts - Sounds(campfire noise near the fire, Swoop noises, .etc)
  • .utt - Triggers(specific area that trips a script, such as when leaving the Ebon Hawk)
  • .utw - Waypoints(invisible markers used to move NPCs, such as the Sith Patrols in the Upper City on Taris)

 

Each of these filetypes, except for .jrl, has an interface for editing in KotOR Tool(KT), though it is recommend to use DLGEditor for the .dlg files. To get one of these files open, you should use either Ctrl+O or use "Open GFF File..." from the File menu.

 

Also, you can double-click a file in the KT window to open it that way.

 

Lastly, for all of the tools you will need, I recommend going to StarWarsKnights(SWK). Each tool has a link to "Discuss" it, which links to the release thread on here, in this Forum, where you will also find two of my tools that aren't listed on SWK.

 

My tools would be WalkSwitch(if you want to get into the area aspect, this lets you view, but not edit the geometry of, the .wok files, which are the walkmeshes(the game's collision-mapping) and JRLEdit, which gives a nice interface to editing the .jrl file.

Link to comment
Share on other sites

I think that helps quite a bit.

 

So, my first mini-mod to try to get my feet wet would be putting a G3 droid on the Ebon Hawk and in the apartment as an "information retrieval" droid (just to get the hang of dialogues); that G3 Droid would be a .utc; and I was thinking about merchants nearby; that would be a .utm file?

Link to comment
Share on other sites

I think that helps quite a bit.

 

So, my first mini-mod to try to get my feet wet would be putting a G3 droid on the Ebon Hawk and in the apartment as an "information retrieval" droid (just to get the hang of dialogues); that G3 Droid would be a .utc; and I was thinking about merchants nearby; that would be a .utm file?

 

Mostly correct. Also, in the Options part of KT, you can check a box that adds descriptions for the modules, which will tell you the name of the Module next to filename. Example: ebom12aa - Ebon Hawk - Bridge.

 

You will need a merchant store(.utm) and a merchant(.utc) who opens that store. In the dialogue for the Merchant, you will need a script that has the following:

 

void main()
{
   OpenStore(GetObjectByTag(<Tag of .utm file, in quotes>, GetFirstPC(), <optional number(percentage) to mark prices up>, <optional number(percentage) to mark prices down>);
}

 

I am not sure about how much coding knowledge you have, but in the examples on the forums, you will often see people filling in the arguments for a function without telling where they got them from. That was a major roadblock for me when I first started. So, when you see something like oCreature in an example, it is referring to an already user-defined object. For instance, if in KotOR 2 I want to get a Boma from the nearby path, I'd use

 

GetObjectByTag("boma_normal");

 

But if I wanted to reference it later in a script, I'd use

 

object oBoma = GetObjectByTag("boma_normal");

 

The "oBoma" part is just used by the coder as a naming reference and can be named whatever you want, though the "o" part is telling me it's an object, just like a "v" in "vVector" tells me it's a vector and an "l" in "lLocation" tells me it's a location.

 

To begin scripting, open the Text Editor, which should be the third button from the left below the menu, and then select in the Script menu whether it is for KotOR 1 or KotOR 2. You can search the functions and their documentation in the lower right.

Link to comment
Share on other sites

The logic of the coding makes perfect sense; I see the functions, function calls, etc. May be a bit sticky at first, but I'm sure I'll catch on.

 

My mod idea is much larger than G3 units and vendors (LoL), but it seems like a good place to start.

 

4 questions, though, as this will play into the larger scheme of things:

 

1. Can the Vendor select which store to open based on a global variable; or,

2. Can the Vendor spawned at a given point be chosen based on a global variable; and

3. Can I hijack the Opening Sequence (i.e. 'Attack on the Endar Spire') and spawn somewhere completely different; and

4. Can I "unspawn" from that "somehwere completely different" to the "Endar Spire" or elsewhere based on a dialog with a creature and/or computer terminal?

Link to comment
Share on other sites

The logic of the coding makes perfect sense; I see the functions, function calls, etc. May be a bit sticky at first, but I'm sure I'll catch on.

 

My mod idea is much larger than G3 units and vendors (LoL), but it seems like a good place to start.

 

4 questions, though, as this will play into the larger scheme of things:

 

1. Can the Vendor select which store to open based on a global variable; or,

2. Can the Vendor spawned at a given point be chosen based on a global variable; and

3. Can I hijack the Opening Sequence (i.e. 'Attack on the Endar Spire') and spawn somewhere completely different; and

4. Can I "unspawn" from that "somehwere completely different" to the "Endar Spire" or elsewhere based on a dialog with a creature and/or computer terminal?

 

1. Yes, you'd just have to switch the store based on that variable:

void main()
{
   string sName; // Declaring, but not identifying a string, string being a word
   int iVariable = GetGlobalNumber(<Whatever it is, in quotes>); // Get the global variable; booleans are 0 or 1, numbers are positive or negative

   switch(iVariable)
   {
   case 0:
   {
       sName = <Store 1's tag>;
   }
   case 1:
   {
       sName = <Store 2's tag>;
   }
   case 2:
   {
       sName = <Store 3's tag>;
   }
   }

   OpenStore(GetObjectByTag(sName), GetFirstPC());
}

 

You can add more cases as needed, and the 0, 1, 2 thing is the number of the variable.

 

The // is a comment symbol and anything after it on that line is ignored.

For multi-line comments, use /* to start, and */ to end, however any // in between will still end it.

 

2. Also possible, but the store is irrelevant of the creature. The creature is just a medium between the gamer and the store, and their only purpose is the dialogue that opens the store.

 

3. Yes, you would just have to rename the Endar Spire's .rim files in the modules folder to something else, and name your new module the same as the original Endar Spire's .rim names.

 

4. Yes, you would just have to have this at the end of that dialogue:

void main()
{
   StartNewModule(<Name of module, in quotes>, <tag of waypoint to start at, in quotes>);
}

 

I'm not sure if the Endar Spire starts off at a waypoint or not, so experimentation is necessary. Also, I'm not sure if it's the tag or the template resref of the waypoint, so I'd name them the same, as well as the filename of the .utw file.

Link to comment
Share on other sites

Cool! B/C my idea, in a nutshell, is to expand the KOTOR experience by having the character, at the start, choose their "faction";

 

Civilian,

Republic Navy,

Jedi Order,

Sith,

(maybe others);

 

This selection would determine the course of the quest. True, all of them would end up chasing the Star Maps and confronting Darth Malak; but each for their own reasons and each attaining their goal in different methods.

 

That's why all the questions about the vendor: The vendor would carry different items depending on the faction.

 

Moreover, each "faction" (save Civilian') would have to maintain LightDark in certain limits, or their lose that "Faction" and become "Civilian".

 

The true purpose of the droid would be to take over certain dialogues and provide certain information for party members who may not be present at key times.

 

If I do what I intend to do, I will be rewriting the story several times over, each to the same ends.

 

Thanks for your help; you have put some thought and effort into answering my questions.

Link to comment
Share on other sites

Cool! B/C my idea, in a nutshell, is to expand the KOTOR experience by having the character, at the start, choose their "faction";

 

Civilian,

Republic Navy,

Jedi Order,

Sith,

(maybe others);

 

This selection would determine the course of the quest. True, all of them would end up chasing the Star Maps and confronting Darth Malak; but each for their own reasons and each attaining their goal in different methods.

 

That's why all the questions about the vendor: The vendor would carry different items depending on the faction.

 

Moreover, each "faction" (save Civilian') would have to maintain LightDark in certain limits, or their lose that "Faction" and become "Civilian".

 

The true purpose of the droid would be to take over certain dialogues and provide certain information for party members who may not be present at key times.

 

If I do what I intend to do, I will be rewriting the story several times over, each to the same ends.

 

Thanks for your help; you have put some thought and effort into answering my questions.

 

That does sound pretty cool! And no problem about the questions; I enjoy sharing my knowledge. I worked pretty hard to get it.:)

Link to comment
Share on other sites

I decided to try something "simple" (LoL) -- I extracted some creature files that I wanted to give names to. I have those files isolated in a folder called "working" and in subfolders with the same exact name as the module so extracted. I open them using Ctrl-O and type in the name I want to give them under "first name" .... but there doesn't seem to be a way to save my changes. I close the box, open it again, and the vanilla version "first name" is still up there.

 

Oh, it's really nice to be able to see the character instead of a bunch of hexicodes ... got me that far, anyway, LoL! And got me extracting files, etc Tx!

Link to comment
Share on other sites

I decided to try something "simple" (LoL) -- I extracted some creature files that I wanted to give names to. I have those files isolated in a folder called "working" and in subfolders with the same exact name as the module so extracted. I open them using Ctrl-O and type in the name I want to give them under "first name" .... but there doesn't seem to be a way to save my changes. I close the box, open it again, and the vanilla version "first name" is still up there.

 

Oh, it's really nice to be able to see the character instead of a bunch of hexicodes ... got me that far, anyway, LoL! And got me extracting files, etc Tx!

 

In the lower right-hand corner of the window, there should be two buttons: "Save" and "Cancel".

 

Also, since I got your post count over five, we can continue this via Private Messages, if needed.

Link to comment
Share on other sites

I can't decompile with DeNCS for some reason; it tells me something about "partial, can't recompile".

 

On further clicking around KOTOR tool, I found a "module tool" that has a script window. After some trial and error and searching, I found this video:

 

 

All I've worked with are creature files (changing names), so I never brought the .git file (and the others he talked about) into that folder; so, I did. Then, when I tried to open the Module tool, it says something about "maps"?

 

I just can't seem to gain access to scripts to do any of this with!

Link to comment
Share on other sites

I can't decompile with DeNCS for some reason; it tells me something about "partial, can't recompile".

 

On further clicking around KOTOR tool, I found a "module tool" that has a script window. After some trial and error and searching, I found this video:

 

 

All I've worked with are creature files (changing names), so I never brought the .git file (and the others he talked about) into that folder; so, I did. Then, when I tried to open the Module tool, it says something about "maps"?

 

I just can't seem to gain access to scripts to do any of this with!

 

When it says a partial recompile, just right-click on the code that pops up(the left column) and click "View Decompiled code".

 

The module tool is somewhat limited, and it is recommended to simply use KGFF instead for the .git, .are, and .ifo files. Those can be retrieved from the .rim file, the one without the "_s" in the name.

Link to comment
Share on other sites

OK, I can see the script I was trying to get, but it wasn't what I was expecting, LoL. Tx! Making slow progress, is I ....

 

From the other post I'll encapsulate here, we have your statement about the code for Markup/Markdown on stores:

 

Well, the Mark up and Mark down are controlled in the call to OpenStore, which should be in the script attached to the OnClicked event of the placeable.

 

I don't have an OnClicked event. I have:

 

OnClosed,

OnDamaged,

OnDeath,

OnDisarm,

OnEndDialogue,

OnHeartbeat,

OnImvDisturbed,

OnLock,

OnMeleeAttacked,

OnOpen,

OnSpellCastAt,

OnTrapTriggered,

OnUnlock,

OnUsed,

OnUserDefined

Link to comment
Share on other sites

OK, I can see the script I was trying to get, but it wasn't what I was expecting, LoL. Tx! Making slow progress, is I ....

 

From the other post I'll encapsulate here, we have your statement about the code for Markup/Markdown on stores:

 

 

 

I don't have an OnClicked event. I have:

 

OnClosed,

OnDamaged,

OnDeath,

OnDisarm,

OnEndDialogue,

OnHeartbeat,

OnImvDisturbed,

OnLock,

OnMeleeAttacked,

OnOpen,

OnSpellCastAt,

OnTrapTriggered,

OnUnlock,

OnUsed,

OnUserDefined

 

I would try the OnUsed first, then the OnOpen.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...