To achieve these use cases, we could add a new command maregister. We should not update masave to do this since users should be making a deliberate decision to register entities; we don't want users to accidentally register an entity that they mistakenly believed was already managed by the plugin.
Notes:
When running this command for an entity spawned by the plugin, the user should receive a descriptive error
This check can be implemented by running _entityTracker.IsMonumentEntity(entity)
When running this command on an entity spawned by a spawn point (regardless of whether it's a Monument Addons spawn point), the user should receive a different descriptive error
This check can be implemented by checking for the SpawnPointInstance component on the entity
Certain entities, particularly ones that belong natively to a monument (if possible to easily detect) should probably be disallowed from registering as a precaution
When registering an entity that is part of the map, the plugin probably needs to account for finding that same entity after a new wipe and removing it, to avoid having double entities
This check can probably be implemented by checking for the entity in World.Serialization.world.prefabs, but needs verification
The plugin should strive to capture as many properties as possible, such as building grade, entity flags, etc.
Note that entity flag support will depend on #23
Upon initial registration of an entity, the plugin should probably despawn and respawn it, providing early feedback to the user about whether the plugin was capable of detecting all of the relevant properties, serializing them and reapplying them
Without this enhancement, if the plugin isn't capable of fully managing the entity, users wouldn't realize until reloading the plugin or restarting the server, so we want to give feedback about that as soon as possible
Something we may also want to think about is whether users have a valid use case to simply apply modifications to entities that are already within monuments, without Monument Addons taking control over spawning/despawning them. Note that this would likely increase complexity significantly.
Use cases:
Related: https://umod.org/community/monument-addons/39710-allow-building-on-monuments
To achieve these use cases, we could add a new command
maregister
. We should not updatemasave
to do this since users should be making a deliberate decision to register entities; we don't want users to accidentally register an entity that they mistakenly believed was already managed by the plugin.Notes:
_entityTracker.IsMonumentEntity(entity)
SpawnPointInstance
component on the entityWorld.Serialization.world.prefabs
, but needs verificationSomething we may also want to think about is whether users have a valid use case to simply apply modifications to entities that are already within monuments, without Monument Addons taking control over spawning/despawning them. Note that this would likely increase complexity significantly.