Klaus Meyer 于 2025/03/31 16:39 最后修改

从版本 32970.17
Heinrich Unrau编辑
在2024/10/17 13:01上
修改评论: 该版本没有评论
到版本
Heinrich Unrau编辑
在2024/10/17 13:14上
修改评论: 该版本没有评论

摘要

细节

页面属性
内容
... ... @@ -1007,8 +1007,9 @@
1007 1007  
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 -** 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.
1011 -{{code language="xml"}}<cue name="Deprecated_Test1" namespace="this">
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">
1012 1012   <actions>
1013 1013   <set_value name="$val_1" exact="'old value'"/>
1014 1014   <debug_text text="$val_1"/>
... ... @@ -1015,7 +1015,7 @@
1015 1015   </actions>
1016 1016  </cue>{{/code}}
1017 1017  \\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.
1018 -{{code language="xml"}}<cue name="Deprecated_Test1" namespace="this">
1019 +{{code language="xml"}}<cue name="Deprecated_Test1">
1019 1019   <actions>
1020 1020   <set_value name="$val_2" exact="'new value'"/>
1021 1021   <debug_text text="$val_2"/>
... ... @@ -1023,12 +1023,12 @@
1023 1023   <cues>
1024 1024   <cue name="PrintValue">
1025 1025   <actions>
1026 - <debug_text text="parent.$val_2"/>
1027 + <debug_text text="$val_2"/>
1027 1027   </actions>
1028 1028   </cue>
1029 1029   </cues>
1030 1030  </cue>{{/code}}
1031 -\\To avoid this, do not delete any cues, but empty them out and mark them as deprecated. This will prevent 
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.
1032 1032  {{code language="xml"}}<!-- Deprecated Cues, kept to not duplicate names in future cues -->
1033 1033  <cue name="Deprecated_Test1" comment="deprecated"></cue>{{/code}}
1034 1034  * 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.