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
3 books open door script
Lukaboy8 Offline
Junior Member

Posts: 25
Threads: 10
Joined: Aug 2012
Reputation: 0
#10
RE: 3 books open door script

Thanks! My script is done now and sounds are in it too!

EDIT: I got an error and it says unexpected and of file. This is my script:

PHP Code: (Select All)
void OnStart()
{
AddEntityCollideCallback("Book1""Bookarea1""Bookstart"false1);
AddEntityCollideCallback("Book2""Bookarea2""Bookstart"false1);
AddEntityCollideCallback("Book3""Bookarea3""Bookstart"false1);
SetLocalVarInt("BookVar"0); 
}
void Bookstart(string &in asParentstring &in asChildint alState)
{
AddTimer("Puzzletimer"30.0f"RestartPuzzle");
if(
asParent == "Book1")
{
AddLocalVarInt("BookAm"1);
SetPropObjectStuckState("Book1"1);
PlaySoundAtEntity("Book1Sound, "gameplay_tick", Book1, 0.0f, false);
GetPuzzleComplete();
}
if(asParent == "
Book2")
{
AddLocalVarInt("
BookAm", 1);
SetPropObjectStuckState("
Book2", 1);
PlaySoundAtEntity("
Book2Sound"gameplay_tick"Book20.0ffalse);
GetPuzzleComplete(); 
}
if(
asParent == "Book3")
{
AddLocalVarInt("BookAm"1);
SetPropObjectStuckState("Book3"1);
PlaySoundAtEntity("Book3Sound, "gameplay_tick", Book3, 0.0f, false);
GetPuzzleComplete(); 

}
void GetPuzzleComplete()
{
if(GetLocalVarInt("
BookAm") == 3)
{
SetSwingDoorLocked("
Librarydoor", false, true);
PlaySoundAtEntity("
BooksDone", "lock_door", "Player", 0, false);
RemoveTimer("
Puzzletimer");
}
}
void RestartPuzzle(string &in asTimer)
{
SetLocalVarInt("
BookAm", 0); 
SetPropObjectStuckState("
Book1", -1);
SetPropObjectStuckState("
Book2", -1);
SetPropObjectStuckState("
Book3", -1);
RemoveTimer("
Puzzletimer");
AddTimer("
Restarttimer", 1.0f, "RestartPuzzle2");
}
void RestartPuzzle2(string &in asTimer)
{
SetPropObjectStuckState("
Book1", 0);
SetPropObjectStuckState("
Book2", 0);
SetPropObjectStuckState("
Book3", 0);
RemoveTimer("
Restarttimer");

(This post was last modified: 08-05-2012, 03:59 PM by Lukaboy8.)
08-05-2012, 03:47 PM
Find


Messages In This Thread
3 books open door script - by Lukaboy8 - 08-04-2012, 04:37 PM
RE: 3 books open door script - by EXAWOLT - 08-04-2012, 04:53 PM
RE: 3 books open door script - by Lukaboy8 - 08-04-2012, 04:56 PM
RE: 3 books open door script - by Adny - 08-04-2012, 04:58 PM
RE: 3 books open door script - by EXAWOLT - 08-04-2012, 05:04 PM
RE: 3 books open door script - by Lukaboy8 - 08-05-2012, 12:27 PM
RE: 3 books open door script - by SilentStriker - 08-05-2012, 12:32 PM
RE: 3 books open door script - by Lukaboy8 - 08-05-2012, 12:43 PM
RE: 3 books open door script - by SilentStriker - 08-05-2012, 01:02 PM
RE: 3 books open door script - by Lukaboy8 - 08-05-2012, 03:47 PM
RE: 3 books open door script - by SilentStriker - 08-05-2012, 04:01 PM
RE: 3 books open door script - by Lukaboy8 - 08-05-2012, 04:21 PM



Users browsing this thread: 1 Guest(s)