Frictional Games Forum (read-only)

Full Version: Repeat monster
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
And yet again it's time for Rairai's Question Hour! In today's episode, I have to ask you:
How do you let a monster respawn?
I'll explain the situation: I at one moment let a monster spawn which will break the door ahead of you, so that you can progress. It is, however, also so that the monster will chase after the player, and potentialy kill him. If this happens before the monster breaks the door, you'll respawn, to find yourself monsterless, and with the door you need to go to, still firmly locked.
is there a way I can reuse the monster + scriptarea, so that it'll spawn a second time, if the player has died too early?

note: disabling triggers for the monster is not an option, for it'll ruin the scare.
Maybe set a checkpoint, and create a callback to a procedure that will set the grunt active (or an a timer)

CheckPoint(string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

Alternatively, just create a collide area, that isn't destroyed when the player crosses it; so the player can cross it again after they have died and respawn the monster.
(06-18-2011, 10:42 PM)Nye Wrote: [ -> ]Maybe set a checkpoint, and create a callback to a procedure that will set the grunt active (or an a timer)

CheckPoint(string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

Alternatively, just create a collide area, that isn't destroyed when the player crosses it; so the player can cross it again after they have died and respawn the monster.

god I feel dumb now, I have no idea of to make/use both of your suggestions v.v
Someone else can explain, I'm on my phone xD
(06-18-2011, 10:54 PM)Karai16 Wrote: [ -> ]
(06-18-2011, 10:42 PM)Nye Wrote: [ -> ]Maybe set a checkpoint, and create a callback to a procedure that will set the grunt active (or an a timer)

CheckPoint(string& asName, string& asStartPos, string& asCallback, string& asDeathHintCat, string& asDeathHintEntry);

Alternatively, just create a collide area, that isn't destroyed when the player crosses it; so the player can cross it again after they have died and respawn the monster.

god I feel dumb now, I have no idea of to make/use both of your suggestions v.v


I'm assuming you know how to use the Entity Collide callback. Make the auto-remove true. In your OnStart() add:

Code:
CheckPoint("", "StartPosition", "Reset", "", "");

Then, somewhere outside of your OnStart(), add:

Code:
void Reset (string &in asName, int alCount)
{
          //The same collide callback goes here
}


Basically all this does is check when you die, respawns you at StartPosition and runs the function Reset. Inside Reset, is a simple line that re-adds an EntityCollideCallback so that it will function again but only after you die.
(06-18-2011, 10:56 PM)Nye Wrote: [ -> ]Someone else can explain, I'm on my phone xD

Nye, quit calling me!
(06-19-2011, 12:15 AM)Russ Money Wrote: [ -> ]
(06-18-2011, 10:56 PM)Nye Wrote: [ -> ]Someone else can explain, I'm on my phone xD

Nye, quit calling me!

Shhhhhhhh
They're sexting....