Jump to content

Home

Global variable?


Guts2

Recommended Posts

The global variable names and data types are stored in globalcat.2da. Add a new number, boolean or whatever you need and put the modified file into override. There are several script functions for each data type that allow you to read a global or alter its value:

 

int GetGlobalBoolean( string sIdentifier );

void SetGlobalBoolean( string sIdentifier, int nValue );

 

int GetGlobalNumber( string sIdentifier );

void SetGlobalNumber( string sIdentifier, int nValue );

 

location GetGlobalLocation( string sIdentifier );

void SetGlobalLocation( string sIdentifier, location lValue );

 

The comments in nwscript indicate that these two may be problematic:

string GetGlobalString( string sIdentifier );

void SetGlobalString( string sIdentifier, string sValue );

 

sIdentifier is the name of the variable as seen in globalcat.2da.

Link to comment
Share on other sites

If you want to avoid distributing a new globalcat.2da file for smaller mods, you can also reuse globals that are no longer use instead of adding a new line to globalcat.2da. In Kotor 1, there are some you can take from the Endar Spire that do not affect your game later on. I'm pretty sure there are various you can take from Peragus too.

 

Just make your source code available so people can see what you used.

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...