Closed grabz-dev closed 1 year ago
For the record, the above originated in a discord conversation starting here: https://discord.com/channels/192420539204239361/371084855569809409/1025941811736367225
Fixed in 2.4.6. The issue was a 'typo' in how disableminimapwarn was being set.
This is what the code was incorrectly doing:
SetUnitSettings(initParams) {
RplCore.Data cnt; if (initParams.TryGetValue("Count", out cnt)) count = cnt.GetInt();
RplCore.Data dmmw; if (initParams.TryGetValue("DisableMiniMapWarn", out dmmw)) disableMinimapWarning = cnt.GetInt() != 0;
}
Note the use of cnt
where dmmw
should have been used. Consequently, no exception would be thrown if "count" was present in the supplied table. Also, 'count' would be used to set the minimapwarning status.
Tested in 2.4.6:
The LifeTime parameter appears to be having the same issue,
GetUnitSettings(1959) ->BlobTable SetUnitSettings(1959 <-BlobTable)
The above code sets the LifeTime parameter of blob nests and skimmer factories to whatever the Count parameter is set to.
The following script (which notably uses a new table):
If used on a Spore Launcher (and possibly other units?) causes a soft-crash, and the option change doesn't go through.
The only way to set DisableMiniMapWarn appears to be by grabbing the table off the unit first using GetUnitSettings:
A caveat is that using this approach of GetUnitSettings into SetUnitSettings, DisableMiniMapWarn is always flipped to true, so the following script will also change the setting from false to true:
This also means that you cannot change the setting back to false
The crash from the first script: