Ok, i've done it.
void OnStart()
{
AddEntityCollideCallback("Player", "bookarea_1", "book1", true, 1);
AddEntityCollideCallback("book_02", "bookarea_1", "book2", true, 1);
SetLocalVarInt("Var01", 0);
//THIS MAKES A COUNTER
}
void book1(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("book_01", false);
SetEntityActive("book_001", true);
PlayGuiSound("impact_book_med1.ogg",10.0f);
AddLocalVarInt("Var01", 1);
//THIS ADDS 1 TO THE COUNTER
if (GetLocalVarInt("Var01") == 2)
//THIS CHECKS IF THE COUNTER =2
{
[CODE IN HERE]
}
}
void book2(string &in asParent, string &in asChild, int alState)
{
SetEntityActive("book_02", false);
SetEntityActive("book_002", true);
PlayGuiSound("impact_book_med2.ogg",10.0f);
AddLocalVarInt("Var01", 1);
//THIS ADDS 1 TO THE COUNTER
if (GetLocalVarInt("Var01") == 2)
//THIS CHECKS IF THE COUNTER =2
{
[SAME CODE IN HERE]
}
}
Probably not the most efficient way, but it works.
When the "Counter" = 2, it will call whatever you have in the CODE IN HERE or SAME CODE IN HERE space.
NOTE: WHAT EVER GOES IN THE FIRST CODE SECTION, ALSO GOES IN THE OTHER, WORD FOR WORD OR IT PROBABLY WILL NOT WORK!
Also,
http://wiki.frictionalgames.com/hpl2/tut...lvariables (tells you how to use variables)