You must be logged in to post messages.
Please login or register

Scenario Design
Moderated by Yeebaagooon, TAG

Hop to:    
Welcome! You are not logged in. Please Login or Register.1 reply
Age of Mythology Heaven » Forums » Scenario Design » Trigger Globals
Bottom
Topic Subject:Trigger Globals
nottud
Mortal
posted 01 January 2019 07:11 AM EDT (US)         
For advanced trigger scripters here is something you may find useful. It is the ability to add global variables to your scenario a little like QVs but you can use any data type supported in the game. Defined variables can then be used in place of any value in a trigger.

<Effect name="Global Start">
<Param name="Info" dispName="Info" varType="string">Ensure this trigger exists before any that use the declared globals. Trigger does not need to be active.</Param>
<Command>}}</Command>
</Effect>

<Effect name="Global Declaration">
<Param name="varType" dispName="Type" VarType="string">string</Param>
<Param name="varName" dispName="Name" VarType="string">variable</Param>
<Param name="initialValue" dispName="Value" VarType="string">"value"</Param>
<Command>/**/ %varType% %varName% = %initialValue%;</Command>
</Effect>

<Effect name="Global End">
<Command>void _globalEnd(){if(false){</Command>
</Effect>

To use in your first trigger of your game add the Global Start effect, then any number of Global Declarations and then finish with a Global End.

The global declaration parameters are as follows:
  • Type: The type of data the value can use such as: string, bool, float, int
  • Name: This is the name of the variable to use - this is what to put to get your value (Bit like a QV name)
  • Value: The value the variable should initially take - this should be compatible with the declared data type: e.g. string: "dog", int 6, float 7.8, bool true.

    The global can be modified and retrieved like a normal variable but will be available across all triggers rather than just your current one.

    The main use for this is the support for data types such as string which are not supported by regular QVs. I appreciate that to a lot of people it won't mean much but hopefully of help to some advanced scenario designers.
  • AuthorReplies:
    TAG
    That AoM Guy
    (id: aom expert)
    posted 06 January 2019 08:29 PM EDT (US)     1 / 1       
    Thanks for your work

    Check out my YouTube
    For live help with me, enter this chatroom. If I'm not on you can leave a message.
    You must be logged in to post messages.
    Please login or register

    Hop to:    

    Age of Mythology Heaven | HeavenGames