• Support
  • Another Plea for Help, this Time Regarding Entity ID Error

So, this one is odd. I think I may have fixed an issue I asked about before, but now when adding the enemy character, it says that a character with that ID already exists, and I’ve looked everywhere for that. The script spawns it, and I give it the ID in that script, but then I remove it after it is defeated. No clue where the ID could exist elsewhere, since only one should be called “Key Slime.” Any help would be appreciated.

Before the battle just happened when the crate it was in was broken, but I decided to add it where the slime will actually spawn and there’ll be some dialogue from the player character before the fight. Everything plays out just fine, but this error pops up immediately. Yet it still works, the battle happens, and then the aftermath stuff also happens, allowing you to continue to the next place of importance. That’s why it’s so odd. Nothing seems to be really affected, I just want to know how to fix this supposed error.

5 days later

You can tie in something to check first if the entity exists, something like

if entity["Key Slime"] != null then
remove_entity("Key Slime");
end;

If you add this snippet it at the beginning of the spawn code, you check and if delete any entity with that id exists previously and create a brand new one each time.