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
#8
RE: Scripts won't work

(09-17-2010, 12:02 PM)MulleDK19 Wrote: AddEntityCollideCallback("GruntScare1", "GruntScare1gone", "Function", true, 1);

Adding this let the map and script load, but the grunt pauses at node1 then continues to pace between the two. Do I need to add more than one node if I want him to walk in a straight line?

The sound played fine, though it didn't seem to come from the direction of the Area I placed.
I took node2 out and now the grunt just walks to node1 and stands there. I also moved the sound area far to my right, but it still sounds like it's being played right where I stand only quieter.

(09-17-2010, 11:53 AM)jens Wrote: please post the full script

void UseKey(string &in asItem, string &in asEntity)
{
SetSwingDoorLocked(asEntity, false, true);

RemoveItem(asItem);
}


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, "");
        AddEntityCollideCallback("GruntScare1", "GruntScare1gone", "Function", true, 1);
    } else if(child == "GruntScare1gone")
    {
        FadeEnemyToSmoke("GruntScare1", false);
    }
}

void TimedSoundSequence(string &in timer)
{
    PlaySoundAtEntity("", timer, "mgrowl1pos", 0, false);
}
(This post was last modified: 09-17-2010, 12:45 PM by nickTs.)
09-17-2010, 12:14 PM
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)