Closed GoogleFrog closed 7 years ago
Looks like an old bug. !setoptions disabledunits=turretlaser+turretmissile
does work as intended. Going to make new stable release.
Oops, wrong, doesn't work. Bug in regex?
I don't know. It differs between MP and SP so perhaps Springie sets modoptions in a different format to chobby? How does circuit read the modoption?
I already found bug in regex. Tdf/Lua tables shouldn't be parsed by regex (just like xml and html), but i don't want to add Tdf/Lua parsers. Trying to workaround with another pack of regexes.
An example of MP modoptions:
[modoptions]
{
commandertypes=ewog...;
startboxes=return { };
disabledunits=turretlaser+turretmissile;
}
"startboxes" ruins it all, and regex doesn't look after first "}" SP has either differrent order of params or doesn't have "startboxes" in it.
I don't recall setting startboxes with chobby. Those keys are just strings.
Regex monstro: "[modoptions]\s{([\s\S]+?(?=}\s([|$)))" https://github.com/rlcevg/CircuitAI/commit/0b17ffc6ba1ef09ecf9025469a9b0f4e91c87be9
Set disabledunits="turretlaser+turretmissile" in a singleplayer game and circuit will implement the option correctly. Note that I am talking about the modoption, not the AI option. The same setting in multiplayer does not work, circuit builds units that should be disabled. I have checked chobby and found no special handling for the disabledunits modoption.
As a stopgap I enforced disabledunits strictly here: https://github.com/ZeroK-RTS/Zero-K/commit/bc1659a3c0eb7611849a20cfa9d792b6a3575863