Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve map hard-coded id handling, fixes for save game queued droid orders #3313

Merged

Conversation

past-due
Copy link
Member

@past-due past-due commented Jul 17, 2023

Behavior changes:

  • Use hard-coded map object ids only for matching up with labels.json info (mapping them to the new generated id on labels.json load).
    • (Does not impact savegames, which obviously must preserve the ids on loading.)

Backwards-compatibility impact:

  • Only if scripts hard-code an object id (that they are expecting will match the one hard-coded in the map droids/structures/features.json file) should this be a problem. (And they shouldn't be doing this!)
    • Solution (if impacted):
      • Do not hard-code object ids in scripts.
      • In one of the script init events, get the actual object ids by enumerating (via enumDroid/enumStruct/enumFeature, or via area labels w/ enumArea, etc), or by using object / group labels in labels.json (which will properly map to the hard-coded map object ids).
      • Any object ids properly obtained via API functions in the script can then be stored / saved (and persisted through savegames).

Also:
Fixes: #2227
Fixes: #1160

@past-due past-due added this to the 4.4.0-beta1 milestone Jul 17, 2023
Use hard-coded map object ids *only* for matching up with labels.json info (mapping them to the new generated id on labels.json load).

(Does not impact savegames, which obviously must preserve the ids on loading.)
The `index` and `rtrType` properties were not being saved or loaded.
@past-due past-due changed the title wzmaplib: Better handling of explicit id 0 values Improve map hard-coded id handling, fixes for save game queued droid orders Jul 18, 2023
@past-due past-due merged commit 21e79dd into Warzone2100:master Jul 18, 2023
@past-due past-due deleted the 2023_07_maplib_old_format_id_0_handling branch July 18, 2023 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Saveload: Restoring queued build orders issue Savegame doesn't properly reinstate building upgrade queue
1 participant