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


Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Despawn water lurker when he eats meat?
DeAngelo Offline
Senior Member

Posts: 263
Threads: 26
Joined: Feb 2013
Reputation: 11
#1
Despawn water lurker when he eats meat?

Quick question, what script would I use to despawn a water lurker once he finishes eating a piece of meat? I want to despawn him then give a message of "That should keep it busy for a while, at least long enough for me to get that gate open" (I would just make the player hurry and get out while he eats, but for some reason half the time he ignores the meat altogether, some times he finishes eating it in like 3 seconds then comes after me, and a few times he spends the proper amount of time eating it.)

Thanks.

A Late Night Drink http://www.moddb.com/mods/a-late-night-drink
Check out my LP channel, CatBearGaming, I take all Custom Story requests!
08-06-2013, 06:15 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#2
RE: Despawn water lurker when he eats meat?

Hmm... you could try this:

Make a script area that surrounds the water. Put this:

void OnStart()
{
for (int i=1; i<500; i++) //500 in the case that you had 500 meats
{
AddEntityCollideCallback("Meat_"+i, "ScriptWater", "AddCollision", false, 1);
}
}

void AddCollision (string &in asParent, string &in asChild, int alState)
{
SetEnemyDisableTriggers("Waterlurker", false);
AddTimer("", //Time that your waterlurker will be busy//, "Reactivate");
}

void Reactivate (string &in asTimer)
{
SetEnemyDisableTriggers("Waterlurker", true);
}

It's possible that the true's and false's of SetEnemyDisableTriggers
have to be switched, just try this basic script and if it attacks you, change the true's for a false, and viceversa.

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-06-2013, 06:41 PM
Find
DeAngelo Offline
Senior Member

Posts: 263
Threads: 26
Joined: Feb 2013
Reputation: 11
#3
RE: Despawn water lurker when he eats meat?

Thanks, but I was just about to post that I figured it out. I couldn't find the right script because I was searching for "destroy" but it turns out I needed Break. I just put in the following script and it worked like a charm:


SetEntityCallbackFunc("LurkerBait", "EatingLurkerBait");

void EatingLurkerBait(string &in asEntity, string &in asBreak)
{
SetEntityActive("waterlurker_1", false);
SetMessage("Messages", "BusyLurker", 6);
}

This works best since the lurker gets "trapped" in a room (I plan on making some particles of him thrashing around the room once you trap him in it) then the player leaves through a doorway (A safety door with a slow lever, which is why he needed to be trapped.)

However the script you gave is neat. I'll use it if I need to do something similar later. Thanks Smile

A Late Night Drink http://www.moddb.com/mods/a-late-night-drink
Check out my LP channel, CatBearGaming, I take all Custom Story requests!
08-06-2013, 06:53 PM
Find
The chaser Offline
Posting Freak

Posts: 2,486
Threads: 76
Joined: Jun 2012
Reputation: 113
#4
RE: Despawn water lurker when he eats meat?

Doesn't matter, I try to help when I can Smile

THE OTHERWORLD (WIP)
[Image: k6vbdhu]

Aculy iz dolan.
08-06-2013, 08:25 PM
Find




Users browsing this thread: 1 Guest(s)