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.1672 replies, Sticky
Age of Mythology Heaven » Forums » Scenario Design » Have a Trigger Request? Post it here!
Bottom
Topic Subject:Have a Trigger Request? Post it here!
« Previous Page  1 ··· 10 ··· 20 21 22 23 24 ··· 30 ··· 40 ··· 50 ··· 60 ··· 67  Next Page »
Elrich
Hero
posted 23 July 2010 11:41 AM EDT (US)         
So you have a question trigger request?

You can post it here!



Hello and welcome to the Trigger Request Thread (TRT). This thread's purpose is only to place trigger requests and discuss them. If you have unrelated questions or need help with triggers, please use Azur's thread!



Before posting your request, it's always good to read the so-called FAQ.

  1. What is a FAQ?
    The term "FAQ" (when pronounced, it rhymes with "back") is an acronym for Frequently Asked Questions.

  2. How do I install a trigger?
    When we have finished making your trigger, we'll post the required code here. To install this code you will first of all need to find your way to the AoM installation folder. C:\Program Files\Microsoft Games\Age of Mythology by default). Now open the trigger folder if you intend to use the trigger in vanilla, or open the trigger2 folder if you use The Titans expansion. Next, open the file called typetest.xml. The only thing left to do is copy the code at the right position and save. If you requested a condition, then place the line above < /Conditions>, if you requested an effect paste it right above < /Effects>. Note the "s" at the end of both tags.

    Notes:

    1. When copying the trigger from someone please click first and only then copy the required code.
    2. If you're still uncomfortable with installing triggers please backup the original typetest file, i.e. copy the original to another folder.


  3. How do I uninstall a trigger?
    If a trigger happens to be faulty or if it generates errors you better remove it. Just do as if you were installing a new trigger, but instead of copy-pasting new code, remove the code corresponding with the chosen trigger. Make sure to remove it completely, including the starting < effect > or < condition > tag and the corresponding < /effect > or < /condition > closing tag. Failure to do so properly will cause XML errors in the file making ALL triggers in that file inaccessbile for AoM.

  4. So... How exactly are new triggers made?
    AoM has a built-in engine that can parse XS code. Triggers are programmed and interpreted using this language through a series of existing functions. Since there are over 600 functions, and only a few are used by the default triggers, this leaves plenty of room for a whole new set of advanced, useful triggers.

  5. Can I request anything?
    Although we can do a lot with today's knowledge, there are still limitation we won't ever get around. So if you think of a cool new trigger, make sure to post a request but don't forget you might get a negative reply. Commonly requested triggers that are not possible include (but are not limited to):

    • Modify Unit: change the stats of 1 particular unit.
    • Change Playername
    • Change Major God
    • Transform ALL units on map for player
    • I'll add more when I think of them.


  6. I want to learn trigger scripting, how do I do that?
    It takes quite some time, but if you really want to learn trigger coding, we recommend fully understanding XS language before you start making triggers. Therefore, go here: Master XS (WIP). If you want to skip all that, and you want to be able to create only simple triggers, read this guide.

  7. Help! My triggers have stopped working!
    Triggers Stop Working Guide. Also linking camera tracks, using Run Immediately, sound timers and decimals in conditions like Timer and Distance to Unit effect, might cause this. Moreover, typing an invalid name on the Victory Conditions will cause a trigger block. But post these sort of questions in the Great Question thread.



Resources

Recommended Downloads:
  1. Trigger Loader 2 + Quest Vars (AoM && TT) by invent00r and Mythic_Freak
  2. SomeNewXTriggers 3 (TT) & SomeNewTriggers 4 (AoM) by Reyk
  3. Proactive Triggers (TT & AoM) by invent00r
  4. Advanced Triggers Set (TT) by pftq
  5. New Custom Triggers (TT) by Baseballkid14
  6. Nottud's Latest Triggers by nottud
  7. Conditonal Effects (TT & AoM) by nottud
  8. Angry Levels (TT & AoM) by angryzor
  9. SIMSTools (TT) by angryzor
  10. Target Protounit Query by HailToTheOboe

Miscellaneous:
  1. First TRT by invent00r
  2. Trigger Templates by Mephiles
  3. A list of all guides sorted by Paperfriend




Posting a Request

So you have read the FAQ and want to post a request? OK, go for it, just be sure to use the following format:

Name - This should be as straightforward as possible. Try to comply with today's standards.
Description - Always describe the actions that you want the trigger to perform.
Example - Optional. An example can be a great help when requesting complex triggers.


[b]Name[/b] -
[b]Description[/b] -
[b]Example[/b] -


We might even ignore posts in other formats if we're in a bad mood
Remember that not all triggers are possible but we will try our best.




Unfinished Requests

  • Unit Patrol by Bingo Little
  • Army Wander by Endarron
  • QV Damage Units in QV area by name by mrjonathan0
  • Unit Heading Towards Unit by dwieeb
  • Damage units in Area by % (has been done before?) by Steak And Khan
  • Most Units In Area by Sir_Hans
  • QV Modify x by satansfall
  • Move from area to random area by Mister SCP
  • Set Unit Formation by aZeusDude2
  • Army Deploy Random Myth Unit by bgan
  • QV Randomize Series by Alexgd92
  • Convert all except protounit (or unit) by Joshonator
  • SET Ambient Colour/Sun Colour/Sun Specular/Terrain Ambient Fade Version by andrewv42
  • Damage units near army by AJER
  • QV count units in area with state by AuroraP
  • QV Grant random resources per stat by AuroraP
  • Condition: Random Timer by SwordOfValor
  • Army deploy in line by SwordOfValor
  • Condition: unit (type/in area) worked on other unit. by WinstonShnozwick
  • Gruoup selected by Guard of Olympus
  • Pick Unit by XxXItachiXxX
  • Modify Protounit All Percent by AuroraP
  • Random Forest by Bubble

  • Finished Requests

  • Damage Units near protounit for sneaky_squirrel & mrjonathan0
  • Move units from area to unit for Azur
  • Clear Chat History of Player & Chat Contains Anything for Lewonas
  • QV Change unit type by ID for Yeebaagooon
  • Move to QV Unit for Yeebaagoon
  • QV Modify Protounit for Xzyiothe
  • Player Kill GP Slot for Titanic Kraken
  • Move all player units for Anstar
  • Protounit Change Name for Dimir_Guildmage
  • Shop start/end with max for Mephiles
  • Diplomacy trigger for Yeebaagooon
  • Diplomacy both ways trigger for Yeebaagooon
  • Modify protounit trigger for Yeebaagooon
  • Convert trigger for Yeebaagooon
  • Make all units have no bonuses for Brighty
  • Conditional Army Units in Area for Sneaky_Squirrel
  • GROUP Select 2 for AuroraP
  • Send QV Color Chat for Alexgd92
  • Quest Var xModify for Alexgd92
  • QV Randomize 4 amounts for Alexgd92
  • QV Set Population Count for Beelzebub
  • Units in area of army for SwordOfValor
  • Damage units in area of army for SwordOfValor
  • AG with armies for SwordOfValor
  • Army deploy QV Count for Silicone Ruff Jr
  • Quest Var set rank for gunner1
  • Convert units in area to random player for Zorx
  • Units Change Name By Type for beerad
  • Army deploy where the units facing for SwordOfValor
  • Unit Heading Towards Unit for Noble
  • Convert Random Units In Selection for xEXOLARx
  • QV Set Units in Area (Center Army) for SwordOfValor
  • Move Units from Area (action) for SwordOfValor

  • Enjoy.
    Last updated: 03 september 2009

    In all your science of the mind, seeking blind through flesh and bone
    Find the blood inside this stone
    Well, I know I've never shown what I feel, I've always known
    I plan my vengeance on my own - and I was always alone
    AuthorReplies:
    lostrozzacavalli
    Mortal
    posted 06 May 2011 01:11 PM EDT (US)     526 / 1672       
    @JeOmaHeetBert: Then do one for each player but checking the "OR" box, this way only one of them needs to be true.

    Utilities || Map Tool 3.1 Inventory Triggers MP Triggers Comic AoM
    RandomMaps || Mad Supremacy Escape Your Mates Escape
    Scenarios || Bomberman Minigames Y 2.0 Convert & Fight
    Games || Bullet Demo Ball Bouncer 3D
    WRP_Beater: "Meglio una gallina oggi che un uovo domani."
    My name has been misspelled 132 times (Last: BSU_DoLhades Best: Lostrozzabercrombie In a row: 5)
    JeOmaHeetBert
    Mortal
    posted 06 May 2011 01:56 PM EDT (US)     527 / 1672       
    @lostrozzacavalli: Thanks, never knew there was a 'or' button.
    TAG
    That AoM Guy
    (id: aom expert)
    posted 08 May 2011 09:34 AM EDT (US)     528 / 1672       
    Oh god that thing has so many uses. I never figured it out 'till way later as well.

    Check out my YouTube
    For live help with me, enter this chatroom. If I'm not on you can leave a message.
    Eurotool
    Hero
    posted 08 May 2011 11:50 AM EDT (US)     529 / 1672       
    There's also a "And" button

    Before I had some german editor and I was not able to see them. After, when I reinstalled AoM, I saw them, but I never use them

    lostrozzacavalli
    Mortal
    posted 08 May 2011 01:38 PM EDT (US)     530 / 1672       
    There weren't OR and NOT buttons in AoM Vanilla IIRC so maybe that's why you didn't notice them.

    Utilities || Map Tool 3.1 Inventory Triggers MP Triggers Comic AoM
    RandomMaps || Mad Supremacy Escape Your Mates Escape
    Scenarios || Bomberman Minigames Y 2.0 Convert & Fight
    Games || Bullet Demo Ball Bouncer 3D
    WRP_Beater: "Meglio una gallina oggi che un uovo domani."
    My name has been misspelled 132 times (Last: BSU_DoLhades Best: Lostrozzabercrombie In a row: 5)
    Eurotool
    Hero
    posted 08 May 2011 03:17 PM EDT (US)     531 / 1672       
    @Lostrozaurus Caballus : I had AoE TT too, but some editor that I downloaded from a lost site written in german or swedish years ago. When I got a new computer I just copied AoM and TT folders and pasted them, which wasn't the good thing to do
    I remember I didn't have all the textures, but the editor was quite user-friendly. I couldn't do such cool design as I can do with Nottud's one. I think that the first CSC screenshot I made was with that old editor.

    TAG
    That AoM Guy
    (id: aom expert)
    posted 08 May 2011 06:40 PM EDT (US)     532 / 1672       
    I've never actually played aom vanilla that much but going back to its editor after using titans, it sucks! There's so much that's left out that you really need. Triggers, buttons, features, everything.

    Check out my YouTube
    For live help with me, enter this chatroom. If I'm not on you can leave a message.
    Mister SCP
    Scenario Reviewer
    posted 15 May 2011 02:24 PM EDT (US)     533 / 1672       
    I noticed a way for AOE3 to have better Hotkey triggers (should lagg less) in Multiplayer

    I will post some code of trigtemp file:

    rule _Trigger_0
    highFrequency
    active
    runImmediately
    {
    bool bVar0 = (true);


    bool tempExp = (bVar0);
    if (tempExp)
    {
    map("a","game","trackInsert(); trackAddWaypoint();trackPlay(-1,0);");
    xsDisableRule("_Trigger_0");
    trEcho("Trigger disabling rule Trigger_0");
    }
    }

    rule _Trigger_1
    highFrequency
    inactive
    runImmediately
    {
    bool bVar0 = (true);


    bool tempExp = (bVar0);
    if (tempExp)
    {
    /**/ int FP=trCurrentPlayer();
    /**/ trPlayerSetActive(FP);
    trUnitCreate("AbusGun", "Default", 76.57, 4.00, 75.97, 0, FP);
    trChatSend(FP, "default");
    xsDisableRule("_Trigger_1");
    trEcho("Trigger disabling rule Trigger_1");
    }
    }

    As you might can see I can create an AbusGun+ get a chat when i press the key a. I have only tested it for Unit Create yet. The main Idea from the other hotkey triggers are these lines
    /**/ int FP=trCurrentPlayer();
    /**/ trPlayerSetActive(FP);
    so we set the player active ->no OOS in AOE3

    Happy Tryout


    ESO2 Name:Sir_ConstantinESO Name:Sir_Pacman
    Trigger Freak and Modder for AOE3

    SCP Editor Tools---my map pack---Some incomplete stuff
    My trigger Pack

    [This message has been edited by Mister SCP (edited 05-16-2011 @ 11:06 AM).]

    LonelyKnight
    Mortal
    posted 17 May 2011 08:30 PM EDT (US)     534 / 1672       
    Name - Kill units in rectangle Area
    Description - Kills all units of a certain type in a rectangular area, possibly defined by 4 objects, dunno
    Example - Fairly obvious what I'm describing

    or... if said effect is impossible

    Name - Kill units between units
    Description - Kills all units of a certain type that pass between two different units
    Example - Fairly obvious what I'm describing

    I'm guessing this one is possible since I think I saw a thread about casting god powers randomly between two units

    pretty please?
    Lewonas
    Mortal
    posted 18 May 2011 07:07 AM EDT (US)     535 / 1672       

    <Effect name="Destroy Units in User Defined Area">
    <Param name="PlayerID" dispName="$$22301$$Player" VarType="long">0</Param>
    <Param name="PN" dispName="$$22434$$ProtoName" varType="protounit">Villager</Param>
    <Param name="Location" dispName="" varType="area">0,0,0</Param>
    <Param name="Location2" dispName="" varType="area">0,0,0</Param>
    <Command>for(q=0;>1){} for(w=0;>1){} for(a=0;>1){} for(s=0;>1){}</Command>
    <Command>for(Qid=0;>1){}for(id=0;>1){}for(x=0;>1){} for(y=0;>1){}</Command>
    <Command>q=xsVectorGetX(vector(%Location%));w=xsVectorGetZ(vector(%Location%));</Command>
    <Command>a=xsVectorGetX(vector(%Location2%));s=xsVectorGetZ(vector(%Location2%));</Command>
    <Command>xsSetContextPlayer(%PlayerID%);kbLookAtAllUnitsOnMap();</Command>
    <Command>Qid=kbUnitQueryCreate("QDA_%PlayerID%_%PN%");</Command>
    <Command>kbUnitQuerySetPlayerID(Qid, %PlayerID%, true);</Command>
    <Command>kbUnitQuerySetUnitType(Qid, kbGetProtoUnitID("%PN%"));</Command>
    <Command>kbUnitQuerySetState(Qid, 2);</Command>
    <Command>trUnitSelectClear();</Command>

    <Command>for(i=kbUnitQueryExecute(Qid)-1;>-1){</Command>

    <Command>id = kbUnitQueryGetResult(Qid,i);x=xsVectorGetX(kbUnitGetPosition(id));y=xsVectorGetZ(kbUnitGetPosition(id));</Command>
    <Command>if(((w>=y)!=true||(y>=s)!=true||(x>=q)!=true||(a>=x)!=true)!=true){trUnitSelectByID(id);}}</Command>
    <Command>trUnitDestroy();</Command>
    </Effect>

    <Effect name="Kill Units in User Defined Area">
    <Param name="PlayerID" dispName="$$22301$$Player" VarType="long">0</Param>
    <Param name="PN" dispName="$$22434$$ProtoName" varType="protounit">Villager</Param>
    <Param name="Location" dispName="" varType="area">0,0,0</Param>
    <Param name="Location2" dispName="" varType="area">0,0,0</Param>
    <Command>for(q=0;>1){} for(w=0;>1){} for(a=0;>1){} for(s=0;>1){}</Command>
    <Command>for(Qid=0;>1){}for(id=0;>1){}for(x=0;>1){} for(y=0;>1){}</Command>
    <Command>q=xsVectorGetX(vector(%Location%));w=xsVectorGetZ(vector(%Location%));</Command>
    <Command>a=xsVectorGetX(vector(%Location2%));s=xsVectorGetZ(vector(%Location2%));</Command>
    <Command>xsSetContextPlayer(%PlayerID%);kbLookAtAllUnitsOnMap();</Command>
    <Command>Qid=kbUnitQueryCreate("QDA_%PlayerID%_%PN%");</Command>
    <Command>kbUnitQuerySetPlayerID(Qid, %PlayerID%, true);</Command>
    <Command>kbUnitQuerySetUnitType(Qid, kbGetProtoUnitID("%PN%"));</Command>
    <Command>kbUnitQuerySetState(Qid, 2);</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>for(i=kbUnitQueryExecute(Qid)-1;>-1){</Command>
    <Command>id = kbUnitQueryGetResult(Qid,i);x=xsVectorGetX(kbUnitGetPosition(id));y=xsVectorGetZ(kbUnitGetPosition(id));</Command>
    <Command>if(((w>=y)!=true||(y>=s)!=true||(x>=q)!=true||(a>=x)!=true)!=true){trUnitSelectByID(id);}}</Command>
    <Command>trUnitDelete(false);</Command>
    </Effect>

    I would like to request the trigger: Zoom in/out Start and Zoom in/out STOP
    Description: "Zoom in/out Start" should start zooming in or out and "Zoom in/out STOP" should stop zooming in or out. I basically need this to zoom out on a unit (camera cut on unit -> Zoom in/out Start -> Timer: 3 seconds -> Zoom in/out Stop).

    What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
    Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
    Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]

    [This message has been edited by Lewonas (edited 05-18-2011 @ 07:15 AM).]

    perpetual_n00b
    Immortal
    posted 18 May 2011 07:21 AM EDT (US)     536 / 1672       
    Lewonas, you can use Oboe's camera cut effect to zoom in/out on a unit. Just put it in a looping trigger with trQuestVarGet("MyZoomVar") in the Zoom parameter field and adjust the zoom variable each iteration of the loop.

    <Effect name = "Camera Cut Oboe">
    <Param name="SrcObject" dispName="Object" varType="unit">default</Param>
    <Param name="Psi" dispName="Heading" varType="string">0.0</Param>
    <Param name="Theta" dispName="Pitch" varType="string">0.0</Param>
    <Param name="Phi" dispName="Roll" varType="string">0.0</Param>
    <Param name="Zoom" dispName="Zoom" varType="string">50.0</Param>
    <Command>trQuestVarSet("xx", Math_cos(%Theta%*PI/180.0)*Math_cos((%Psi%-90.0)*PI/180.0));</Command>
    <Command>trQuestVarSet("xy",-1.0*Math_sin(%Theta%*PI/180.0));</Command>
    <Command>trQuestVarSet("xz",-1.0*Math_cos(%Theta%*PI/180.0)*Math_sin((%Psi%-90.0)*PI/180.0));</Command>
    <Command>trQuestVarSet("yx", Math_cos(%Phi%*PI/180.0)*Math_sin(%Theta%*PI/180.0)*Math_cos((%Psi%-90.0)*PI/180.0)+Math_sin(%Phi%*PI/180.0)*Math_sin((%Psi%-90.0)*PI/180.0));</Command>
    <Command>trQuestVarSet("yy", Math_cos(%Phi%*PI/180.0)*Math_cos(%Theta%*PI/180.0));</Command>
    <Command>trQuestVarSet("yz",-1.0*Math_cos(%Phi%*PI/180.0)*Math_sin(%Theta%*PI/180.0)*Math_sin((%Psi%-90.0)*PI/180.0)+Math_sin(%Phi%*PI/180.0)*Math_cos((%Psi%-90.0)*PI/180.0));</Command>
    <Command>trQuestVarSet("zx", Math_sin(%Phi%*PI/180.0)*Math_sin(%Theta%*PI/180.0)*Math_cos((%Psi%-90.0)*PI/180.0)-Math_cos(%Phi%*PI/180.0)*Math_sin((%Psi%-90.0)*PI/180.0));</Command>
    <Command>trQuestVarSet("zy", Math_sin(%Phi%*PI/180.0)*Math_cos(%Theta%*PI/180.0));</Command>
    <Command>trQuestVarSet("zz",-1.0*Math_sin(%Phi%*PI/180.0)*Math_sin(%Theta%*PI/180.0)*Math_sin((%Psi%-90.0)*PI/180.0)-Math_cos(%Phi%*PI/180.0)*Math_cos((%Psi%-90.0)*PI/180.0));</Command>
    <Command>trVectorQuestVarSet("dirx", xsVectorSet(trQuestVarGet("xx"),trQuestVarGet("xy"),trQuestVarGet("xz")));</Command>
    <Command>trVectorQuestVarSet("upy", xsVectorSet(trQuestVarGet("yx"),trQuestVarGet("yy"),trQuestVarGet("yz")));</Command>
    <Command>trVectorQuestVarSet("rightz", xsVectorSet(trQuestVarGet("zx"),trQuestVarGet("zy"),trQuestVarGet("zz")));</Command>
    <Command>trVectorQuestVarSet("camposit",kbGetBlockPosition("%SrcObject%")-trVectorQuestVarGet("dirx")*%Zoom%);</Command>
    <Command>trCameraCut(trVectorQuestVarGet("camposit"),trVectorQuestVarGet("dirx"),trVectorQuestVarGet("upy"),trVectorQuestVarGet("rightz"));</Command>
    </Effect>
    LonelyKnight
    Mortal
    posted 18 May 2011 08:29 AM EDT (US)     537 / 1672       
    Thanks Lewonas
    Now my next project is feasible!
    Lewonas
    Mortal
    posted 18 May 2011 12:49 PM EDT (US)     538 / 1672       
    Last time I used Oboe's camera cut effect it caused terrible lag. Perhaps... it was the Heading operator causing the lag... idk.

    What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
    Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
    Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]
    WinstonShnozwick
    Mortal
    posted 19 May 2011 01:58 AM EDT (US)     539 / 1672       
    Lewonas, I think that might be the best way to get your desired effect. I have a trigger where it rotates the camera 360 degrees with a looping trigger and ms timer proactive increasing the degree by 1 per every few miliseconds. It goes smoothly usually, but when my computer is processing lots of data or being slow, it lags a bit. dont know why., probably counting the changes.

    Tired of unorigional, boring campaigns? Try out DEMO|Legacy - The Uprising|DEMO
    Completely New Gameplay. Random Map Type Replayability. Delve into Nomadican|FEATURES|DOWNLOAD|
    Want to know how to use triggers and/or create amazing factors in your scenarios? You need Combination Effects|FEATURES|DOWNLOAD|
    Automaton Metals Textures, New Custom Triggers
    Upcoming Projects: Legacy - The Uprising, Destiny
    6/12/1997, a day that will live in infamy.
    Lewonas
    Mortal
    posted 19 May 2011 05:31 AM EDT (US)     540 / 1672       
    Yeah, I'll give it a shot. The terrible lag only occured in multiplayer, not in singleplayer.

    What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
    Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
    Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]
    lostrozzacavalli
    Mortal
    posted 19 May 2011 07:41 AM EDT (US)     541 / 1672       
    It indeed uses a lot of operations and functions which is ok for singleplayer but not for multiplayer.

    Utilities || Map Tool 3.1 Inventory Triggers MP Triggers Comic AoM
    RandomMaps || Mad Supremacy Escape Your Mates Escape
    Scenarios || Bomberman Minigames Y 2.0 Convert & Fight
    Games || Bullet Demo Ball Bouncer 3D
    WRP_Beater: "Meglio una gallina oggi che un uovo domani."
    My name has been misspelled 132 times (Last: BSU_DoLhades Best: Lostrozzabercrombie In a row: 5)
    Ghostoo
    Mortal
    posted 20 May 2011 10:58 PM EDT (US)     542 / 1672       
    i haven't checked around but these would be nice

    tried "Move untis from Area" and edited to work for palyers 11 and 12 but they aren't responding:
       <Effect name="Move From Area PLAYERS">
    <Param name="RefObject" dispName="Center Unit" varType="unit">default</Param>
    <Param name="UnitType" dispName="Type" varType="string">Unit</Param>
    <Param name="PlayerID" dispName="Player" varType="float">1</Param>
    <Param name="Radius" dispName="Radius" VarType="float">10</Param>
    <Param name="DstPoint" dispName="X" varType="area">0</Param>
    <Param name="AttackMove" dispName="Attack Move" varType="bool">false</Param>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="RefObject">trUnitSelect("%RefObject%");</Command>
    <Command>trUnitMoveFromArea(%DstPoint%, -1, %AttackMove%, %PlayerID%, "%UnitType%", %Radius%);</Command>
    </Effect>

    also my camera track for player i received online isn't working (couldn't find the trigger i got for that, but a code for it would be very much appreciated)

    and before i forget if there isn't a set-formation trigger i'd very much appreciate that too, but i'm pretty sure there is one.
    Lewonas
    Mortal
    posted 21 May 2011 06:53 AM EDT (US)     543 / 1672       
    I made the triggers for you


    <Effect name="Camera Track for Player">
    <Param name="Player" dispName="Player" varType="string">1</Param>
    <Param name="TrackName" dispName="$$22365$$Name" varType="camtrack">default</Param>
    <Param name="EventID" dispName="$$22362$$Trigger" varType="event">-1</Param>
    <Command>if(trCurrentPlayer() == %Player%){</Command>
    <Command>trCamTrackLoad("%TrackName%");</Command>
    <Command>trCamTrackPlay(-1, %EventID%);</Command>
    <Command>}</Command>
    </Effect>

    <Effect name="Move From Area 2">
    <Param name="RefObject" dispName="$$22300$$Center Unit" varType="unit">default</Param>
    <Param name="UnitType" dispName="$$23798$$Type" varType="string">Unit</Param>
    <Param name="PlayerID" dispName="$$22301$$Player" varType="string">0</Param>
    <Param name="Radius" dispName="$$22303$$Radius" VarType="float">10</Param>
    <Param name="DstPoint" dispName="$$22410$$X" varType="area">0</Param>
    <Param name="AttackMove" dispName="$$18986$$Attack Move" varType="bool">false</Param>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="RefObject">trUnitSelect("%RefObject%");</Command>
    <Command>trUnitMoveFromArea(%DstPoint%, -1, %AttackMove%, %PlayerID%, "%UnitType%", %Radius%);</Command>
    </Effect>

    What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
    Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
    Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]

    [This message has been edited by Lewonas (edited 05-21-2011 @ 07:00 AM).]

    Ghostoo
    Mortal
    posted 21 May 2011 08:02 PM EDT (US)     544 / 1672       
    tyvm


    EDIT: back again, need a new one:

    Condition:
    Unit Type in Area of Army
    -need player number of unit type to be string

    seems easy enough i'm gonna try to do one real fast, but posting here just in case i don't succeed. Thanks

    EDIT2:

    also need
    EFFECTS:

    >Damage Unit Type in Area of Unit type
    -damages units of a certain type in they are in a certain distance to another unit of a certain type
    >Unit Heading by Type
    -sets unit type's heading

    >Unit Heading by Type refrence
    -sets unit (type) heading in respect to another unit's heading

    >Unit Heading Modify
    -modifies the current unit's heading
    -would be nice to make with unit type

    ^Unit Headings would be nice with army settings too

    [This message has been edited by Ghostoo (edited 05-22-2011 @ 04:50 AM).]

    Lewonas
    Mortal
    posted 22 May 2011 06:01 AM EDT (US)     545 / 1672       
    >Damage Unit Type in Area of Unit type
    You can already do this with the vtriggers.

    I'll try to make your other requested triggers.

    Unit Heading By Type

    <Effect name="v Unit Heading">
    <Param name="Heading" dispName="Heading" varType="long">0</Param>
    <Command>trUnitSetHeading(%Heading%);</Command>
    </Effect>

    Unit Heading by Type reference

    <Effect name="Unit Heading of other unit">
    <Param name="SrcObject" dispName="$$22295$$Source Unit" varType="unit">default</Param>
    <Param name="DstObject" dispName="Target Unit" varType="unit">default</Param>
    <Command>trQuestVarSet("uhiq%DstObject%newx", xsVectorGetX(kbGetBlockPosition("%DstObject%")));</Command>
    <Command>if(trQuestVarGet("uhiq%DstObject%oldx") > trQuestVarGet("uhiq%DstObject%newx")) trQuestVarSet("lewolewo",360.0 - trUnitGetHeading("%DstObject%"));</Command>
    <Command>else trQuestVarSet("lewolewo",trUnitGetHeading("%DstObject%"));</Command>
    <Command>trQuestVarSet("uhiq%DstObject%oldx",trQuestVarGet("uhiq%DstObject%newx"));</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trUnitSetHeading(trQuestVarGet("lewolewo"));</Command>
    </Effect>

    Unit TYPE Heading by Type reference

    <Effect name="v Unit Heading of other unit">
    <Param name="SrcObject" dispName="Source Unit" varType="unit">default</Param>
    <Command>trQuestVarSet("uhiq%SrcObject%newx", xsVectorGetX(kbGetBlockPosition("%SrcObject%")));</Command>
    <Command>if(trQuestVarGet("uhiq%SrcObject%oldx") > trQuestVarGet("uhiq%SrcObject%newx")) trQuestVarSet("lewolew",360.0 - trUnitGetHeading("%SrcObject%"));</Command>
    <Command>else trQuestVarSet("lewolew", trUnitGetHeading("%SrcObject%"));</Command>
    <Command>trQuestVarSet("uhiq%DstObject%oldx",trQuestVarGet("uhiq%DstObject%newx"));</Command>
    <Command>trUnitSetHeading(trQuestVarGet("lewolew"));</Command>
    </Effect>

    Army Heading by Type reference

    <Effect name="Army Heading of other unit">
    <Param name="SrcObject" dispName="Target Unit" varType="unit">default</Param>
    <Param name="SrcArmy" dispName="Source Army" VarType="group">default</Param>
    <Command>trQuestVarSet("uhiq%SrcObject%newx", xsVectorGetX(kbGetBlockPosition("%SrcObject%")));</Command>
    <Command>if(trQuestVarGet("uhiq%SrcObject%oldx") > trQuestVarGet("uhiq%SrcObject%newx")) trQuestVarSet("lewolewo2",360.0 - trUnitGetHeading("%SrcObject%"));</Command>
    <Command>else trQuestVarSet("lewolewo2", trUnitGetHeading("%SrcObject%"));</Command>
    <Command>trQuestVarSet("uhiq%DstObject%oldx",trQuestVarGet("uhiq%DstObject%newx"));</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trArmySelect("%SrcArmy%");</Command>
    <Command>trUnitSetHeading(trQuestVarGet("lewolewo2"));</Command>
    </Effect>


    Unit Heading Modify

    <Effect name="Unit Heading Modify">
    <Param name="SrcObject" dispName="Source Unit" varType="unit">default</Param>
    <Param name="Oper" dispName="Operator" VarType="string">+</Param>
    <Param name="Heading" dispName="Modify amount" varType="long">0</Param>
    <Command>trQuestVarSet("lewolewolewo", %Heading%);</Command>
    <Command>trQuestVarSet("uhiq%SrcObject%newx", xsVectorGetX(kbGetBlockPosition("%SrcObject%")));</Command>
    <Command>if(trQuestVarGet("uhiq%SrcObject%oldx") > trQuestVarGet("uhiq%SrcObject%newx")) trQuestVarSet("lewolewo3",360.0 - trUnitGetHeading("%SrcObject%"));</Command>
    <Command>else trQuestVarSet("lewolewo3", trUnitGetHeading("%SrcObject%"));</Command>
    <Command>trQuestVarSet("uhiq%DstObject%oldx",trQuestVarGet("uhiq%DstObject%newx"));</Command>
    <Command>trQuestVarSet("lewolewo3", trQuestVarGet("lewolewo3") %Oper% trQuestVarGet("lewolewolewo"));</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trUnitSetHeading(trQuestVarGet("lewolewo3"));</Command>
    </Effect>


    Unit Headings are a bit bugged in AoM so it can happen that my triggers sometimes use wrong heading values.

    fyi, the source units are the units whose headings will be changed.

    What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
    Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
    Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]

    [This message has been edited by Lewonas (edited 05-22-2011 @ 08:57 AM).]

    Ghostoo
    Mortal
    posted 22 May 2011 01:14 PM EDT (US)     546 / 1672       
    thanks man, you're awesome

    i know you said they're bugged, but this one wasn't particularly working:

    Unit Heading Modify

    <Effect name="Unit Heading Modify">
    <Param name="SrcObject" dispName="Source Unit" varType="unit">default</Param>
    <Param name="Oper" dispName="Operator" VarType="string">+</Param>
    <Param name="Heading" dispName="Modify amount" varType="long">0</Param>
    <Command>trQuestVarSet("lewolewolewo", %Heading%);</Command>
    <Command>trQuestVarSet("uhiq%SrcObject%newx", xsVectorGetX(kbGetBlockPosition("%SrcObject%")));</Command>
    <Command>if(trQuestVarGet("uhiq%SrcObject%oldx") > trQuestVarGet("uhiq%SrcObject%newx")) trQuestVarSet("lewolewo3",360.0 - trUnitGetHeading("%SrcObject%"));</Command>
    <Command>else trQuestVarSet("lewolewo3", trUnitGetHeading("%SrcObject%"));</Command>
    <Command>trQuestVarSet("uhiq%DstObject%oldx",trQuestVarGet("uhiq%DstObject%newx"));</Command>
    <Command>trQuestVarSet("lewolewo3", trQuestVarGet("lewolewo3") %Oper% trQuestVarGet("lewolewolewo"));</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trUnitSetHeading(trQuestVarGet("lewolewo3"));</Command>
    </Effect>


    it would modify the heading, but then revert it back to the original heading when i tried a second modification, and it'd repeat the 2 heading settings in loop.

    And about the refrence setting. I'd like to request a heading with an offset of the unit setting. So right now it follows my unit's heading, which is good. Can i offset it so it's a heading of 90 of what direction my target unit is facing?

    Also is there triggers that i can use with the cursor? Other than unit selected that is. I want to try to edit an object's heading according to it's position with a unit and the cursor.

    Again, much appreciated.

    [This message has been edited by Ghostoo (edited 05-22-2011 @ 01:43 PM).]

    Lewonas
    Mortal
    posted 23 May 2011 09:11 AM EDT (US)     547 / 1672       
    AoM unit headings work like this:

    When you place a unit in the editor, that unit is looking to the south and its heading is: "180". When he looks to either the west or east, its heading always is "90". Actually, when a unit is looking to the west, its heading is -90. AoM sees -90 as 90, and that's why the unit headings are bugged. So, when your unit is looking to the south, it has a heading of 180... and when you modify that heading by 90, 180 becomes -90 instead of 270, and -90 becomes 90 which is EAST. So the unit will look to the east instead of the west. The Unit Heading Modify trigger isn't bugged, but AoM is.


    Here is your requested parameter:
       <Effect name="Unit Heading of other unit">
    <Param name="SrcObject" dispName="$$22295$$Source Unit" varType="unit">default</Param>
    <Param name="DstObject" dispName="Target Unit" varType="unit">default</Param>
    <Param name="Offset" dispName="Offset Heading" varType="long">0</Param>
    <Command>trQuestVarSet("uhiq%DstObject%newx", xsVectorGetX(kbGetBlockPosition("%DstObject%")));</Command>
    <Command>if(trQuestVarGet("uhiq%DstObject%oldx") > trQuestVarGet("uhiq%DstObject%newx")) trQuestVarSet("lewolewo",360.0 - trUnitGetHeading("%DstObject%"));</Command>
    <Command>else trQuestVarSet("lewolewo",trUnitGetHeading("%DstObject%"));</Command>
    <Command>trQuestVarSet("uhiq%DstObject%oldx",trQuestVarGet("uhiq%DstObject%newx"));</Command>
    <Command>trQuestVarSet("lewolewo",trQuestVarGet("lewolewo") + %Offset%);</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trUnitSetHeading(trQuestVarGet("lewolewo"));</Command>
    </Effect>

       <Effect name="Army Heading of other unit">
    <Param name="SrcObject" dispName="Source Unit" varType="unit">default</Param>
    <Param name="SrcArmy" dispName="Target Army" VarType="group">default</Param>
    <Param name="Offset" dispName="Offset Heading" varType="long">0</Param>
    <Command>trQuestVarSet("uhiq%SrcObject%newx", xsVectorGetX(kbGetBlockPosition("%SrcObject%")));</Command>
    <Command>if(trQuestVarGet("uhiq%SrcObject%oldx") > trQuestVarGet("uhiq%SrcObject%newx")) trQuestVarSet("lewolewo2",360.0 - trUnitGetHeading("%SrcObject%"));</Command>
    <Command>else trQuestVarSet("lewolewo2", trUnitGetHeading("%SrcObject%"));</Command>
    <Command>trQuestVarSet("uhiq%DstObject%oldx",trQuestVarGet("uhiq%DstObject%newx"));</Command>
    <Command>trQuestVarSet("lewolewo2",trQuestVarGet("lewolewo2") + %Offset%);</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcArmy">trArmySelect("%SrcArmy%");</Command>
    <Command>trUnitSetHeading(trQuestVarGet("lewolewo2"));</Command>
    </Effect>


    I have an idea to make your cursor trigger. I'll try to make it and edit it in this post.

    What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
    Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
    Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]
    Lewonas
    Mortal
    posted 23 May 2011 01:42 PM EDT (US)     548 / 1672       
    Yes, I did it!

    I decided to post the triggers in a new reply because the code is HUGE. OK.

    I proudly present:


    Unit Heading at Cursor


    What do you need?
  • AoM Trigger Loader
  • Effect: XS User Code
        <Effect name="XS User Code">
    <Param name="MyString" dispName="Code" VarType="stringid"></Param>
    <Command>/**/ %MyString%</Command>
    </Effect>

    How does it work?
    I copied a lot of code of the vtriggers and ytriggers to make your life easy .

    1. First, you need a FLYING CENTER UNIT which is in a group, YOUR UNIT which is in a group and an ATLANTEAN MILITARY UNIT which is in a group and which can be turned into a hero. Use this effect in 1 active trigger:

    <Effect name="Unit Heading at Cursor SETUP 1">
    <Param name="unit" dispName="Center Unit" varType="string">unit</Param>
    <Param name="unit2" dispName="Transformable Unit" varType="string">unit</Param>
    <Param name="unit3" dispName="Your Unit" varType="string">unit</Param>
    <Param name="GroupID1" dispName="Center Unit Group" varType="long">1</Param>
    <Param name="GroupID2" dispName="T Unit Group" varType="long">2</Param>
    <Param name="GroupID3" dispName="Your Unit" varType="long">3</Param>
    <Command>trBlockAllSounds(true);</Command>
    <Command>uiFindType("%unit%");</Command>
    <Command>trUnblockAllSounds();</Command>
    <Command>uiAddSelectNumberGroup(%GroupID1%);</Command>
    <Command>uiClearSelection();</Command>
    <Command>trBlockAllSounds(true);</Command>
    <Command>uiFindType("%unit2%");</Command>
    <Command>trUnblockAllSounds();</Command>
    <Command>uiAddSelectNumberGroup(%GroupID2%);</Command>
    <Command>uiClearSelection();</Command>
    <Command>trBlockAllSounds(true);</Command>
    <Command>uiFindType("%unit3%");</Command>
    <Command>trUnblockAllSounds();</Command>
    <Command>uiAddSelectNumberGroup(%GroupID3%);</Command>
    <Command>uiClearSelection();</Command>
    </Effect>

    Example:
    Center Unit: Roc
    Transformable Unit: Maceman
    Your Unit: Arkantos
    Center Unit Group: 1
    Transformable Unit Group: 2
    Your Unit Group: 3

    2. The next trigger contains the XS User Code effect. Write the following code in the Code Box:

    map("hotkey","game","uiSelectNumberGroup(Transformable Unit Group) uiTransformSelectedUnit(\"Atlantean Hero\")");

    Replace "hotkey" with any number between 0-9, replace "Transformable Unit Group" with your atlantean military unit's group number and replace "Atlantean Hero" with your chosen atlantean military hero unit.

    Example:

    map("1","game","uiSelectNumberGroup(2) uiTransformSelectedUnit(\"Maceman Hero\")");

    3. The next trigger contains the Trigger Loader.

    4. You now have to make a trigger which is on "active" and "loop" and set the priority as high as possible (read as: set all of your triggers on the highest priority ). This trigger will contain the huge code which I won't explain because that will take too much time. I put a number behind each effect name so you know in what order you must put them.

    <Effect name="Unit Heading at Cursor 1">
    <Param name="Max" dispName="Highest unit name" VarType="long">0</Param>
    <Param name="Buf" dispName="Raise if problems" VarType="long">10</Param>
    <Param name="Buf2" dispName="Reboot buffer size" VarType="long">1000</Param>
    <Param name="qv" dispName="Unused quest var" VarType="string">cow</Param>
    <Param name="inv" dispName="invisible unused unit" varType="protounit">Blood Gore</Param>
    <Param name="Location" dispName="" varType="area">0,0,0</Param>
    <Command>for(buf = 0; > 1){}</Command>
    <Command>buf = %Buf%;</Command>
    <Command>if(1*trQuestVarGet("%qv%-%qv%-%qv%") == 1){</Command>
    <Command>trQuestVarSet("%qv%-%qv%-%qv%", 0);</Command>
    <Command>buf = %Buf2%;</Command>
    <Command>}</Command>
    <Command>trQuestVarSet("%qv%-%qv%", 1*trQuestVarGet("%qv%"));</Command>
    <Command>trArmyDispatch("0,0","%inv%",1,%Location%,0,true);</Command>
    <Command>if(trQuestVarGet("zzzzlifespans0") != 1){</Command>
    <Command>if("%inv%" == "blood gore")trModifyProtounit("%inv%", 0, 8, -3.999);</Command>
    <Command>if("%inv%" == "oar footprint")trModifyProtounit("%inv%", 0, 8, -4.999);</Command>
    <Command>trQuestVarSet("zzzzlifespans0", 1);}</Command>
    <Command>for(type = 0; > 1){}</Command>
    <Command>for(i = 0; > 1){}</Command>
    <Command>if(%Max% >= 1*trQuestVarGet("%qv%"))trQuestVarSet("%qv%", %Max%+1);</Command>
    <Command>while(buf >= i){</Command>
    <Command>if(kbGetUnitBaseTypeID(kbGetBlockID(""+1*trQuestVarGet("%qv%"))) == -1){</Command>
    <Command>i = i + 1;}</Command>
    <Command>if(kbGetUnitBaseTypeID(kbGetBlockID(""+1*trQuestVarGet("%qv%"))) != -1){</Command>
    <Command>i = 0;</Command>
    <Command>type = kbGetUnitBaseTypeID(kbGetBlockID(""+1*trQuestVarGet("%qv%")));</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelect(""+1*trQuestVarGet("%qv%"));</Command>
    </Effect>

    Leave everything unchanged here.


    <Effect name="Unit Heading at Cursor 2">
    <Param name="UnitType" dispName="Center Unit" VarType="protounit">Anubite</Param>
    <Param name="ProtoUnit" dispName="Flying unit" varType="protounit">Villager</Param>
    <Param name="DstObject" dispName="Center Unit" varType="unit">default</Param>
    <Param name="qv" dispName="Name (qv)" VarType="string">Database1</Param>
    <Param name="qv2" dispName="Same var as start" VarType="string">cow</Param>
    <Param name="Max" dispName="Database size" VarType="long">10</Param>
    <Param name="EventID" dispName="Trigger" varType="event">-1</Param>
    <Command>if(type == kbGetProtoUnitID("%UnitType%")){</Command>
    <Command>if(trUnitDistanceToUnit("%DstObject%") > 0.0){</Command>
    <Command>trQuestVarSet("%qv%-%qv%-%qv%", 1*trQuestVarGet("%qv%-%qv%-%qv%")+1);</Command>
    <Command>if(1*trQuestVarGet("%qv%-%qv%-%qv%") > 1*trQuestVarGet("%qv%-%qv%"))trQuestVarSet("%qv%-%qv%-%qv%", 1);</Command>
    <Command>trQuestVarSet("%qv%-"+1*trQuestVarGet("%qv%-%qv%-%qv%"), 1*trQuestVarGet("%qv2%"));</Command>
    <Command>}</Command>
    <Command>}</Command>
    <Command>}</Command>
    <Command>trQuestVarSet("%qv2%", 1*trQuestVarGet("%qv2%")+1);}</Command>
    <Command>trQuestVarSet("%qv2%", 1*trQuestVarGet("%qv2%") - (buf + 1));</Command>
    <Command>if(1*trQuestVarGet("%qv2%") == 1*trQuestVarGet("%qv2%-%qv2%"))trQuestVarSet("%qv2%-%qv2%-%qv2%", 1);</Command>
    <Command>trQuestVarSet("%qv%-%qv%", %Max%);</Command>
    <Command>for(type = 0; > 1){}</Command>
    <Command><![CDATA[for(q = 1; <= %Max%){]]></Command>
    <Command>trQuestVarSet("%qv%",1*trQuestVarGet("%qv%-"+q));</Command>
    <Command>if(1*trQuestVarGet("%qv%") != 0){</Command>
    <Command>if(kbGetUnitBaseTypeID(kbGetBlockID(""+1*trQuestVarGet("%qv%"))) != -1){</Command>
    <Command>type = kbGetUnitBaseTypeID(kbGetBlockID(""+1*trQuestVarGet("%qv%")));</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelect(""+1*trQuestVarGet("%qv%"));</Command>
    <Command>if(type == kbGetProtoUnitID("%UnitType%")){</Command>
    <Command>if(trUnitDistanceToUnit("%DstObject%") > 0.0){</Command>
    <Command>trUnitChangeProtoUnit("%ProtoUnit%");</Command>
    <Command>type = kbGetProtoUnitID("%ProtoUnit%");</Command>
    <Command>trEventFire(%EventID%);</Command>
    <Command>}</Command>
    <Command>}</Command>
    <Command>}}}</Command>
    </Effect>

    Center Unit: is the SAME Center Unit you used before
    Flying Unit: use an UNIQUE Flying Unit like "Flying Medic (Caladria)"
    Center Unit: use the "Center Unit" on the previous Center Unit
    Leave the rest unchanged
    Trigger: use this to fire the following trigger ->
    Trigger 1
    NOT active

    Condition: Always

    Effect: Change Units in Area
    Player: p1
    From Unit: the unique flying unit (e.g. Flying Medic)
    To Unit: Cinematic Block
    Radius: 10000
    <Effect name="Unit Heading at Cursor 3">
    <Param name="DstObject" dispName="Cinematic block" VarType="unit">default</Param>
    <Param name="Dst" dispName="Radius (-1 for entire map)" VarType="float">-1</Param>
    <Param name="PlayerID" dispName="Player (99 for ALL)" VarType="string">1</Param>
    <Param name="ProtoName" dispName="Flying unit" varType="protounit">Unit</Param>
    <Param name="ClassID" dispName="Unit Type ID (optional) " varType="string">-1</Param> //With the trigger loader, you can choose unit classes such as cUnitTypeAbstractArcher
    <Param name="actionid" dispName="Action" varType="string">-1</Param>
    <Param name="unitstate" dispName="State (2 alive, 4 dead, 255 any)" varType = "string">2</Param>
    <Command>for(Qid=0;>1) {}</Command> //creating variables
    <Command>for(UnitID=0;>1) {}</Command>
    <Command>for(maxPlayer=0;>1) {}</Command>
    <Command>for(minPlayer=0;>1) {}</Command>
    <Command>for(TempORVar=0;>1) {}</Command>
    <Command>for(finalORResult=0;>1) {}</Command>
    <Command>for(unitTypeID=0;>1) {}</Command>
    <Command>for(pid=0;>1) {}</Command>
    <Command>for(oldPlayer=xsGetContextPlayer();>99) {}</Command> //saving original player context
    <Command>if(%PlayerID%==99) {</Command> //define player limits
    <Command>maxPlayer = 12;</Command>
    <Command>minPlayer = 1;</Command>
    <Command>} else {</Command>
    <Command>maxPlayer = %PlayerID%;</Command> //if a player is chosen min = max = player
    <Command>minPlayer = %PlayerID%;</Command>
    <Command>}</Command>
    <Command>if(%ClassID%==-1) {</Command>
    <Command>unitTypeID=kbGetProtoUnitID("%ProtoName%");</Command>
    <Command>} else {</Command>
    <Command>unitTypeID=%ClassID%;</Command>
    <Command>}</Command>
    <Command>for(pid1=maxPlayer;>minPlayer-1) {</Command> //loop runs either from 12 to 1, or from player id to player id.
    <Command>pid=pid1;</Command>
    <Command>xsSetContextPlayer(pid);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>Qid = kbUnitQueryCreate("tp_query_convarea_1");</Command>
    <Command>kbUnitQuerySetPlayerID(Qid, pid);</Command>
    <Command>kbUnitQuerySetUnitType(Qid,unitTypeID);</Command>
    <Command>kbUnitQuerySetState(Qid, 1*%unitstate%);</Command>
    <Command>if(¬tionid%!=-1) kbUnitQuerySetActionType(Qid, 1*¬tionid%);</Command> //define action only if you chose an action
    <Command>if(%Dst% >= 0) {</Command> //define location only if radius is positive
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelect("%DstObject%");</Command>
    <Command>if(trUnitAlive()==false) {break;}</Command>
    <Command>kbUnitQuerySetPosition(Qid, kbGetBlockPosition("%DstObject%"));</Command>
    <Command>kbUnitQuerySetMaximumDistance(Qid, %Dst%);</Command>
    <Command>}</Command>
    <Command>kbUnitQuerySetAscendingSort(Qid, true);</Command>
    <Command>for(j=kbUnitQueryExecute(Qid)-1;>-1){ </Command> //loop from number of units found by query down to zero
    <Command>trUnitSelectClear();</Command>
    <Command>UnitID = kbUnitQueryGetResult(Qid,j);</Command> //Saves the id of current unit in UnitID variable, which can be used in other effects in the same trigger.
    <Command>trUnitSelectByID(UnitID);</Command> //Selects the unit.
    <Command>if(UnitID==kbGetBlockID("%DstObject%")) {</Command> //If the unit is the same as the centre unit, skip back to the top of the loop and go to next unit.
    <Command>continue;</Command>
    <Command>}</Command>
    </Effect>

    Cinematic Block: Use this on a cinematic block.
    Flying Unit: the unique flying unit (e.g. Flying Medic)
    Leave the rest unchanged

    <Effect name="Unit Heading at Cursor 4">
    <Param name="Dst" dispName="Radius" VarType="string">-1</Param>
    <Param name="PlayerID" dispName="Player (99 for ALL)" VarType="string">1</Param>
    <Param name="ProtoName" dispName="Your unit" varType="protounit">Unit</Param>
    <Param name="ClassID" dispName="Unit Type ID (optional) " varType="string">-1</Param> //With the trigger loader, you can choose unit classes such as cUnitTypeAbstractArcher
    <Param name="actionid" dispName="Action" varType="string">-1</Param>
    <Param name="unitstate" dispName="State (2 alive, 4 dead, 255 any)" varType = "string">2</Param>
    <Param name="Shift" dispName="Angle Offset" varType="string">0</Param>
    <Command>for(Qid2=0;>1) {}</Command> //creating variables
    <Command>for(UnitIDold=0;>1) {}</Command>
    <Command>for(pidold=0;>1) {}</Command>
    <Command>for(maxPlayer2=0;>1) {}</Command>
    <Command>for(minPlayer2=0;>1) {}</Command>
    <Command>for(unitTypeID2=0;>1) {}</Command>
    <Command>for(oldPlayer2=xsGetContextPlayer();>99) {}</Command> //saving original player context
    <Command>UnitIDold = UnitID;</Command> //Save old Unit ID in order to revert it back at the end
    <Command>pidold = pid;</Command>
    <Command>if(%PlayerID%==99) {</Command> //define player limits
    <Command>maxPlayer2 = 12;</Command>
    <Command>minPlayer2 = 1;</Command>
    <Command>} else {</Command>
    <Command>maxPlayer2 = %PlayerID%;</Command> //if a player is chosen min = max = player
    <Command>minPlayer2 = %PlayerID%;</Command>
    <Command>}</Command>
    <Command>if(%ClassID%==-1) {</Command>
    <Command>unitTypeID2=kbGetProtoUnitID("%ProtoName%");</Command>
    <Command>} else {</Command>
    <Command>unitTypeID2=%ClassID%;</Command>
    <Command>}</Command>
    <Command>for(pid2=maxPlayer2;>minPlayer2-1) {</Command> //loop runs either from 12 to 1, or from player id to player id.
    <Command>pid=pid2;</Command>
    <Command>xsSetContextPlayer(pid);</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>Qid2 = kbUnitQueryCreate("tp_query_convarea_2");</Command>
    <Command>kbUnitQuerySetPlayerID(Qid2, pid);</Command>
    <Command>kbUnitQuerySetUnitType(Qid2,unitTypeID2);</Command>
    <Command>kbUnitQuerySetState(Qid2, 1*%unitstate%);</Command>
    <Command>if(¬tionid%!=-1) kbUnitQuerySetActionType(Qid2, 1*¬tionid%);</Command> //define action only if you chose an action
    <Command>kbUnitQuerySetPosition(Qid2, kbUnitGetPosition(UnitIDold));</Command>
    <Command>kbUnitQuerySetMaximumDistance(Qid2, %Dst%);</Command>
    <Command>kbUnitQuerySetAscendingSort(Qid2, true);</Command>
    <Command>for(j2=kbUnitQueryExecute(Qid2)-1;>-1){ </Command> //loop from number of units found by query down to zero
    <Command>trUnitSelectClear();</Command>
    <Command>UnitID = kbUnitQueryGetResult(Qid2,j2);</Command> //Saves the id of current unit in UnitID variable, which can be used in other effects in the same trigger.
    <Command>trUnitSelectByID(UnitID);</Command> //Selects the unit.
    <Command>trUnitSetHeading(%Shift%+Math_atan2(xsVectorGetX(kbUnitGetPosition(UnitIDold))-xsVectorGetX(kbUnitGetPosition(UnitID)),xsVectorGetZ(kbUnitGetPosition(UnitIDold))-xsVectorGetZ(kbUnitGetPosition(UnitID)))*180.0/PI);</Command>
    <Command>}}</Command>
    <Command>UnitID = UnitIDold;</Command>//Return UnitID to orginal value
    <Command>pid = pidold;</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(UnitID);</Command>//Reselect original unit
    <Command>xsSetContextPlayer(oldPlayer2);</Command>//Restore player context to original player
    <Command>}}</Command>
    <Command>xsSetContextPlayer(oldPlayer);</Command>
    </Effect>

    Your Unit: The unit you're controlling (e.g. Arkantos)
    Angle Offset: Self-explanatory

    5. The last trigger is where it is all about. Put this trigger on Active and Loop.

    <Effect name="Unit Heading at Cursor SETUP 2">
    <Param name="PlayerID" dispName="$$22301$$Player" VarType="player">0</Param>
    <Param name="unit" dispName="Hero Unit" varType="string">unit</Param>
    <Param name="unit2" dispName="Transformable Unit" varType="string">unit</Param>
    <Param name="SrcObject" dispName="Transformable Unit" varType="unit">default</Param>
    <Param name="GroupID" dispName="Center Unit Group" varType="long">1</Param>
    <Param name="GroupID2" dispName="Your Unit" varType="long">3</Param>
    <Command>if(trPlayerUnitCountSpecific(%PlayerID%, "%unit%") == 1){</Command>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>trUnitChangeProtoUnit("%unit2%");</Command>
    <Command>uiClearSelection();</Command>
    <Command>uiAddSelectNumberGroup(%GroupID%);</Command>
    <Command>uiCopyToClipboard();</Command>
    <Command>uiPasteFromClipboard();</Command>
    <Command>uiClearSelection();</Command>
    <Command>uiAddSelectNumberGroup(%GroupID2%);</Command>
    <Command>}</Command>
    </Effect>

    PlayerID: 1
    Hero Unit: Atlantean Hero (e.g. maceman hero)
    Transformable unit: Atlantean military unit (e.g. maceman)
    Transformable unit: Use this on the same unit -> the maceman
    Center unit group: The group of FIRST center unit -> group 1
    Your unit group: The group of your unit -> group 3

    6. Make another trigger to reduce the cost of the maceman hero to zero.

    THAT'S IT!!!



    Trigger Setup example

    Trigger 1
    Active
    Condition: Always

    Effect: Activate Trigger Loader


    Trigger 2
    Active
    Condition: Always

    Effect: XS User Code (map("1","game","uiSelectNumberGroup(2) uiTransformSelectedUnit(\"Maceman Hero\")"); )


    Trigger 3
    Active
    Condition: Always

    Effect: Unit Heading at Cursor SETUP 1
    Center unit: roc
    Transformable unit: maceman
    Your unit: arkantos
    Center unit group: 1
    T unit group: 2
    Your unit group: 3


    Trigger 4
    Active, Loop
    Condition: Always

    Effect: Unit Heading at Cursor 1
    Leave everything unchanged

    Effect: Unit Heading at Cursor 2
    Center unit: roc
    Flying unit: flying medic
    Center unit: roc
    Database name: Database1
    QV: cow
    Trigger: Trigger 5

    Effect: Unit Heading at Cursor 3
    Cinematic block: use it on a cinematic block
    Radius: -1
    Player: 1
    Flying Unit: flying medic

    Effect: Unit Heading at Cursor 4
    Radius: -1
    Player: 1
    Your unit: arkantos
    Angle Offset: 0


    Trigger 5
    NOT active
    Condition: Always

    Effect: Change units in area
    Player: 1
    From unit: flying medic
    To unit: cinematic block
    Radius: 10000


    Trigger 6
    Active, Loop
    Condition: Always

    Effect: Unit Heading at Cursor SETUP 2
    Player: 1
    Hero unit: maceman hero
    Transformable unit: maceman
    Transformable unit: use it on maceman
    Center unit group: 1
    Your unit group: 3


    Trigger 7
    Active
    Condition: Modify Protounit
    Player: 1
    Unit: maceman hero
    Cost Food: -110
    Cost Gold: -65
    Cost Favor: -3

    What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
    Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
    Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]
  • Lewonas
    Mortal
    posted 23 May 2011 02:14 PM EDT (US)     549 / 1672       
    I forgot to mention that you have to press "1" in-game when you want the unit to change its heading towards the cursor.

    edit: You can actually do pretty cool things with this, like: press "1" in-game to cast a firebal at the cursor's location / aim with a catapult by moving your cursor across the screen and press "1" to fire the catapult / etc.

    edit2: Perhaps... I will make a cursor trigger pack... it sounds fun... but are they useful?

    What are the key ingredients to make a popular RPG? To find out, read the results of the RPG survey.
    Want to create an advanced patrol/pathfinding system? Have a look at the powerful Pathfinding triggers.
    Games I'm playing: The Witness [80%] Chivalry: Medieval Warfare [20%]

    [This message has been edited by Lewonas (edited 05-23-2011 @ 02:27 PM).]

    WinstonShnozwick
    Mortal
    posted 23 May 2011 06:33 PM EDT (US)     550 / 1672       
    This is excellent Lewonas.

    Idea; Make triggered custom god powers with this? Since you can make effects happen at the cursor?

    Tired of unorigional, boring campaigns? Try out DEMO|Legacy - The Uprising|DEMO
    Completely New Gameplay. Random Map Type Replayability. Delve into Nomadican|FEATURES|DOWNLOAD|
    Want to know how to use triggers and/or create amazing factors in your scenarios? You need Combination Effects|FEATURES|DOWNLOAD|
    Automaton Metals Textures, New Custom Triggers
    Upcoming Projects: Legacy - The Uprising, Destiny
    6/12/1997, a day that will live in infamy.
    « Previous Page  1 ··· 10 ··· 20 21 22 23 24 ··· 30 ··· 40 ··· 50 ··· 60 ··· 67  Next Page »
    You must be logged in to post messages.
    Please login or register

    Hop to:    

    Age of Mythology Heaven | HeavenGames