I still can't remove NPCs from the map #56601
Labels
[C++]
Changes (can be) made in C++. Previously named `Code`
EOC: Effects On Condition
Anything concerning Effects On Condition
NPC / Factions
NPCs, AI, Speech, Factions, Ownership
Quality of Life
QoL: degree to which players are comfortable, and able to enjoy CDDA
Is your feature request related to a problem? Please describe.
I'm working on making random encounters, but there's still no way to despawn an NPC. I can send the NPC to walk off on their way, or teleport them to another location, but in the context of a random map, that doesn't really work for two reasons:
Overall as well, we just should have the ability to add and remove things from the map, for basic scripting reasons.
Solution you would like.
overmapbuffer.cpp contains a function,
shared_ptr_fast<npc> overmapbuffer::remove_npc( const character_id &id )
I believe this can be used to remove an NPC. All I want is the ability to define an
effect
that calls the character_id and removes it, without killing it or causing a map message. This should be very easy to do, but I don't know how.Syntax like:
This would then just call that function and do it as that function does it. Viola.
Describe alternatives you have considered.
I could have the NPC walk to another location, but this would probably result in them dying randomly somewhere.
I could try to teleport the NPC to a relevant location like its parent faction base, but I am almost certain this will produce errors if that location isn't loaded yet.
I could, and I'm not joking this is currently my best option, kill the NPC and delete the corpse and all its items. This will require a lot of json script for what I believe is a very small amount of code.
Additional context
Please, please help me.
The text was updated successfully, but these errors were encountered: