Creating/Importing Custom Conditions or Effects for Triggers

Hey all, I’ve been a long time AOM player and fell in love with the editor from the get go on the original game. I recently fell back in love with Retold and was in the middle of making an RPG custom scenario when I remembered how limited we are with the triggers. As I did research I remembered all the trigger packs we used to have from people creating custom conditions and effects to use and realized how useful those could be if I could find a way to convert or import them over to Retold.

It took a lot of digging around and stumbling but I managed to get one of oddy’s old QV custom conditions and effects to be added to my game and thought I should share so others don’t have to stumble as much as I did and maybe some of you better programmers can start pumping out mods and trigger packs faster then I can even type this. There has been a change in functions too since the original, trying to copy the original custom conditions/effects code caused some errors for me. I was able to locate the list of functions for Retold and had to make a minor tweak to the code for it to work.

Will start with the original code from oddy for his QV condition and effect:

 <Condition name="QV Stat Value">
 <Param name="PlayerID" dispName="$$22534$$Fake Player" VarType="player">0</Param>
 <Param name="StatID" dispName="$$23856$$Stat Type" VarType="kbstat">0</Param>
 <Param name="Op" dispName="$$22297$$Operator" VarType="operator">==</Param>
 <Param name="QVName" dispName="QV PointZero" VarType="string">PointZero</Param>
 <Param name="Value" dispName="$$23859$$Value" VarType="long">0</Param>
 <Expression>trGetStatValue(%PlayerID%, %StatID%) %Op% trQuestVarGet("%QVName%")+ %Value%</Expression>
 </Condition>
<Effect name="QV Set Stat Value">
<Param name="QVName" dispName="$$23952$$Var Name" VarType="string">QV1</Param>
<Param name="PlayerID" dispName="$$22534$$Fake Player" VarType="player">0</Param>
<Param name="StatID" dispName="$$23856$$Stat Type" VarType="kbstat">0</Param>
<Command>trQuestVarSet("%QVName%", trGetStatValue(%PlayerID%, %StatID%));</Command>
</Effect>

I tried to plug these in as is but trGetStatValue is no longer a valid function to call, and the game threw me an error. After looking at all the functions (not sure if I can link a list here) I was able to see you have to use kbGetStatValueInt. This will likely be the case when trying to import old triggers, may need to look at the new ops and change code where required.

Reason why I wanted this added, was to make a kill counter. It might sound crazy but the basic trigger conditions and effects they give you, do not allow you to make a kill counter which can be very useful for RPG custom scenarios for XP or Gold or whatever you want to do with it. Adding this will give you a kill counter QV that can then be used for UI messages using the “+xsFloatToInt(trQuestVarGet(“QV”))+” method. Replacing QV with whatever QV you are trying to display in game chat or UI counter, etc.

Edited code looks like:

Condition:

<condition name="QV Stat Value">
<param name="PlayerID" dispName="$$22534$$Fake Player" VarType="player">0</param>
<param name="StatID" dispName="$$23856$$Stat Type" VarType="kbstat">0</param>
<param name="Op" dispName="$$22297$$Operator" VarType="operator">==</param>
<param name="QVName" dispName="QV PointZero" VarType="string">PointZero</param>
<param name="Value" dispName="$$23859$$Value" VarType="long">0</param>
<expression>kbGetStatValueInt(%PlayerID%, %StatID%) %Op% trQuestVarGet("%QVName%")+ %Value%</expression>
</condition>

Effect:

<effect name="QV Set Stat Value">
<param name="QVName" dispName="$$23952$$Var Name" VarType="string">QV1</param>
<param name="PlayerID" dispName="$$22534$$Fake Player" VarType="player">0</param>
<param name="StatID" dispName="$$23856$$Stat Type" VarType="kbstat">0</param>
<command>trQuestVarSet("%QVName%", kbGetStatValueInt(%PlayerID%, %StatID%));</command>
</effect>

Instructions for getting into where you add the code:

  1. Navigate to your game directory and make backup of your data.bar file. (…\Age of Mythology Retold\game\data). Put it in a folder outside of your install.
  2. Download v0.7 Resource Manager and extract ALL folders in your data.bar file from the game directory, and when selecting where to extract it, navigate back to the Age of Mythology Retold folder and it will place all folders in the correct spot from extracting
  3. After extraction, when you go back into …\Age of Mythology Retold\game\data there should be a bunch of new folders here. (fonts, gameplay, map_definitions, etc.). If all these folders are showing in your \data\ folder you can go ahead and delete the data.bar file as the game will now call from the folders.
  4. In the \data\trigger\ folder, there should be a .xmb file called trigger_data.xml.xmb
  5. in v0.7 Resource Manage, go to convert and select .xmb to .xml and locate the trigger_data.xml.xmb file to convert.
  6. This will create a new file in the \data\trigger\ folder that is now an editable .xml file. You can now delete the old .xml.xmb file as the game will use the converted .xml and still work.
  7. You can open this with Notepad and create your new Condition/Effects using the same syntax, or you can also copy in custom ones from older AOMTT trigger packs. If the game throws any errors, you may need to look at the error and see what code needs to be changed/updated for it to work with new engine.

I am typing this fast before a doctore appointment lol I got excited when I figured this out and wanted to share as soon as I could. I will come back and edit this to look better and add any links/references that may help! Thanks all!

Notes:

  • Conditions appear at the top of the list, I added the custom one at the very bottom of the list of conditions.
  • Effects are after the list of conditions. I have not tested adding any custom effects yet.
  • Even adding it after the XS Code Snippet, it still appeared in alphabetical order in the list of conditions in game in the editor.
1 Like