Frictional Games Forum (read-only)
Repeat monster - Printable Version

+- Frictional Games Forum (read-only) (https://www.frictionalgames.com/forum)
+-- Forum: Amnesia: The Dark Descent (https://www.frictionalgames.com/forum/forum-6.html)
+--- Forum: Custom Stories, TCs & Mods (https://www.frictionalgames.com/forum/forum-35.html)
+--- Thread: Repeat monster (/thread-8679.html)



Repeat monster - Karai16 - 06-18-2011

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.


RE: Repeat monster - Nye - 06-18-2011

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.


RE: Repeat monster - Karai16 - 06-18-2011

(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


RE: Repeat monster - Nye - 06-18-2011

Someone else can explain, I'm on my phone xD


RE: Repeat monster - DamnNoHtml - 06-18-2011

(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.


RE: Repeat monster - Russ Money - 06-19-2011

(06-18-2011, 10:56 PM)Nye Wrote: Someone else can explain, I'm on my phone xD

Nye, quit calling me!


RE: Repeat monster - Nye - 06-19-2011

(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


RE: Repeat monster - MrBigzy - 06-19-2011

They're sexting....