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


Thread Rating:
  • 2 Vote(s) - 3 Average
  • 1
  • 2
  • 3
  • 4
  • 5
I'm back, with a new custom story and another question! [SOLVED]
Karai16 Offline
Member

Posts: 164
Threads: 24
Joined: Apr 2011
Reputation: 0
#8
RE: I'm back, with a new custom story and another question!

(07-25-2011, 11:51 PM)Roenlond Wrote: When you pick up the lantern in map 1, set a global variable to 1 and check if that variable is 1 when you click on the door.

Okay, I did that, but it still won't open the door... Here are the scripts:

Hallway: (The map where the game starts (atm) and where the door is that needs to be unlocked)
void OnGameStart()
{
    SetGlobalVarInt("LanternVar", 1);
}

void OnStart()
{
    SetEntityPlayerInteractCallback("OutsideDoor", "Checking", true);
    AddEntityCollideCallback("Player", "ScriptArea_1", "Checking2", true, 1);
}

void Checking(string &in asEntity)
{
    if (GetGlobalVarInt("LanternVar") != 2)
    {
        SetMessage("Message", "OutsideDoorText", 0);
    }
}

void Checking2(string &in asParent , string &in asChild , int alState)
{
    if (GetGlobalVarInt("LanternVar") == 2)
    {
            SetLevelDoorLocked("OutsideDoor", false);
    }
}

Bedroom: (The map where you get the lantern)
void OnStart()
{
    SetEntityPlayerInteractCallback("Lantern", "Setvar", true);
}

void Setvar(string &in asEntity)
{
    AddGlobalVarInt("LanternVar", 1);
}
and for the record, yes, I am sure I called the lantern "Lantern"... I tried, but the door still won't open. Huh

Custom stories:
Her Games (100% Complete)
Her Games, All Bugs Fixed (100% Complete)
07-26-2011, 10:15 PM
Find


Messages In This Thread
RE: I'm back, with a new custom story and another question! - by Karai16 - 07-26-2011, 10:15 PM



Users browsing this thread: 1 Guest(s)