Jump to content

Preventing home removal upon agent retiring


Recommended Posts

So when an agent "retires", their home is set to nothing and if their home location has no more occupants at this point, they gets marked for removal. This normally is done to save space, but issues will arise if a mod sets an agent's home location to an important story location, and there is a possibility of that agent getting killed while that location is still important. When the agent is killed, that location will get deleted, even though the story still requires it. Perhaps, like how agent culling works, automatically marking homes for deletion should check whether that location is still casted in like a quest or something, or somehow manually marking that location to not get automatically removed.

Or make it so that permanent locations like the ones defined in region.locations don't get automatically removed. That works for most situations.

Link to comment
Share on other sites

  • Developer

Would verifying that not self:IsCurrentlyImportant() before culling the location in Location:UpdateLocation() work for your case?  It is something I can try adding to the testing branch if so.  If you have a reference to the home after it was marked for deletion, you can also try manually removing the TRANSIENT flag.

Link to comment
Share on other sites

23 hours ago, rooks said:

Would verifying that not self:IsCurrentlyImportant() before culling the location in Location:UpdateLocation() work for your case?  It is something I can try adding to the testing branch if so.  If you have a reference to the home after it was marked for deletion, you can also try manually removing the TRANSIENT flag.

That would probably work. Thanks.

Removing the transient flag when something gets marked for deletion may be too roundabout for my taste, because for every location affected, I have to manually set up an event listener that listens for agent retirement. And also unmarking a location after it gets marked might cause issues when the original location is to be marked for deletion anyway for some reason.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

×
  • Create New...