Changes for page Mission Director Guide
Last modified by Klaus Meyer on 2025/03/31 16:39
From version 32973.1
edited by Heinrich Unrau
on 2024/10/17 13:10
on 2024/10/17 13:10
Change comment:
There is no comment for this version
To version 32974.2
edited by Heinrich Unrau
on 2024/10/17 13:46
on 2024/10/17 13:46
Change comment:
There is no comment for this version
Summary
-
Page properties (1 modified, 0 added, 0 removed)
Details
- Page properties
-
- Content
-
... ... @@ -1008,30 +1008,7 @@ 1008 1008 * MD scripts and cues are identified by their names. So a script can only be refreshed if it has the same script name as before (file name is irrelevant). 1009 1009 * If there are new script files or new cue nodes (i.e. scripts/cues with new names) they are created and added properly. If you remove script files or cue nodes, the corresponding scripts/cues are removed from the game, including instances. 1010 1010 ** (!) Pitfall: Cue Removal 1011 -If you remove a cue and then later add another cue with the same name, old save files will not know that the cue has been removed inbetween. In the following example the first cue was created setting $val_1 and the game is saved. 1012 -{{code language="xml"}}<cue name="Deprecated_Test1" namespace="this"> 1013 - <actions> 1014 - <set_value name="$val_1" exact="'old value'"/> 1015 - <debug_text text="$val_1"/> 1016 - </actions> 1017 -</cue>{{/code}} 1018 -\\If the Cue is deleted and years later a new cue with the same name appears, the old save will consider the new cue as already completed without executing its actions. The Cue PrintValue will fail to find a variable set up in its parent. 1019 -{{code language="xml"}}<cue name="Deprecated_Test1" namespace="this"> 1020 - <actions> 1021 - <set_value name="$val_2" exact="'new value'"/> 1022 - <debug_text text="$val_2"/> 1023 - </actions> 1024 - <cues> 1025 - <cue name="PrintValue"> 1026 - <actions> 1027 - <debug_text text="parent.$val_2"/> 1028 - </actions> 1029 - </cue> 1030 - </cues> 1031 -</cue>{{/code}} 1032 -\\To avoid this, do not delete any cues (once they are public for save game compatibility), but empty them out and mark them as deprecated. This will prevent new cues with the same name in the script. 1033 -{{code language="xml"}}<!-- Deprecated Cues, kept to not duplicate names in future cues --> 1034 -<cue name="Deprecated_Test1" comment="deprecated"></cue>{{/code}} 1011 + 1035 1035 * As a consequence, you CANNOT rename scripts or cues if you want to refresh them. Doing so would remove the old script or cue and add a new one with the new name. 1036 1036 * You CANNOT change a <cue> to a <library> or vice versa. 1037 1037 * You CANNOT add, remove, or change the "ref" attribute of a cue. But it is possible to remove the whole cue. (If all references to a library are removed you can also remove the library itself.) ... ... @@ -1053,6 +1053,31 @@ 1053 1053 When adding a variable in a new MD script version and using that variable in multiple places, be aware that the variable doesn't exist yet in older savegames. You may have to check the existence of the variable before accessing it, or add some patch logic that initiailses the variable after loading the savegame, if necessary. 1054 1054 {{/warning}} 1055 1055 1033 +(% id="cke_bm_117445S" style="display:none" %) (%%)If you remove a cue and then later add another cue with the same name, old save files will not know that the cue has been removed inbetween. In the following example the first cue was created setting $val_1 and the game is saved. 1034 +{{code language="xml"}}<cue name="Deprecated_Test1"> 1035 + <actions> 1036 + <set_value name="$val_1" exact="'old value'"/> 1037 + <debug_text text="$val_1"/> 1038 + </actions> 1039 +</cue>{{/code}} 1040 +\\If the Cue is deleted and years later a new cue with the same name appears, the old save will consider the new cue as already completed without executing its actions. The Cue PrintValue will fail to find a variable set up in its parent. 1041 +{{code language="xml"}}<cue name="Deprecated_Test1"> 1042 + <actions> 1043 + <set_value name="$val_2" exact="'new value'"/> 1044 + <debug_text text="$val_2"/> 1045 + </actions> 1046 + <cues> 1047 + <cue name="PrintValue"> 1048 + <actions> 1049 + <debug_text text="$val_2"/> 1050 + </actions> 1051 + </cue> 1052 + </cues> 1053 +</cue>{{/code}} 1054 +\\To avoid this, do not delete any cues (once they are public for save game compatibility), but empty them out and mark them as deprecated. This will prevent new cues with the same name in the script. 1055 +{{code language="xml"}}<!-- Deprecated Cues, kept to not duplicate names in future cues --> 1056 +<cue name="Deprecated_Test1" comment="deprecated"></cue>{{/code}} 1057 + 1056 1056 == Patching == 1057 1057 1058 1058 Cues can have **<patch>** elements with actions that will be performed when an old savegame is loaded. To control which savegames should be affected, you can add a //**version **//attribute to the <cue> node and a //**sinceversion**// attribute in the patch. When a cue is loaded from a savegame that has an older version than //sinceversion//, the <patch> actions will be performed immediately after loading.