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
[SOLVED]Lever if-statements nearly working...
Theforgot3n1 Offline
Member

Posts: 192
Threads: 20
Joined: Apr 2012
Reputation: 6
#6
RE: Lever if-statements nearly working...

(06-11-2012, 01:30 PM)beecake Wrote: Actually i figured it out i hope:
void MachineSoundTimer(string &in asTimer)
{
PlaySoundAtEntity("","13_machine_run.snt", "ScriptArea_2", 0, false);
SetEntityActive("ScriptArea_18", true);
SetEntityActive("ScriptArea_19", true);
SetEntityActive("ScriptArea_20", true);
}


///LEVERS

void PipeStart3_1(string &in asEntity, int alState)
{
if(alState == -1)
{
AddDebugMessage("MachineStart +1", false);
AddLocalVarInt("MachineStart", 1);
SetLeverStuckState("lever_simple01_4", -1, true);
PlaySoundAtEntity("","13_press_done.snt", "ScriptArea_8", 0, false);
CreateParticleSystemAtEntity("Steam_5", "ps_steam.ps", "ScriptArea_7", true);
PlaySoundAtEntity("","13_steam.snt", "ScriptArea_7", 0, false);
CreateParticleSystemAtEntity("Steam_6", "ps_steam.ps", "ScriptArea_8", true);
PlaySoundAtEntity("","13_steam.snt", "ScriptArea_8", 0, false);
SetEntityActive("StickyArea_1", true);
Instead of having an 'else' here i just made it inside the if statement..
if(GetLocalVarInt("MachineStart") == 3)
{
AddPlayerSanity(5.0f);
AddTimer("", 0.3, "MachineSoundTimer");
CreateParticleSystemAtEntity("Steam_nonstop_1", "ps_steam.ps", "ScriptArea_9", true);
PlaySoundAtEntity("","13_steam.snt", "ScriptArea_12", 0, false);
CreateParticleSystemAtEntity("Steam_nonstop_2", "ps_steam.ps", "ScriptArea_10", true);
PlaySoundAtEntity("","13_steam.snt", "ScriptArea_13", 0, false);
CreateParticleSystemAtEntity("Steam_nonstop_3", "ps_steam.ps", "ScriptArea_11", true);
PlaySoundAtEntity("","13_steam.snt", "ScriptArea_14", 0, false);
}
}
}

This works for me
This script is very different to the earlier one. So you didn't really fix anything, you only modified it to the right.

Confusion: a Custom Story - Ch1 for play!
http://www.frictionalgames.com/forum/thread-15477.html
About 50% built.
Delayed for now though!
06-11-2012, 02:53 PM
Website Find


Messages In This Thread
RE: Lever if-statements nearly working... - by Theforgot3n1 - 06-11-2012, 02:53 PM



Users browsing this thread: 3 Guest(s)