How do I make an NPC disappear when you talk to it but reappear when you leave and reenter the map?

From OHRRPGCE-Wiki
Jump to: navigation, search

This is rather easy, so long as you are willing to do a very small amount of plotscripting. First go under custom and check that edit the map on which you want the NPC to reappear when you reenter. (Note that if the NPC in question is supposed to be dead you may want to do the exact opposite to what is explained here. Go to above on click 'How do I use plotscripts to make an NPC disappear permanently?'


Check that the option "save npc" has not been activated. (Unactivate it if it is so) Then, edit your HSS file. Find the plotscript, in which there is the cutscene at the end of which the NPC has to disappear.

Use the following command if you want to destroy first copy of NPC ID 6

destroy npc (6)

And here you are! Be careful that you have the right ID number. If there is more than one copy of the NPC on your map, you can use the NPC reference number that is displayed when you place the NPC in the map editor.

NPC placement mode with copy-count display.png

Look at the example above. Suppose you wanted to remove the guard on the far right.

destroy npc (1, 2)

Of course, if you wanted to remove the guy on the throne, you could use the command:

destroy npc (27)

Because he is the first copy of that NPC ID, you don't need to bother with the second number.

destroy npc (27, 0) # this is unnecessary because if you leave out the second number, 0 is assumed 


You can also use the destroy NPC command to remove NPCs that you created with the create npc command:

variable(ref)
ref := create npc(27, 25, 11) # Create NPC ID 27 at position 25,11
wait(5)
destroy NPC (ref)

[edit] See Also

Personal tools