Jump to content

Home

Changing values in utc files using code in the game?


SithRevan

Recommended Posts

Hey guys I was wondering if it were posible to change the values of your character by using code in the game. Like lets say you want to change your characters name when they walk over a certain point, or if you wanted to change thier dialog file in mid game. Would this be possible or at least would you be able to change a value of one of the properties in the charcter? If you guys could help me I would really appreciate it, thanks!:D

Link to comment
Share on other sites

Like lets say you want to change your characters name when they walk over a certain point, or if you wanted to change thier dialog file in mid game.

 

Directly: No. Indirectly via more or less ugly workarounds: Yes, sort of.

 

You can change the name if you set the name to a custom token, and then set/change the value of that token whenever needed.

 

You can change the dialog file by adding special cases in the OnDialog AI event script of the character that specify a name of a dialog file to use directly rather than the default one.

Link to comment
Share on other sites

Ok well what about something like this. Would you be able to set a "IgnoreCrePath" value on the main pc character via code or is that totally impossbile. If you could help me with that I would really appreciate it, thanks.

 

Totally impossible: Don't think so.

Quite difficult and more trouble than it's worth: Most likely. :)

 

 

 

You can't do it via the standard scripting language as far as I know. You'd need to make a script extender backend to handle it. That would be a fair amount of work and extreme overkill if just used for something like that though. :)

Link to comment
Share on other sites

Well if I did want to do that how would I go about doing it? Or is that just something that can't be done at all?

 

You would have to write a script extender back-end application that runs in the background at the same time as the game that hooks into the engine at runtime to intercept new instructions from the scripting engine and carry those instructions out.

 

Such as thing (called NWNX) was made for Neverwinter Nights to add SQL database support to the game (among many other things), and since the Odyssey engine is a derivate of the NWN Aurora engine it would likely be possible to make an application that works in a similar manner for the KotOR games. But as said that solution would be extreme overkill if you only need it for something like changing the player collision flag. :)

Link to comment
Share on other sites

Sorry it took so long for me to respond to this but exactly how would you write the back-end application to do that? After you did write the application what code would you put in to the script itself to run that code? Also where would you put this application and would it be alright to publicly realease that type of mod? If you would anwer those questions for me I would appreciate it very much and thanks for the help so far stoffe.:)

 

P.S. I downloaded the nwnx application too just so you know.

Link to comment
Share on other sites

One of the things you would need is to download Torlacks source files for the original NWNnsscomp then make the proper changes to that to account for the scripting differences in Kotor & TSL. I haven't been able to do so as I'm not sure as to what changed to account for it. Of course my own programming skills are nearly infantile most of the time. I've been toying with breaking back into the NWNNSSCOMP code again so that I can try to input some generic "Get & Set" functions that the compiler would recognize from the script. Such as "Get2daSource" and other such functions. Mostly because after re-reading my Game Scripting Mastery book it covers Host app functions that are pulled from the compiler rather than an include location. The drawback to doing this with the NWN scripting language is that it requires alot more memory plus you will need to devise a way to cache the data your storing so as to reduce the high memory usage.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...