///---CALLBACKS---///
void OnStart()
{
AddEntityCollideCallback("MovingBook_1", "MovingArea_1", "TriggerBook", true, 1);
}
///---CALLBACKS---///
///---LAMPS SCRIPT---///
///---LAMPS SCRIPT---///
///---BOOK PUZZLE SCRIPT---///
void TriggerBook(string &in asParent, string &in asChild, int alState)
{
AddPropImpulse("MovingBook_1", 6, 0, 0, "world");
AddPropImpulse("MovingBook_4", -6, 0, 0, "world");
AddEntityCollideCallback("MovingBook_4", "MovingArea_4", "FirstPull", true, 1);
AddTimer("StuckReverseFirst", 0.0001f, "UnStuckFirst");
AddDebugMessage("First trigger works", false);
}
void FirstPull(string &in asParent, string &in asChild, int alState)
{
int First = RandInt(2, 3);
switch(First)
{
case 2:
AddPropImpulse("MovingBook_2", -6, 0, 0, "world");
AddEntityCollideCallback("MovingBook_2", "MovingArea_2", "SecondPull", true, 1);
AddDebugMessage("Case Number Two Switch Statement works", false);
break;
case 3:
AddPropImpulse("MovingBook_3", -6, 0, 0, "world");
AddEntityCollideCallback("MovingBook_3", "MovingArea_3", "ThirdPull", true, 1);
AddDebugMessage("Case Number Three Switch Statement works", false);
break;
}
}
void SecondPull(string &in asParent, string &in asChild, int alState)
{
AddEntityCollideCallback("MovingBook_3", "MovingArea_3", "FourthPull", true, 1);
AddDebugMessage("CASE NUMBER TWO WORKS", false);
}
void ThirdPull(string &in asParent, string &in asChild, int alState)
{
AddEntityCollideCallback("MovingBook_2", "MovingArea_2", "FifthPull", true, 1);
AddDebugMessage("CASE NUMBER THREE WORKS", false);
}
void FourthPull(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("CASE NUMBER TWO OUTCOME WORKS", false);
}
void FifthPull(string &in asParent, string &in asChild, int alState)
{
AddDebugMessage("CASE NUMBER THREE OUTCOME WORKS", false);
}
///---BOOK PUZZLE SCRIPT---///