[TUTORIAL] Add commnet to your modded file
Posted: Thu Mar 28, 2019 2:15 pm
In computer programming, a comment is a programmer-readable explanation or annotation in the source code of a computer program. They are added with the purpose of making the source code easier for humans to understand, and are generally ignored by compilers and interpreters. So I decide to find way how to add comments in modded file, so person who want to edit mod will be able to understand what happened inside, if you left comment.
In few attempts i found worked method and want to share it to other modders
this example of code block can be pasted in middle of file without problems as usual object - but with out GUID.
For example object: "cutscene" - need to have guid in objects list, in our case comments dont computing so no need to add any GUID
cutscene object:
If you want to add comment to top of file you can do like here:
there is little diffirence: "<instance"
https://pastebin.com/Ptf7x1Z2
In few attempts i found worked method and want to share it to other modders
Code: Select all
</instance>
<!--
<field Your text here
<field and here.
-->
</instance>
this example of code block can be pasted in middle of file without problems as usual object - but with out GUID.
For example object: "cutscene" - need to have guid in objects list, in our case comments dont computing so no need to add any GUID
cutscene object:
Code: Select all
</instance>
<instance guid="4F756B6F-486E-4606-B39A-054773F44BE3" type="GameSharedResources.CutsceneEntityScreenFadeData">
<field name="PreCutsceneFadeOutTime">0.20000000298</field>
<field name="PreCutsceneMinBlackDelay">0.20000000298</field>
<field name="PreCutsceneFadeInTime">1.0</field>
<field name="StartPostFadeOutBeforeEndTime">3.0</field>
<field name="PostCutsceneFadeOutTime">1.0</field>
<field name="PostCutsceneMinBlackDelay">10.0</field>
<field name="PostCutsceneFadeInTime">0</field>
</instance>
If you want to add comment to top of file you can do like here:
Code: Select all
<?xml version="1.0"?>
<partition guid="499D7A45-69D0-4732-9BAE-7B9612DF31F8" primaryInstance="2430BDB9-5D23-48B8-9A31-CE296AE63AEB" exportMode="All">
<instance
<!--
<field Your text here
<field and here.
-->
</instance>
<instance guid="2430BDB9-5D23-48B8-9A31-CE296AE63AEB" type="GameSharedResources.LevelData" id="new_1">
<field name="Name">Levels/new_1</field>
there is little diffirence: "<instance"
https://pastebin.com/Ptf7x1Z2