The following warnings occurred:
Warning [2] count(): Parameter must be an array or an object that implements Countable - Line: 906 - File: showthread.php PHP 7.2.24-0ubuntu0.18.04.17 (Linux)
File Line Function
/showthread.php 906 errorHandler->error



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
Script Help Lever Puzzle Help
RurouniMori Offline
Junior Member

Posts: 11
Threads: 3
Joined: Apr 2013
Reputation: 0
#1
Lever Puzzle Help

I'm trying to make a lever puzzle where after three levers are pulled in a certain order, a painting slides, and a key falls. I've made a fair amount of progress on my script so far as a whole, but I'd definitely still say I'm a noob. XP I'm having issues getting the levers to work and therefore, for the puzzle to work at all.

Basically, what I want to happen is:
1. Read a note that has a riddle on it, levers are made active.
2. Pull lever1, lever2, then lever3 in order.
3. The painting slides over, key is made active, it falls, puzzle solved.

I don't know how to make it so the levers lock after use, that way you know you pulled it in the right direction and it worked. And if I can figure out or get help how to do this, how can I reset it if they do it wrong?

Here's my script (just the puzzle related info):
////////////////////////////
// Run first time starting map
void OnEnter()
{
        SetEntityCallbackFunc("puzzlenote", "OnRead");
        SetEntityConnectionStateChangeCallback("lever1", "LeverStateChange");
        SetEntityConnectionStateChangeCallback("lever2", "LeverStateChange");
        SetEntityConnectionStateChangeCallback("lever3", "LeverStateChange");
}

void OnRead(string &in asEntity, string &in type)
{
        AddQuest("puzzle", "puzzle");
        SetEntityActive("lever1", true);
        SetEntityActive("lever2", true);
        SetEntityActive("lever3", true);
}
void LeverStateChange(string &in asEntity, int alState)
{
        if((GetLeverState("lever1") == 1) && (GetLeverState("lever2") == 1) && (GetLeverState("lever3") == 1))
        {
            PlaySoundAtEntity("","level_wood_min_max01.snt", "lever3", 0, false);
            AddPropForce("themaiden", 200, 0, 0, "mylordscurse_1");
            AddTimer("", 2, "PaintingMove");
            SetEntityInteractionDisabled("lever1", true);
            SetEntityInteractionDisabled("lever2", true);
            SetEntityInteractionDisabled("lever3", true);
        }
}
void PaintingMove(string &in asTimer)
{
        SetEntityActive("chapter2key", true);
        SetPlayerSanity(90);
        PlayMusic("10_puzzle01.ogg", false, 0.7, 0.1, 10, false);
}

Any help would be greatly appreciated! Thank you!
05-09-2013, 10:05 PM
Find


Messages In This Thread
Lever Puzzle Help - by RurouniMori - 05-09-2013, 10:05 PM
RE: Lever Puzzle Help - by Tomato Cat - 05-09-2013, 11:08 PM
RE: Lever Puzzle Help - by RurouniMori - 05-09-2013, 11:22 PM
RE: Lever Puzzle Help - by PutraenusAlivius - 05-10-2013, 12:10 AM
RE: Lever Puzzle Help - by Tomato Cat - 05-10-2013, 12:27 AM
RE: Lever Puzzle Help - by RurouniMori - 05-10-2013, 01:37 AM
RE: Lever Puzzle Help - by RurouniMori - 05-10-2013, 02:46 AM
RE: Lever Puzzle Help - by Tomato Cat - 05-10-2013, 02:59 AM
RE: Lever Puzzle Help - by RurouniMori - 05-10-2013, 03:07 AM
RE: Lever Puzzle Help - by Tomato Cat - 05-10-2013, 03:20 AM



Users browsing this thread: 4 Guest(s)