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
Levers in Order
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#7
RE: Levers in Order

(08-13-2012, 07:39 PM)TheIcyPickle Wrote: huh, i tried your script, a few errors, easy to fix btw Smile but, it seems that the levers do not stick up when you pull one of the wrong levers first, it does not stay up. Which in turn removes the "puzzle" aspect.

haha I think its something to do with your script. Ill check it as well.

void GiveSanityDamage(string &in asParent, string &in asChild, int alState)
{
PlaySoundAtEntity("", "react_pant.snt", "Player", 0, false);
PlaySoundAtEntity("", "enemy_hallucination_disappear.snt", "Player", 0, false);
GiveSanityDamage(10, false);
SetMessage("Messages", "holyfuckingshit", 4.0f);
}

void SetSwingDoorLocked(string &in asEntity, int alState)
{
if(GetLocalVarInt("Sequence") == 0 && asEntity == "lever_simple01_2")
{
AddLocalVarInt("Sequence", 1);
SetLeverStuckState(asEntity, alState, true);
}

if(GetLocalVarInt("Sequence") == 1 && asEntity == "lever_simple01_3")
{
AddLocalVarInt("Sequence", 1);
SetLeverStuckState(asEntity, alState, true);
}

if(GetLocalVarInt("Sequence") == 2 && asEntity == "lever_simple01_1")
{
AddLocalVarInt("Sequence", 1);
SetLeverStuckState(asEntity, alState, true);
SetSwingDoorLocked("hatch_metal01_1", false, true);
PlayMusic("03_puzzle_secret.ogg", false, 0.3, 0.1, 10, false);
PlaySoundAtEntity("", "unlock_door", "Player", 0, false);

FadeLightTo("SpotLight_8", 0, 0, 0, 0, -1, 0.5f);
FadeLightTo("SpotLight_4", 0.4f, 0.5f, 0.9f, -1, -1, 0.5f);



GiveSanityBoost();
}

if(GetLeverState(asEntity) == 1)
//If it does not get stuck due to success, it means it failed, so make it stuck as failed.
{
AddLocalVarInt("Fail", 1);
SetLeverStuckState(asEntity, alState, true);
if((GetLeverState("lever_simple01_3") == alState) && (GetLeverState("lever_simple01_2") == alState) && (GetLeverState("lever_simple01_1") == alState))
//If the last possible stuck one was due to a fail, then reset all and play a "machine fail" sound.

/*This little "if" is only possible thanks to the fact that you can't have a success at the last lever without success at all of them. So if you intend to make the lever pulls rely only on themselves, then redo this "if". (Ignore this part if you like it the way it is)*/

{
PlaySoundAtEntity("", "13_machine_fail.snt","Player",0.1f, false);
SetLeverStuckState("lever_simple01_3", 0, false);
SetLeverStuckState("lever_simple01_2", 0, false);
SetLeverStuckState("lever_simple01_1", 0, false);

SetLocalVarInt("Sequence",0);
SetLocalVarInt("Fail",0);
/*Note that in this script, the Variable "Fail" is entirely useless. I just wanted to put it there for you to use if you want to, for like having different sounds depending on how many fails there were.*/
}

}
}


is how I did it. Change a few things from true to false, 0 to 1. And so on. It works now. Haha nice work guys! However if you think it could be better, do tell!

Also. if you can, one more thing, this is sort off off the topic, but, I have a door that is supposed to fly open. It does, but its either too slow, or too fast that is closes shut again. Anyway how to make a door fly open quickly and keep it there?
Glad that I could help. Smile

Hm, try to find the perfect float number. Otherwise, I suppose it could be something with the positioning of the door.

Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
(This post was last modified: 08-13-2012, 08:22 PM by Theforgot3n1.)
08-13-2012, 08:22 PM
Website Find


Messages In This Thread
Levers in Order - by TheIcyPickle - 08-13-2012, 07:10 AM
RE: Levers in Order - by FlawlessHappiness - 08-13-2012, 09:36 AM
RE: Levers in Order - by TheIcyPickle - 08-13-2012, 09:43 AM
RE: Levers in Order - by FlawlessHappiness - 08-13-2012, 10:36 AM
RE: Levers in Order - by Theforgot3n1 - 08-13-2012, 11:13 AM
RE: Levers in Order - by TheIcyPickle - 08-13-2012, 07:39 PM
RE: Levers in Order - by Theforgot3n1 - 08-13-2012, 08:22 PM
RE: Levers in Order - by TheIcyPickle - 08-13-2012, 08:40 PM



Users browsing this thread: 1 Guest(s)