OpenKrush icon indicating copy to clipboard operation
OpenKrush copied to clipboard

Remove Creep actors around the bunker if the bunker is turned off

Open Dzierzan opened this issue 6 years ago • 5 comments

Just like the title says. If the bunker is turned off, creep towers will be guarding nothing.

Dzierzan avatar Dec 18 '18 20:12 Dzierzan

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.

IceReaper avatar Dec 18 '18 21:12 IceReaper

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.

pchote avatar Dec 19 '18 02:12 pchote

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.

obrakmann avatar Dec 21 '18 14:12 obrakmann

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.

pchote avatar Dec 21 '18 20:12 pchote

Added such an interface in this commit: https://github.com/OpenRA/OpenRA/pull/15774/commits/728d338c8c23fccb3d031b62fd76d454942e94dc

obrakmann avatar Dec 21 '18 23:12 obrakmann