Guts2 Posted September 9, 2005 Share Posted September 9, 2005 Hi I want to make some Scripts. But I need a Variable to combine the Script. How can I make a Global Variable so I can use the Variable in all my scripts? Please Help me. Chris Link to comment Share on other sites More sharing options...
Tupac Amaru Posted September 9, 2005 Share Posted September 9, 2005 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 More sharing options...
Darth333 Posted September 9, 2005 Share Posted September 9, 2005 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.