OpenKrush
OpenKrush copied to clipboard
Remove Creep actors around the bunker if the bunker is turned off
Just like the title says. If the bunker is turned off, creep towers will be guarding nothing.
They are actually not connected to the bunker in any way. We could implement a "if disabled, replace it with a neutral derrick" or such thing.
It would be reasonably straightforward to introduce some kind of OnlySpawnMeIfLobbyOptionIsEnabledInit
that could be checked by SpawnMapActors
to suppress the actor creation. This could then be exposed to the map editor actor panel via a trait that implements the new IEditorActorOptions
interface.
One problem I have with your proposed "OnlySpawnMeIfLobbyOptionIsEnabledInit
" is that realistically, the only value we can base the selection on is the lobby option id, which, however, is almost always an implementation-defined string that is undocumented and unknown to modders (this would be the case for the game mode option).
The only exceptions seem to be ScriptLobbyDrownDown
and LobbyPrerequisiteCheckbox
, which would be ok for casual modders, I guess.
To avoid duplication in SpawnMapActors
, we'd probably need an interface or a base class. And also two variants for strings and bools respectively.
I was thinking the lobby option id would be given as the init value, but you're right that it might be better to implement this via a new interface and world trait(s) that SpawnMapActors
can ask whether actors should be spawned or not.
Added such an interface in this commit: https://github.com/OpenRA/OpenRA/pull/15774/commits/728d338c8c23fccb3d031b62fd76d454942e94dc