harIII Posted November 24, 2009 Share Posted November 24, 2009 Would anybody know of a good tutorial teaching people how to create, operate, and execute booleans and numbers in the globalcat.2da? Link to comment Share on other sites More sharing options...
Exile007 Posted November 25, 2009 Share Posted November 25, 2009 Uh... there's a tutorial that stoffe wrote about it here. ^Well, that's on Local Variables, but Local and Global Variables have similar principles, the only difference is that Global Variables are... global , while Local Variables exist only within the module that it is set in. Global Variables/Booleans are set with two fairly simple functions int nGlobalNumber=GetGlobalNumber("your global number"); SetGlobalNumber(nGlobalNumber, "Value") //The "value" is a range between -128 and 127. You can use values to keep track of completed tasks in game. int nGlobalBoolean=GetGlobalBoolean("your global boolean") SetGlobalBoolean(nGlobalBoolean, TRUE); //Booleans always start out FALSE You also should check via if (GetGlobalNumber("your global number") == Value) //Value is again, -128 through 127 //You can also use other inequality symbols instead of "==" like ">" if (GetGlobalBoolean("your global boolean")) //This checks if your global boolean returns TRUE There are a whole bunch of great examples in silveredge's Brotherhood of Shadow mod, specifically the first module of the Orion. //sales_person8.nss int StartingConditional() { int i = GetGlobalNumber("Tar_PazNik"); if (i == 4){ return TRUE; } return FALSE; } Hope this helped a bit Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted November 27, 2009 Share Posted November 27, 2009 On this subject, I have been wondering something for a bit, perhaps Exile007 or another friendly forumite might illuminate me. Would it be possible to add to the global numerics something that other mods by one modder, or a team, could use so that one mod would *know* that another related mod is installed (installing any of the related mods would either create or modify the .2da in question)? Example: Mod "A" is installed, and in that installation, a field is added to globalcat.2da, that is numeric in value, we'll call it 10. When Mod "B" is installed, the presence of the value 10 tells the patcher to change it to 30, 30 telling both mods that both mods are installed, thus changing the availability of certain dialogs. This would create a sort of "unlockable" content situation. I think that the old KMM did something similar to what I am looking for, by creating an .kmm file, but I would like something that uses only in-game scripting/editing. It doesn't seem too far out there to me, but I have not done any scripting in a while, and have not studied enough on globals and .2da's in general. Link to comment Share on other sites More sharing options...
harIII Posted November 30, 2009 Author Share Posted November 30, 2009 I think that's why somebody created the TSLPatcher. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted December 2, 2009 Share Posted December 2, 2009 I think that's why somebody created the TSLPatcher. Right... except you missed my point. What I was talking about in my question would be 90% accomplished with the patcher. I was not trying to hijack your thread, so I will abandon this question for the time being, and ask it another time. Link to comment Share on other sites More sharing options...
Exile007 Posted December 3, 2009 Share Posted December 3, 2009 I was not trying to hijack your thread, so I will abandon this question for the time being, and ask it another time. Because this is a Global Number/Boolean thread, I say it's fair game to answer your question. If I understand what you're saying, then the answer to your question is: YES. TSLRP, IIRC, has a "IS_TSLRP_INSTALLED" type global boolean that is set in 201TEL. The on-enter script of 201TEL sets the boolean to TRUE if the mod is installed. So technically speaking, someone could say, modify an on-enter script for deathdisco's Jedi Temple mod to check to see if it's installed by setting a global boolean. If the mod IS installed, then they could have a check in another dialog where the Exile could say something like "I've traveled to Coruscant, the temple is abandoned." Anything is possible with scripting, except for world peace. Link to comment Share on other sites More sharing options...
Qui-Gon Glenn Posted December 4, 2009 Share Posted December 4, 2009 ^^^ Yeah... I forgot about that somehow, because TSLRP also installs a registry key... I simply forgot that it did both things. Thanks, Exile007! My reason for thinking about this, is, if one were to release a mod in installments, or make a major mod out of several mini-mods, they could "interact" in KotOR/TSL with that .2da key. This is something I have been thinking about for some time, and could take away some fear of releasing some things that are not complete by themselves, but are still interesting/playable as stand-alone. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.