Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Question about a timed book script
devin413 Offline
Member

Posts: 175
Threads: 7
Joined: Jul 2011
Reputation: 3
#2
RE: Question about a timed book script

//BOOK1//

void book4(string &in asParent, string &in asChild, int alState)
{


{
SetPropStaticPhysics("book_moveable_4", true);
AddLocalVarInt("Var2", 1);
enter();
}
}

//BOOK2//


void book1(string &in asParent, string &in asChild, int alState)
{

{
SetPropStaticPhysics("book_moveable_2", true);
AddLocalVarInt("Var2", 1);
enter();
}
}


//BOOK3//

void book3(string &in asParent, string &in asChild, int alState)
{

{
SetPropStaticPhysics("book_moveable_3", true);
AddLocalVarInt("Var2", 1);
enter();
}
}


void enter()
{

///////////////////////////

if(GetLocalVarInt("Var2") == 3)
{
StopSound("book", 0);
RemoveTimer("booktimer");
SetMoveObjectState("shelf_secret_door_2", 1.0f);
}

//Timer Start's if get Var2 == 1

if(GetLocalVarInt("Var2") == 1)
{
AddTimer("booktimer", 6, "resetbook");
PlaySoundAtEntity("book", "gameplay_tick.snt", "Player", 0, false);
}
}

//////////////////////////////////

void resetbook(string &in asTimer)
{
StopSound("book", 0);
SetPropStaticPhysics("book_moveable_4", false);
SetPropStaticPhysics("book_moveable_3", false);
SetPropStaticPhysics("book_moveable_1", false);
AddPropImpulse("book_moveable_3", 0.0f, 0.0f, 5.0f, "World");
AddPropImpulse("book_moveable_1", 0.0f, 0.0f, 5.0f, "World");
AddPropImpulse("book_moveable_4", 0.0f, 0.0f, 5.0f, "World");
SetLocalVarInt("Var2", 0);
enter();
}



void OnEnter()
{
AddEntityCollideCallback("book_moveable_4", "areacode_4", "book4", false, 1);
AddEntityCollideCallback("book_moveable_2", "areacode_2", "book1", false, 1);
AddEntityCollideCallback("book_moveable_3", "areacode_3", "book3", false, 1);

}



i scipt it for you hope it will help you ^^

Boris Game Studios: Devin413 Moddels Maps Scripts.
Tenebris Lake
Killings In Altstadt

(This post was last modified: 11-03-2011, 07:14 PM by devin413.)
11-03-2011, 07:13 PM
Find


Messages In This Thread
RE: Question about a timed book script - by devin413 - 11-03-2011, 07:13 PM



Users browsing this thread: 1 Guest(s)