Quote: "In my game, I have a major plot revealing event, where the player approaches an NPC, who then tells the player what to do next.
However, I need to be able to destroy this NPC, then, when the player approaches where he was later on, have him respawn (obviously not in sight of the player), to reveal more plot.
Is it possible to set up a trigger zone which destroys the NPC, then respawns him (or a duplicate)?"
Hi Bruce3371,
I have a development where there is a scientist that walks down a hallway and passes by me. He heads to a door and waits there, then is destroyed at that spot when I am a certain distance away. Later, when I approach that hallway, the character is spawned at that spot and there is a "conversation" between him and the player.
The script for the first scientist character (the one that walks down the hallway first to the door and is destroyed, giving the appearance he entered the room) is as follows:
;Artificial Intelligence Script
;Header
desc = L01 Scientist 001
;Triggers
:waypointstate=0:animate=2,waypointstart
:waypointstate=3:animate=2,waypointnext
:waypointstate=5:animate=2,waypointstop,state=5
:nearactivatable=0:settarget,activatetarget=2,animate=2,state=0
:state=0:state=1
:state=1:rotateheadrandom=20
:state=1:state=2
:state=2:state=1
:state=5,plrdistfurther=350:destroy
;End of Script
As Storyteller 01 stated, you could then set a trigger where the player would pass which would spawn the second character. You would just need to set that second character to "Spawn at start- No" and set the trigger IfUsed field to the name of that second character.
In other words, I have a second scientist character in the editor map that is set in the exact position and spawns when the player hits the trigger in the hallway. The player never sees the character spawn, but will see the character at the door as if he came out of the room.
Hope that made sense for you.
Twitter: @NFoxMedia