CleverRaven / Cataclysm-DDA

Cataclysm - Dark Days Ahead. A turn-based survival game set in a post-apocalyptic world.
http://cataclysmdda.org
Other
10.1k stars 4.1k forks source link

Tried to use invalid npc: GUARD5 #75048

Open WindexEnjoyer opened 1 month ago

WindexEnjoyer commented 1 month ago

Describe the bug

At certain intervals, the following error shows up seemingly affecting the refugee center:

Tried to use invalid npc: GUARD5. Callstack: EOC: EOC_REFUGEE_CENTER_NPC_MOVEMENT \ EOC: EOC_REFUGEE_CENTER_GUARD_FIRST_POSITION

Attach save file

Anton Chico-trimmed.tar.gz

Steps to reproduce

  1. Have one guard NPC killed during Old Guard traitor quest
  2. Proceed with Old Guard storyline until radio repeater mission
  3. Save and Quit
  4. Reload save and continue as normal
  5. Encounter error at fixed intervals.

Expected behavior

No NPC issues during gameplay.

Screenshots

No response

Versions and configuration

Additional context

debug.log

PatrikLundell commented 1 month ago

Looks like the EOC tries to move the dead NPC to a new position twice every 24 hours, with an interval of 2 hours between the first and second move.

Presumably, the logic would need some kind of guard to not try to perform an action on non existent NPC when they run the risk of dying (which is probably all of them). This guard ought to be added to all EOCs affecting NPCs when the EOC has been tested to work normally without it (so misspelled NPC identifiers can be caught during testing).

WindexEnjoyer commented 1 month ago

I see. I tried fiddling around with the debug EOC's to try and trigger the FIRST_POSITION and SECOND_POSITION check and it seems to be hitting your description. What's a possible if temporary fix to this?

PatrikLundell commented 1 month ago

I don't know. I don't really know anything about EOCs.

Well, a local hack would be to remove the entries involving GUARD5 from the timed trigger. That would cause the game not to try to invoke those, and thus not result in the error message. That is extremely crude, and would only work if you don't update the game often (as it would have to be rehacked after each update).