Jump to content

Home

Creating a custom Boolean?


Gavroche

Recommended Posts

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

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

Archived

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

×
×
  • Create New...