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
Fancy door + quest scripting.
Streetboat Offline
Posting Freak

Posts: 1,099
Threads: 40
Joined: Mar 2011
Reputation: 56
#9
RE: Fancy door + quest scripting.

Additional problem: Could anyone possibly tell me what's wrong with this script? It's a different level from the other one. There are 00_woodshop and 01_house in terms of levels. When the player enters an area in 01_house, it's supposed to do what's in this script, but it just crashes instead. Is it not possible to check and see if a VarInt from another level is true? My first attempt was an 'if... else' using "HasItem" and checking for the lantern, but that also crashed. What am I doing wrong?
void OnStart()
    {
    AddEntityCollideCallback("Player", "needlantern", "lantern_warn", true, 1);
    }
void lantern_warn(string &in asParent, string &in asChild, int alState)
    {
    if (GetLocalVarInt("HasLantern") == 1)
        {
        PlaySoundAtEntity("scare_dog", "scare_animal_squeal2.snt", "needlantern", 0, true);
        AddTimer("dogreact", 0.5f, "scaredgasp2");
        }
    else
        {
        PlaySoundAtEntity("scare_dog", "scare_animal_squeal2.snt", "needlantern", 0, true);
        SetPlayerCrouching(true);
        AddTimer("dogreact", 0.5f, "scaredgasp2");
        SetMessage("house", "TooDark", 0);
        AddQuest("questtext2","questtext2");
        }
    }
void scaredgasp2(string &in asTimer)
    {
    PlayMusic("react_scare3",false,100.0f,0.0f,1,false);
    GiveSanityDamage(10.0f,true);
    GiveHint("sanity", "Hints", "Sanity", 0);
    }
I have a callback on the lantern in the other level's script that sets "HasLantern" to 1 when it's picked up.

[Image: signature-2.png]
(This post was last modified: 03-19-2011, 08:13 AM by Streetboat.)
03-19-2011, 08:05 AM
Find


Messages In This Thread
Fancy door + quest scripting. - by Streetboat - 03-18-2011, 07:47 PM
RE: Fancy door + quest scripting. - by Nye - 03-18-2011, 09:09 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-18-2011, 09:45 PM
RE: Fancy door + quest scripting. - by Nye - 03-18-2011, 10:00 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-18-2011, 10:27 PM
RE: Fancy door + quest scripting. - by Nye - 03-19-2011, 12:21 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-19-2011, 02:43 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-19-2011, 08:05 AM
RE: Fancy door + quest scripting. - by Nye - 03-19-2011, 08:47 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-19-2011, 09:11 AM
RE: Fancy door + quest scripting. - by Nye - 03-19-2011, 10:15 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-19-2011, 10:33 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-20-2011, 06:38 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-20-2011, 11:41 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-21-2011, 12:53 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-21-2011, 04:10 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-21-2011, 08:08 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-21-2011, 09:57 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-22-2011, 10:16 PM
RE: Fancy door + quest scripting. - by Streetboat - 03-23-2011, 01:59 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-23-2011, 02:26 AM
RE: Fancy door + quest scripting. - by Streetboat - 03-24-2011, 09:59 AM



Users browsing this thread: 1 Guest(s)