Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
if & else URGENT! PLZ!
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#2
RE: if & else URGENT! PLZ!

void OnStart(){
    SetLocalVarInt("Lev", 1);
    SetEntityConnectionStateChangeCallback("Lever1", "L1");
    SetEntityConnectionStateChangeCallback("Lever2", "L2");
}

void L1(string &in asEntity, int alState)
{
     if (GetLeverState("Lever1") == 1)
     {
    SetEntityActive("ScriptArea_6", true);
    SetEntityActive("ScriptArea_4", true);
    SetLeverStuckState("Lever1", 1, true);
     }
}

void L2(string &in asEntity, int alState)
{
     if (GetLeverState("Lever2") == 1)
     {
          SetSwingDoorLocked("KeyStudyDoor", false, true);
      SetEntityActive("PrisonDoor", false);
          SetLeverStuckState("Lever2", 1, true);
     }
}
This is the code I used in my custom story to get my levers to work. I hope you'll be able to use it. If you want it to show the other message, I think you'll have to add something like this.

void L2(string &in asEntity, int alState)
{
     if (GetLeverState("Lever2") == 1)
     {
          SetSwingDoorLocked("KeyStudyDoor", false, true);
      SetEntityActive("PrisonDoor", false);
          SetLeverStuckState("Lever2", 1, true);
     }
     else {
         if (GetLeverState("Lever2")==0)
         {
             SetMessage("Message", "used1", 3);
          }
     }
}

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
(This post was last modified: 05-21-2011, 11:13 AM by Karai16.)
05-21-2011, 11:05 AM
Find


Messages In This Thread
if & else URGENT! PLZ! - by X4anco - 05-21-2011, 09:58 AM
RE: if & else URGENT! PLZ! - by Karai16 - 05-21-2011, 11:05 AM
RE: if & else URGENT! PLZ! - by Russ Money - 05-21-2011, 11:10 AM
RE: if & else URGENT! PLZ! - by X4anco - 05-21-2011, 11:44 AM



Users browsing this thread: 1 Guest(s)