Life for NPCs

O Ilusionista

Captain 100K
Is there a simple way to set more than 1 life for a NPC? I would like to add a mode where we would have a AI controlled NPC version of a playable character.

I have the idea of spawning an entity where the NPC dies, to control/count how much lifes the NPC has (using a variable) and spawn it again if he still has enough life count. Dunno if this is the best idea.

My main concern about this is when the NPC dies on holes, for example - to avoid the new NPC to be spawned over a hole again and again (maybe using a checkhole would do the job).

Any help is appreciated.
 
@O'Ilusionista: I will do the same in his anim death setting a respawn and checking how many life he has (must be surely done by a small script).
If a npc dies on a hole, you can respawn him near the player to avoid this kind of unpleasantness, can't you?
I think the easy way is the hole is deadly for the npc and you can spawn a new npc if it's necessary.
 
I believe using NPC manager entity would be better. This manager holds number of lives NPCs have and does the job of respawning when NPC dies (in any way). The manager spawns and also respawns NPCs in certain coords relative to screen in each level

I don't have example for this but this manager sounds similar to infinite enemy spawner I've coded for multiple mods e.g Castlevania Collab and Contra : Locked 'N' Loaded but for NPC and with lives counter

Hmmm... there is an NPC respawner in D&D : Rise of Warduke but it was coded to carry NPCs from a level to next level if the NPCs are still alive when former level ends
 
Back
Top Bottom