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
Scripts won't work
nickTs Offline
Junior Member

Posts: 12
Threads: 3
Joined: Sep 2010
Reputation: 0
#4
RE: Scripts won't work

(09-17-2010, 10:51 AM)MulleDK19 Wrote: Post your script.

void OnStart()
{

    AddUseItemCallback("useexit", "doorkey_1", "keydoor_1", "UseKey",true);
    AddEntityCollideCallback("Player", "mgrowl1area", "CollideCallback", true, 1);
    AddEntityCollideCallback("Player", "GruntScare1area", "CollideCallback", true, 1);
}

void CollideCallback(string &in parent, string &in child, int state)
{
    if(child == "mgrowl1area")
    {
        AddTimer("monster_growl_01.snt", 0, "TimedSoundSequence");
    } else if(child == "GruntScare1area")
    {
        SetEntityActive("GruntScare1", true);
        AddEnemyPatrolNode("GruntScare1", "GruntScare1Node1", 0, "");
        AddEnemyPatrolNode("GruntScare1", "GruntScare1Node2", 0, "");
        AddEntityCollideCallback("GruntScare1", "GruntScare1gone",
    } else if(child == "GruntScare1gone")
    {
        FadeEnemyToSmoke("GruntScare1", false);
    }
}

void TimedSoundSequence(string &in timer)
{
    PlaySoundAtEntity("", timer, "mgrowl1pos", 0, false);
}

This is what I'm trying right now. All of this, except for the key script, is from the example that Deruu posted, but with appropriate renames and light trimming. When I try to run the map I get a crash and error "main (29,2):ERR :Expected expression value." The weird part is that the script worked perfectly in the example map, but maybe I'm missing something obvious or accidentally changed something I wasn't supposed to. I've been staring at scripts for a while now, the lines are starting to blur together.Confused

Edit: Line 29 in the full script is } else if(child == "GruntScare1gone")
09-17-2010, 11:42 AM
Find


Messages In This Thread
Scripts won't work - by nickTs - 09-17-2010, 07:56 AM
RE: Scripts won't work - by Deruu - 09-17-2010, 10:00 AM
RE: Scripts won't work - by MulleDK19 - 09-17-2010, 10:51 AM
RE: Scripts won't work - by nickTs - 09-17-2010, 11:42 AM
RE: Scripts won't work - by jens - 09-17-2010, 11:53 AM
RE: Scripts won't work - by jens - 09-17-2010, 11:56 AM
RE: Scripts won't work - by MulleDK19 - 09-17-2010, 12:02 PM
RE: Scripts won't work - by nickTs - 09-17-2010, 12:14 PM
RE: Scripts won't work - by Deruu - 09-17-2010, 01:08 PM
RE: Scripts won't work - by nickTs - 09-18-2010, 12:13 PM
RE: Scripts won't work - by Deruu - 09-18-2010, 01:37 PM



Users browsing this thread: 1 Guest(s)