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
How to make Script puzzles?
HumiliatioN Offline
Posting Freak

Posts: 1,179
Threads: 64
Joined: Dec 2010
Reputation: 18
#13
RE: How to make Script puzzles?

(06-23-2011, 03:17 AM)rojkish Wrote: I remade the script entirely for you, it should work out now.

Spoiler below!


void CollideSecretBook(string &in asParent, string &in asChild, int alState)
{
if(alState == 1) {
SetLocalVarInt("Var"+asParent, 1);

AddTimer(asParent, 20, "PushBackBook");

SetPropObjectStuckState(asParent, 1);

PlaySoundAtEntity("Sound"+asParent, "gameplay_tick", asParent, 0.0f, false);

StartScreenShake(0.001f, 0.5f, 0.5f, 0.5f);

PlayGuiSound("16_lever_stuck", 0.3f);

AddDebugMessage("Book in area: "+asParent, true);
}
else
{
SetLocalVarInt("Var"+asParent, 0);

RemoveTimer(asParent);

PlaySoundAtEntity("Sound2"+asParent, "lock_door", asParent, 1.5f, false);
PlayGuiSound("16_lever_stuck", 0.2f);

StopSound("Sound"+asParent, 1.0f);

AddDebugMessage("Book out of area: "+asParent, true);
}


if(GetLocalVarInt("VarSecretBook_1") == 1 && GetLocalVarInt("VarSecretBook_2") == 1 && GetLocalVarInt("VarSecretBook_3") == 1)
{
SetMoveObjectState("shelf_secret_door_1", 1);

SetPropObjectStuckState("SecretBook_*", -1);

SetEntityInteractionDisabled("SecretBook_*", true);

PlaySoundAtEntity("BooksDone", "lock_door", "Player", 0, false);

CreateParticleSystemAtEntity("dust", "ps_dust_falling_door_quick", "AreaDoorParticle", false);

for(int i=1;i<=3;i++){ RemoveTimer("SecretBook_"+i); StopSound("SoundSecretBook_"+i, 0.0f); }

GiveSanityBoostSmall();

PlayMusic("03_puzzle_secret.ogg", false, 0.7f, 0, 10, false);

CompleteQuest("03Books", "03Books");

AddDebugMessage("All books in position, move shelf!", true);
}

}

void PushBackBook(string &in asTimer)
{
SetPropObjectStuckState(asTimer, -1);

AddTimer("2"+asTimer, 0.25f, "PushBackBook02");

AddDebugMessage("Push back book: "+asTimer, true);
}

void PushBackBook02(string &in asTimer)
{
if(asTimer == "2SecretBook_1") SetPropObjectStuckState("SecretBook_1", 0);
else if(asTimer == "2SecretBook_2") SetPropObjectStuckState("SecretBook_2", 0);
else SetPropObjectStuckState("SecretBook_3", 0);
SetEntityPlayerInteractCallback("shelf_secret_door_1", "InteractMoveShelf", true);
}



If it doesn't, try putting the script area closer so the book can reach.

Still, no luck.. Damn :I

“Life is a game, play it”
06-23-2011, 03:29 AM
Find


Messages In This Thread
How to make Script puzzles? - by HumiliatioN - 06-21-2011, 03:51 PM
RE: How to make Script puzzles? - by WatzUpzPeepz - 06-21-2011, 04:18 PM
RE: How to make Script puzzles? - by HumiliatioN - 06-21-2011, 04:20 PM
RE: How to make Script puzzles? - by Nye - 06-21-2011, 04:21 PM
RE: How to make Script puzzles? - by HumiliatioN - 06-21-2011, 04:26 PM
RE: How to make Script puzzles? - by rojkish - 06-21-2011, 07:16 PM
RE: How to make Script puzzles? - by HumiliatioN - 06-22-2011, 01:08 PM
RE: How to make Script puzzles? - by laser50 - 06-22-2011, 02:06 PM
RE: How to make Script puzzles? - by HumiliatioN - 06-22-2011, 10:23 PM
RE: How to make Script puzzles? - by rojkish - 06-23-2011, 01:26 AM
RE: How to make Script puzzles? - by HumiliatioN - 06-23-2011, 03:04 AM
RE: How to make Script puzzles? - by rojkish - 06-23-2011, 03:17 AM
RE: How to make Script puzzles? - by HumiliatioN - 06-23-2011, 03:29 AM
RE: How to make Script puzzles? - by rojkish - 06-23-2011, 03:35 AM
RE: How to make Script puzzles? - by HumiliatioN - 06-23-2011, 11:01 AM
RE: How to make Script puzzles? - by rojkish - 06-23-2011, 01:40 PM
RE: How to make Script puzzles? - by HumiliatioN - 06-23-2011, 02:19 PM
RE: How to make Script puzzles? - by rojkish - 06-23-2011, 02:30 PM
RE: How to make Script puzzles? - by HumiliatioN - 06-23-2011, 02:42 PM



Users browsing this thread: 3 Guest(s)