Frictional Games Forum (read-only)

Full Version: Monster De-Spawn Script
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
How do I get a monster to de-spawn at a certain node?

Use these terms:
Monster= MyNameIsBob_1
Node for de-spawn= Node_7

Please help D:
2 ways mostly.
a) When this is last node monster to be and wait time is over, it should disappear automatically. I think player can't be very close then or shouldn't see him.
b) script it ^^
(08-23-2011, 04:05 PM)Elven Wrote: [ -> ]2 ways mostly.
a) When this is last node monster to be and wait time is over, it should disappear automatically. I think player can't be very close then or shouldn't see him.
b) script it ^^

Umm. I'm asking how you script it :LL
Put a script area over the node. Then put an AddEntityCallback that checks for the grunt. If he crosses it, make him deactivate.
Oh that is easy. Everything is in your bible

Create script area where ur last node point is. And name it for example "monsterdisappear".
Add this into ur OnStart

AddEntityCollideCallback("MyNameIsBob_1", "monsterdisappear", "makemedisappear", true, 1);

and separately:

void makemedisappear(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("MyNameIsBob_1, true/false); //true if u want to play sound effect and false if not.
SetEntityActive("MyNameIsBob_1, false); //Its up to you which one you use. Second one instantly deletes it. First one makes it go into smoke with effect ^^
}
(08-23-2011, 04:28 PM)Elven Wrote: [ -> ]Oh that is easy. Everything is in your bible

Create script area where ur last node point is. And name it for example "monsterdisappear".
Add this into ur OnStart

AddEntityCollideCallback("MyNameIsBob_1", "monsterdisappear", "makemedisappear", true, 1);

and separately:

void makemedisappear(string &in asParent, string &in asChild, int alState)
{
FadeEnemyToSmoke("MyNameIsBob_1, true/false); //true if u want to play sound effect and false if not.
SetEntityActive("MyNameIsBob_1, false); //Its up to you which one you use. Second one instantly deletes it. First one makes it go into smoke with effect ^^
}

But what if I activate the trigger while the monster isn't active?
"MyNameIsBob_1" in AddEntityCollideCallback means that only the grunt will activate the script area, the player won't.
Basically it works anyway, but only when grunt goes inside it happens. Since grunt isnt active, it cant go inside - aka it wont work ^^
Its like that the area is only going to activated when the grunt will walk/run into it.
bad part is if the player some how tricks the monster and runs behind the area and the monsters is chasing him his going to get deactivaded.