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
Lever puzzle
Endrek03 Offline
Junior Member

Posts: 8
Threads: 3
Joined: Dec 2010
Reputation: 0
#1
Lever puzzle

Hey all,

New to the forums, new to HPL, and new to scripting language (C++?).
. . . I know, so grating on your ears, right? Tongue

I'm great at picking things up and have been teaching myself as I go. I'm actually quite surprised at how far I've come without having to come on the forums.
But, alas, something has kicked my butt.

In my game, the player goes into the attic and is greeted by 5 levers and a locked chest. Using other information obtained, they must pull the levers in a certain order to unlock the chest. The order is 3 - 5 - 1 - 3. 4 is not touched.
For the life of me I can't figure out how to make this happen.

I was able to find a Thread in which the player had to light candles in a certain order, but unfortunately the code base is too different to transfer over simply enough, or at least I'm too out of it to figure it out.

This is what I was able to change it to:

Spoiler below!

void combolever(string &in asEntity, string &in asType)
{
if(asType == "OnPull")
{

if((asEntity == "lever_combo_3") && (GetLocalVarInt("combototal") == 0))
{
AddLocalVarInt("comboright", 1);
}
if((asEntity == "lever_combo_5") && (GetLocalVarInt("combototal") == 1))
{
AddLocalVarInt("comboright", 1);
}
if((asEntity == "lever_combo_1") && (GetLocalVarInt("combototal") == 2))
{
AddLocalVarInt("comboright", 1);
}
if((asEntity == "lever_combo_3") && (GetLocalVarInt("combototal") == 3))
{
AddLocalVarInt("comboright", 1);
}

AddLocalVarInt("combototal", 1);

if((GetLocalVarInt("combototal") == 4))
{
if(GetLocalVarInt("combototal") == GetLocalVarInt("comboright"))
{
PlaySoundAtEntity("rawr", "guardian_ontop.snt", "Player", 0.0f, false);
SetLeverStuckState("chest_kitchen_1", 1, false);
}
else if(GetLocalVarInt("comboright") < GetLocalVarInt("combototal"))
{
SetLocalVarInt("comboright", 0);
SetLocalVarInt("combototal", 0);

}
}
}
}


Something in there doesn't feel like working.
Any help? And more importantly the why? I'm a big fan of teaching a man how to fish. Smile
12-14-2010, 06:41 AM
Find


Messages In This Thread
Lever puzzle - by Endrek03 - 12-14-2010, 06:41 AM
RE: Lever puzzle - by Frontcannon - 12-14-2010, 05:46 PM
RE: Lever puzzle - by Endrek03 - 12-14-2010, 10:12 PM
RE: Lever puzzle - by Akumasama - 12-14-2010, 10:24 PM
RE: Lever puzzle - by Frontcannon - 12-14-2010, 10:34 PM



Users browsing this thread: 1 Guest(s)