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

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: For Player Triggers - Should hopefully be major timesaver
posted 02 September 2018 11:04 AM EDT (US)   
Fed up of creating the same trigger over and over again for each player? Bring on the For Player Trigger! Similar to the Delegate trigger this is a time saving trigger that I have developed to reduce the time for a developer for a map.

<Condition name="For Player Trigger Start">
<Param name="Variable" dispName="Variable" varType="string">p</Param>
<Param name="p1" dispName="lowest player" VarType="string">1</Param>
<Param name="p2" dispName="highest player" VarType="string">4</Param>
<Param name="Info" dispName="Info" varType="string">Only works for a looping trigger</Param>
<Param name="Info2" dispName="Info" varType="string">Must have For Player Trigger End effect at end of effects</Param>
<Expression><![CDATA[true);for(%Variable% = %p1%; <= %p2%){//]]></Expression>
</Condition>

<Effect name="For Player Trigger End">
<Command>}</Command>
</Effect>

To Use
In a new condition insert the "For Player Trigger Start" and in the effects add "For player Trigger End". Ensure the trigger is a looping one (I may look at dropping this requirement at some point) Select a range of players to apply for and a variable name use in it. Now in any triggers or effects where you want to apply to a player type the name of the player instead.

Effective Use
Trigger taking a player number usually have you selecting it from a dropdown list which is no good as you need to type it. You can easily convert all triggers to use typing instead by opening your typetest and doing the following find and replace:

VarType="player"
to
VarType="string"

This will make it so you can type in player numbers as a variable freely.

Example areas of use in current state
  • Shops
  • Kills based level up

    [This message has been edited by nottud (edited 09-02-2018 @ 11:09 AM).]

  • Replies:
    posted 08 September 2018 07:32 PM EDT (US)     1 / 2  
    Following use and some issues I have discovered that it does not work with the timer condition other than the value of 0 or 1 which you might appreciate was difficult to figure out! I have written a modified version that hacks in a timer that does work. The only caveat is you need to use the end with timer version instead due to a different internal structure.

    <Condition name="For Player Trigger Start with timer">
    <Param name="Variable" dispName="Variable" varType="string">p</Param>
    <Param name="p1" dispName="lowest player" VarType="string">1</Param>
    <Param name="p2" dispName="highest player" VarType="string">4</Param>
    <Param name="timer" dispName="timer" VarType="string">1</Param>
    <Param name="Info" dispName="Info" varType="string">Only works for a looping trigger</Param>
    <Param name="Info2" dispName="Info" varType="string">Must have For Player Trigger End with timer effect at end of effects</Param>
    <Param name="mod" dispName="do not touch this" VarType="hidden">%%</Param>
    <Expression><![CDATA[true);if((trTime()-cActivationTime)>=1){if((trTime() %mod% %timer%)==0){for(%Variable%=%p1%;<=%p2%){//]]></Expression>
    </Condition>

    <Effect name="For Player Trigger End with timer">
    <Command>}}}</Command>
    </Effect>
    posted 03 October 2018 00:10 AM EDT (US)     2 / 2  
    Nice!

    Age of Mythology Heaven » Forums » Scenario Design » For Player Triggers - Should hopefully be major timesaver
    Top
    You must be logged in to post messages.
    Please login or register
    Hop to:    
    Age of Mythology Heaven | HeavenGames