Gavroche Posted January 23, 2008 Share Posted January 23, 2008 Is it possible to set a custom boolean in a first, firing script, and to use it in a second, conditionnal script? Will the game recognize it, provided I enter the name of the boolean correctly, even though it's not a boolean from the original game? Example: void main() { SetGlobalBoolean("Has_eaten_an_apple",TRUE); } #include "k_inc_debug" int StartingConditional() { int iResult; iResult = GetGlobalBoolean("Has_eaten_an_apple")==TRUE; return iResult; } In a first .dlg, I Force Persuade a character to eat an apple (which fires the first script, which sets Has_eaten_an_apple as true). Later (after having visited one or two planets), this character spawns, I talk to him and if Has_eaten_an_apple is true (conditionnal script located in the second .dlg), then he tells me thanks for the fruit. Will this work even though the game has no "Has_eaten_an_apple" boolean as-is? NB: Please, please, don't ask me why I chose such an example XD Link to comment Share on other sites More sharing options...
stoffe Posted January 24, 2008 Share Posted January 24, 2008 Is it possible to set a custom boolean in a first, firing script, and to use it in a second, conditionnal script? Will the game recognize it, provided I enter the name of the boolean correctly, even though it's not a boolean from the original game? Yes, you can add new Global variables to the game and use them in scripts. To make the game recognize them you must first add them to the globalcat.2da file though. Link to comment Share on other sites More sharing options...
Gavroche Posted January 24, 2008 Author Share Posted January 24, 2008 Ah, I should have thought there would *also* be a .2da for variables. There are .2da's for everything actually ^^ Thanks stoffe! It does work now. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.