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

Modding and Scripting
Moderated by Yeebaagooon, TAG, nottud

Hop to:    
Welcome! You are not logged in. Please Login or Register.10 replies
Age of Mythology Heaven » Forums » Modding and Scripting » Trigger Requests (Pretty Urgent)
Bottom
Topic Subject:Trigger Requests (Pretty Urgent)
Yeebaagooon
EXCO Emeritus
posted 01 October 2007 12:51 PM EDT (US)         
I tried posting in the request threa dbut didnt seem to get a responce. Could someone please give me the code for the following triggers?:

  • Change unit in QV area by type (This is the change unit in area by type box but the area is replaced with a quest var box)
  • Unit Immediate Garrison In unit Type (This is unit immediate garrison but instead of selecting a unit that gets immediately garrisoned into, it selects the type. So say I wanted a villager to immediate garrison inside a roc that is created when they invoke lure)
  • Units in area of protounit (A condition that activate s if a unit (The box where you type the units name in NOT select) is near a protounit.)

    Thanks in advanced these are really appreciated and vital triggers for 2 scenarios I will make. if you have any quetsions please ask.

    ______________________________________ Yeebaagooon ______________________________________
    ____________________ AoMH Seraph ____________________
    "You can't trust yeebaagooon to lead a rebelion, He would send everyone to steal mirrors so he could bask in his own brilliance." - Out Reach
    "Yeebaagooon had never seen a more handsome man in all his life. He couldn't control himself, He needed to act. Gripping the mirror in his strong arms he kissed the figure before him..." - Out Reach
    AoMH: Unfinished Scenarios|Singleplayer: Codename Ripto|Multiplayer: Minigames Z|CSC 7
    Ex Seraphs Dictator, Spore Heaven Seraph
  • AuthorReplies:
    TartarianCerberus
    Mortal
    (id: Cerberus_001)
    posted 01 October 2007 09:02 PM EDT (US)     1 / 10       
    Yeebaa, come on! You should know better! The trigger-making people (like nottud) mainly post in the Scen-Design forums.

    Cerberus- The three headed guard dog who guards the entrance to Hades; son of Typhon.

    "If I threw up on you, you'd be pissed." -Big Baby, House MD

    sporeh censusmaster, mafiamaster, competitionmaster, showcasemaster

    aomh | sporeh | pds | website | sign up for unicellular mafia at sporeh
    invent00r
    Mortal
    posted 02 October 2007 01:55 PM EDT (US)     2 / 10       
    I have one quetsion. Can you please explain trigger number a better? You want the area to be defined by a quest var?

    I will make you the others if you pay me $1 each!

    -invent00r

    My Work: 1 2 3 4 5 6 7 8 9 10

    WIP: Master XS Battle Micro AI
    Paused: AI (%4.247)
    Os segredos são de quem os souber guardar.
    Yeebaagooon
    EXCO Emeritus
    posted 02 October 2007 02:40 PM EDT (US)     3 / 10       
    Correct. I would like the area to be defined by a quest var.

    And heres your money:



    But remember:

    £ > $

    ______________________________________ Yeebaagooon ______________________________________
    ____________________ AoMH Seraph ____________________
    "You can't trust yeebaagooon to lead a rebelion, He would send everyone to steal mirrors so he could bask in his own brilliance." - Out Reach
    "Yeebaagooon had never seen a more handsome man in all his life. He couldn't control himself, He needed to act. Gripping the mirror in his strong arms he kissed the figure before him..." - Out Reach
    AoMH: Unfinished Scenarios|Singleplayer: Codename Ripto|Multiplayer: Minigames Z|CSC 7
    Ex Seraphs Dictator, Spore Heaven Seraph

    [This message has been edited by Yeebaagooon (edited 10-02-2007 @ 02:40 PM).]

    invent00r
    Mortal
    posted 03 October 2007 11:12 AM EDT (US)     4 / 10       
    Quoted from Yeebaagooon:
  • Change unit in QV area by type
  • How exactly do you want the unit change? Type? or name? =/
    Also, you will need 2 variables to define the area. One for X and another for 'Y'.
    Or do you prefer the coordenates in just one variable but less exact?
    Examples:

    2 Variables:
    A = 26.652641
    B = 8.326541
    (26.652641, 8.326541)

    1 Variable:
    A = 27.8 = (27, 8)
    Quoted from Yeebaagooon:
  • Unit Immediate Garrison In unit Type
  • I have tried to do this but it's nearly impossible.
    The only way I see it is by looking into each unit, and see if he belongs to that unit type - which would cause an huge amount of lagg.
    Quoted from Yeebaagooon:
  • Units in area of protounit
  • Not sure. But see if this is what you want:
       <Condition name="Units in Area of Protounit">
    <Param name="unit" dispName="Unit" varType="string">0</Param>
    <Param name="i" dispName="$$22301$$Player" varType="long">0</Param>
    <Param name="ID" dispName="Protounit" varType="long">0</Param>
    <Param name="d" dispName="Radius" varType="long">5</Param>
    <Command>bool inarea = false; int obj=0; int oldPlayer = xsGetContextPlayer();</Command>
    <Command>xsSetContextPlayer(%i%);</Command>
    <Command>int id = kbUnitQueryCreate("Query");</Command>
    <Command>kbUnitQuerySetPlayerID(id, %i%);</Command>
    <Command>kbUnitQuerySetState(id, 2);</Command>
    <Command>kbUnitQuerySetUnitType(id, %ID%);</Command>
    <Command>kbUnitQuerySetPosition(id, kbGetBlockPosition("%unit%"));</Command>
    <Command>kbUnitQuerySetAscendingSort(id, true);</Command>
    <Command>kbUnitQuerySetMaximumDistance(id, %d%);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>kbUnitQueryResetResults(id);</Command>
    <Command>if(kbUnitQueryExecute(id)>0) inarea = true;</Command>
    <Command>kbUnitQueryDestroy(id);</Command>
    <Command>xsSetContextPlayer(oldPlayer);</Command>
    <Expression>inarea</Expression>
    </Condition>

    My Work: 1 2 3 4 5 6 7 8 9 10

    WIP: Master XS Battle Micro AI
    Paused: AI (%4.247)
    Os segredos são de quem os souber guardar.
    nottud
    Hero
    posted 03 October 2007 05:35 PM EDT (US)     5 / 10       
    I have tried to do this but it's nearly impossible.
    The only way I see it is by looking into each unit, and see if he belongs to that unit type - which would cause an huge amount of lagg.
    Change in area already kinda does that (Looks into EVERY unit owned by that player)

    However I think the trigger is POSSIBLE. You use that query business. If the units searched is the unit type chosen - i.e. roc then it commands the unit select the garrison in it (It gets the id of the roc so it can select it for the garrsion trigger)

    I MIGHT be able to do this for you but I am poor at kb queries.

    I done it using angrazor's for protounit triggers:

    Step 1: Downlaod his triggers here:

    http://aom.heavengames.com/downloads/showfile.php?fileid=6378

    Step 2: Insert this custom made trigger (This is a second verion of the immediate garrison for all criteria)
       <Effect name="Unit Immediate Garrison For All of Criteria2">
    <Param name="DstObject" dispName="Center Unit" varType="unit">default</Param>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelect("%DstObject%");</Command>
    <Command>trImmediateUnitGarrison(""+1*trQuestVarGet("PHTC_ForAll_i"));</Command>
    </Effect>
    How to do it:

    Insert for protounit start trigger put put both player ranges to the player of the unit you wanna garrison in. Then put the id of the protounit that you want to garrsion in to search for.

    Then insert my trigger. Select the unit that you want to garrison if the protounit chosen appears on the map.

    Then insert a for protounit end trigger

    NOTE:Please do not select more than 1 unit with the centre unit thingy on my trigger or it will not work. Do each unit seperately.

    This should do what you want. If for any reason it does not work 100% then it is probably my fault since there could be a fault in it. But it worked fine for me. If more tha one of a protounit appears then it garrisons in the first one available.

    Umm, it seems that if the unit IDD does not match the name then it mucks up! There has to be a kb command that can change the id in the unit name...


    I did also make an army deploy in QV area if that helps:
       <Effect name="Army Deploy in QV area">
    <Param name="SrcArmy" dispName="$$22348$$Army" VarType="group">default</Param>
    <Param name="ProtoName" dispName="$$22434$$ProtoName" varType="protounit">Villager</Param>
    <Param name="L1" dispName="metres x" varType="string">QV1</Param>
    <Param name="L2" dispName="metres z" varType="string">QV2</Param>
    <Param name="Count" dispName="$$22435$$Count" varType="long">0</Param>
    <Param name="Heading" dispName="$$22432$$Heading" varType="long">0</Param>
    <Param name="Clear" dispName="$$22464$$Clear Existing Units:" varType="bool">true</Param>
    <Command>trArmyDispatch("%SrcArmy%", "%ProtoName%", %Count%, trQuestVarGet("%L1%"),0,trQuestVarGet("%L2%"), %Heading%, %Clear%);</Command>
    </Effect>

    The boy with the mad imagination
    Prepare for the ultimate duel!
    Learn to use all my triggers and what you can do with them. Visit here.
    Find out and download the transform trigger here.
    Play some minigames I have created outside AOM including some 3D games here.

    [This message has been edited by nottud (edited 10-03-2007 @ 06:08 PM).]

    invent00r
    Mortal
    posted 04 October 2007 06:15 AM EDT (US)     6 / 10       
    Quoted from nottud:
    Change in area already kinda does that (Looks into EVERY unit owned by that player)
    Yes it kinda does that, only much faster than I if wrote my code since Units in area and kb Queries are hard-coded.
    Lag issues and code efficiency are always of my concern.
    Quoted from nottud:
    Umm, it seems that if the unit IDD does not match the name then it mucks up! There has to be a kb command that can change the id in the unit name...
    At this point you must have realised why I said it was nearly impossible .
    There isn't any kb command as kb doesn't deal with units names, other than the blockID command.
    It seems they wanted triggers to deal with names rather than IDs. Maybe it was their way of trying to simply things.
    It's a shame they didn't made that function.

    Hey! I was going to do that Army QV trigger. .

    -invent00r

    My Work: 1 2 3 4 5 6 7 8 9 10

    WIP: Master XS Battle Micro AI
    Paused: AI (%4.247)
    Os segredos são de quem os souber guardar.
    Yeebaagooon
    EXCO Emeritus
    posted 04 October 2007 11:01 AM EDT (US)     7 / 10       
    Ok thanks but Im now confused! Invent00r needs to use enter on his trigger because it comes out in one line and angryzors are too complicated for me to work out how to use.

    ______________________________________ Yeebaagooon ______________________________________
    ____________________ AoMH Seraph ____________________
    "You can't trust yeebaagooon to lead a rebelion, He would send everyone to steal mirrors so he could bask in his own brilliance." - Out Reach
    "Yeebaagooon had never seen a more handsome man in all his life. He couldn't control himself, He needed to act. Gripping the mirror in his strong arms he kissed the figure before him..." - Out Reach
    AoMH: Unfinished Scenarios|Singleplayer: Codename Ripto|Multiplayer: Minigames Z|CSC 7
    Ex Seraphs Dictator, Spore Heaven Seraph
    invent00r
    Mortal
    posted 04 October 2007 11:45 AM EDT (US)     8 / 10       
    Enter?
    I
    use
    enter
    all
    the
    time!
    . You must be using some sort of low tech browser.

    -invent00r

    My Work: 1 2 3 4 5 6 7 8 9 10

    WIP: Master XS Battle Micro AI
    Paused: AI (%4.247)
    Os segredos são de quem os souber guardar.
    nottud
    Hero
    posted 04 October 2007 11:56 AM EDT (US)     9 / 10       
    Ok thanks but Im now confused! Invent00r needs to use enter on his trigger because it comes out in one line and angryzors are too complicated for me to work out how to use.
    You need to press the edit his post button. Then copy it from the post source. It should then paste properly.

    The boy with the mad imagination
    Prepare for the ultimate duel!
    Learn to use all my triggers and what you can do with them. Visit here.
    Find out and download the transform trigger here.
    Play some minigames I have created outside AOM including some 3D games here.
    Yeebaagooon
    EXCO Emeritus
    posted 04 October 2007 02:52 PM EDT (US)     10 / 10       
    Ah great thanks! Got the bottom 2 sorted, now its just the first one to go.

    ______________________________________ Yeebaagooon ______________________________________
    ____________________ AoMH Seraph ____________________
    "You can't trust yeebaagooon to lead a rebelion, He would send everyone to steal mirrors so he could bask in his own brilliance." - Out Reach
    "Yeebaagooon had never seen a more handsome man in all his life. He couldn't control himself, He needed to act. Gripping the mirror in his strong arms he kissed the figure before him..." - Out Reach
    AoMH: Unfinished Scenarios|Singleplayer: Codename Ripto|Multiplayer: Minigames Z|CSC 7
    Ex Seraphs Dictator, Spore Heaven Seraph
    You must be logged in to post messages.
    Please login or register

    Hop to:    

    Age of Mythology Heaven | HeavenGames