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

Scenario Design
Moderated by Yeebaagooon, TAG, nottud

Hop to:    
Welcome! You are not logged in. Please Login or Register.1680 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 ··· 30 ··· 40 ··· 50 ··· 60 61 62 63 64 ··· 68  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:
    Izalith
    Mortal
    (id: Lilitu)
    posted 26 April 2017 08:54 AM EDT (US)     1526 / 1680       
    IF the fade_to_color_for_player works like explained here and fades the color for the player specified only:
    http://aom.heavengames.com/cgi-bin/forums/display.cgi?action=st&fn=13&tn=29839&st=53#post54

    Then your request might be just as easily done.

    I dont know if it's OOS-safe in multiplayer. (Or works at all without testing)


    <Condition name="Unit Selected by Player">
    <Param name="Obj" dispName="$$22295$$Source Units" VarType="unit">default</Param>
    <Param name="Player" dispName="Player" varType="player">1</Param>
    <Command>for(criterion=0;>1){}</Command>
    <Command>if (trCurrentPlayer() == %Player%){</Command>
    <Command>if(trUnitIsSelected() == %Obj%) criterion = 1;</Command>
    <Command>}</Command>
    <Expression>criterion == 1</Expression>
    </Condition>

    Azarath Metrion Zinthos

    Steam: Order of Azarath
    Twitch: twitch.tv/orderofazarath
    Discord: Azarath @ https://discord.gg/3ENKJeb

    [This message has been edited by Izalith (edited 04-26-2017 @ 08:56 AM).]

    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 26 April 2017 11:12 AM EDT (US)     1527 / 1680       
    Do you think that because fade to color for player works (I've tested) your trigger will work ?

    Thank you for the post I'm trying. It 's just to safe some processor in a scÚnario

    OH NO you didn't understand what I wanted to say :-d
    I wanted to make a condition that applies for ALL UNITS of a player.
    Maybe I can give a better name:
    name- "Player unit selected by player"

    In my scenarion I can't use triggers that apply at one designed unit because it's not an adventure

    [This message has been edited by eine_gurkensalad (edited 04-26-2017 @ 11:45 AM).]

    Izalith
    Mortal
    (id: Lilitu)
    posted 26 April 2017 12:04 PM EDT (US)     1528 / 1680       
    My bad, my bad.

    So that's fitting your description:

    <Condition name="Players Unit Selected by Player">
    <Param name="Owner" dispName="Owning Player" varType="player">1</Param>
    <Param name="Selector" dispName="Selecting Player" varType="player">1</Param>
    <Command>for(criterion=0;>1){}</Command>
    <Command>if (trCurrentPlayer() == %Selector%){</Command>
    <Command>if(trUnitIsOwnedBy(%Owner%)) criterion = 1;</Command>
    <Command>}</Command>
    <Expression>criterion == 1</Expression>
    </Condition>


    I love that currentplayer-thing.

    Azarath Metrion Zinthos

    Steam: Order of Azarath
    Twitch: twitch.tv/orderofazarath
    Discord: Azarath @ https://discord.gg/3ENKJeb

    [This message has been edited by Izalith (edited 04-26-2017 @ 12:58 PM).]

    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 26 April 2017 02:03 PM EDT (US)     1529 / 1680       
    It looks better I'll test it in a few minutes

    SORRY man but it doesn't work at all.
    I've tried "owner player=2" and "selecting player=1" with hippikon and in effect "send message to player" to test...
    It do nothing, even with different parameters, but NO TRIGGER BLOCK .

    I hope you will be successful

    [This message has been edited by eine_gurkensalad (edited 04-26-2017 @ 02:31 PM).]

    scragins
    Heretic of December
    posted 26 April 2017 07:19 PM EDT (US)     1530 / 1680       
    TrUnitIsOwneBy requires a unit to be selected with trUnitSelect, so what you have written will not do anything (or possibly something depending on the last trigger that was used).

    I think the condition that detects if a unit is selected is very likely to cause OOS. It depends upon the effects. Pretty much the only effects that can be used with the condition are camera cut, sound file name, fade to colour, send chat and flash gadget (I'm not sure about the last one).
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 26 April 2017 07:55 PM EDT (US)     1531 / 1680       
    do you mean that a OoS can be the result of two "safe" triggers ?
    I will be clear: what I want is just to have in my scenario a trigger that have in terms of conditions : QV check conditions (done), Unit selected by type (done) AND Unit from player selected (that's my question)

    So basically I just want to launch the effect only if the player one have selected a protounit (priest) from the player one

    The effect is just a QV modify and a fire event

    I've tried the "protounit selected" (it contains player and protounit) but it doesn't work for me.

    If it is impossible, I can find other way with v-TPQ that support this feature but it will be slower...
    scragins
    Heretic of December
    posted 26 April 2017 09:01 PM EDT (US)     1532 / 1680       
    I would classify the condition "unit selected" as a single player condition. The only effects that work with a 'single player' condition in multiplayer without causing OOS are the ones I mentioned earlier.

    I'm don't know of a way to do what you want done.
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 27 April 2017 03:33 AM EDT (US)     1533 / 1680       
    V tpq works online because he has specified some "sp" and the other are safe.
    So I can do this trigger :
    Condition : unit type selected (priest)
    Effect : v-tpq (the whole map, player 1,priest, alive)
    V condition unit selected by player 1
    Fire event (rest of the triggering)
    V condition zend
    V 2 tpq

    It is a simplified version because in reality there is some qv check and set but that is not a problem.
    When I think this isn't too bad but the problem is that this trigger is on loop (with some brakes).
    Izalith
    Mortal
    (id: Lilitu)
    posted 28 April 2017 09:08 AM EDT (US)     1534 / 1680       
    camera cut, sound file name, fade to colour, send chat and flash gadget (I'm not sure about the last one).
    Can you (oos-safely) do all that for just one player with asking trCurrentPlayer() ?

    Azarath Metrion Zinthos

    Steam: Order of Azarath
    Twitch: twitch.tv/orderofazarath
    Discord: Azarath @ https://discord.gg/3ENKJeb
    Ghostoo
    Mortal
    posted 29 April 2017 12:47 PM EDT (US)     1535 / 1680       
    Yes. Anything that is purely visual is safe to combine with the trCurrentPlayer() condition.

    Voolohmay? Kahlos.
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 29 April 2017 03:58 PM EDT (US)     1536 / 1680       
    name: v invoke god power on targeted unit
    description: it's just like "v invoke god power" but on the targeted unit (not on an area).
    Of course it has to work only with powers that apply in one click, one location ore one unit and no restriction
    TAG
    That AoM Guy
    (id: aom expert)
    posted 10 May 2017 09:11 AM EDT (US)     1537 / 1680       
    where did you find v invoke god power on targeted unit?

    Check out my YouTube
    For live help with me, enter this chatroom. If I'm not on you can leave a message.
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 10 May 2017 02:13 PM EDT (US)     1538 / 1680       
    This is my request ^^
    Actually I don't know the use of the v invoke god power which is the same as invoke god power.
    Nickonhawk
    The Narrator
    posted 10 May 2017 02:20 PM EDT (US)     1539 / 1680       
    The target for v Invoke God Power is the unit you are searching for. Set area I think is for powers that need a second target like passage or sands.

    Youtube Channel
    Skyrim... the greatest game ever... without considering Age of Mythology, of course!
    Ctrl...Alt...Q...
    and Brisingr-know these three things and your task here is accomplished...
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 10 May 2017 02:54 PM EDT (US)     1540 / 1680       
    Hum i've tried and it didn't work. I will retry at friday afternoon
    Nickonhawk
    The Narrator
    posted 10 May 2017 04:54 PM EDT (US)     1541 / 1680       
    Make sure the player has line of sight. You don't have to grant the power.

    Youtube Channel
    Skyrim... the greatest game ever... without considering Age of Mythology, of course!
    Ctrl...Alt...Q...
    and Brisingr-know these three things and your task here is accomplished...
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 12 May 2017 10:26 AM EDT (US)     1542 / 1680       
    I may ask something already done but is it possible to modify tech cost ?

    +NHawk it works very well, maybe I used a god power which don't work

    [This message has been edited by eine_gurkensalad (edited 06-11-2017 @ 07:19 PM).]

    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 06 June 2017 05:04 PM EDT (US)     1543 / 1680       
    name- Army damage units in area (opt. player range)
    description- Damage all unit around all unit of an army for player mentionned (opt. player range)
    I've seen something similar in "unfinished" section but there wasn't any comment

    [This message has been edited by eine_gurkensalad (edited 06-11-2017 @ 07:21 PM).]

    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 08 June 2017 02:11 PM EDT (US)     1544 / 1680       
    name- "v condition - is army" (with v target protounit query)
    description- Is true if the targeted unit by v tpq is member of the specified army.
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 11 June 2017 07:05 PM EDT (US)     1545 / 1680       
    Condition:
    name- Tech is status
    description- This is true if the tech mentionned is status mentionned (this like a conditionnal "set tech status")
    TAG
    That AoM Guy
    (id: aom expert)
    posted 12 June 2017 09:34 AM EDT (US)     1546 / 1680       
    Unfortunately I don't think we have anybody who are willing to make triggers at this point.

    Check out my YouTube
    For live help with me, enter this chatroom. If I'm not on you can leave a message.
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 12 June 2017 11:54 AM EDT (US)     1547 / 1680       
    You mean now ? Now nobody want to create new triggers ?
    TAG
    That AoM Guy
    (id: aom expert)
    posted 12 June 2017 02:40 PM EDT (US)     1548 / 1680       
    Yes

    Check out my YouTube
    For live help with me, enter this chatroom. If I'm not on you can leave a message.
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 12 June 2017 04:14 PM EDT (US)     1549 / 1680       
    So the only way for me is to learn Trigger scripting !
    Lewonas
    Mortal
    posted 13 June 2017 09:08 AM EDT (US)     1550 / 1680       
    It's unfortunate nobody could help you out with your trigger requests. I don't post here as regularly anymore as I used to, but I still keep checking the forums for new requests every once in a while.

    Your three trigger requests:

    <Effect name="Damage units near ANY army unit">
    <Param name="SrcArmy" dispName="Source Army" VarType="group">default</Param>
    <Param name="PlayerL" dispName="Lowest Player" VarType="string">1</Param>
    <Param name="PlayerH" dispName="Highest Player" VarType="string">12</Param>
    <Param name="Unit" dispName="Unit" varType="string">Unit</Param>
    <Param name="Radius" dispName="Radius" varType="string">10</Param>
    <Param name="Dmg" dispName="Damage" varType="string">50</Param>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>kbLookAtAllUnitsOnMap();</Command>
    <Command>for(armyID=0;>1){}</Command>
    <Command>for(unitsInArmy=0;>1){}</Command>
    <Command>for(unitID=0;>1){}</Command>
    <Command>armyID = xsVectorGetY(vector(%SrcArmy%,0));</Command>
    <Command>unitsInArmy=kbArmyGetNumberUnits(armyID);</Command>
    <Command>for(cUnitIndex=unitsInArmy-1;>=0) {</Command>
    <Command>unitID=kbArmyGetUnitID(armyID, cUnitIndex);</Command>
    <Command>trUnitSelectByID(unitID);</Command>
    <Command>for(playerID=%PlayerH%;>=%PlayerL%) trDamageUnitsInArea(playerID,"%Unit%",%Radius%,%Dmg%);</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>}</Command>
    </Effect>

    <Effect name="v Condition - Unit is in Army">
    <Param name="SrcArmy" dispName="Source Army" VarType="group">default</Param>
    <Command>xsSetContextPlayer(xsVectorGetX(vector(%SrcArmy%,0)));</Command>
    <Command>for(armyID=0;>1){}</Command>
    <Command>for(unitsInArmy=0;>1){}</Command>
    <Command>for(tUnitID=0;>1){}</Command>
    <Command>for(criterion=0;>1){}</Command>
    <Command>armyID = xsVectorGetY(vector(%SrcArmy%,0));</Command>
    <Command>unitsInArmy=kbArmyGetNumberUnits(armyID);</Command>
    <Command>for(cUnitIndex=unitsInArmy-1;>=0) {</Command>
    <Command>tUnitID=kbArmyGetUnitID(armyID, cUnitIndex);</Command>
    <Command>if(tUnitID==UnitID){criterion=1;break;}</Command>
    <Command>}</Command>
    <Command>if(criterion==1){</Command>
    </Effect>

    <Condition name="Tech is Status">
    <Param name="PlayerID" dispName="Player" VarType="string">0</Param>
    <Param name="TechID" dispName="Tech" VarType="tech">0</Param>
    <Param name="Status" dispName="Status" varType="techstatus">4</Param>
    <Command>xsSetContextPlayer(%PlayerID%);</Command>
    <Expression>kbGetTechStatus(%TechID%) == %Status%</Expression>
    </Condition>
    I may ask something already done but is it possible to modify tech cost ?
    It's not possible to modify the tech cost directly with a trigger. But what you could do is create a "loan" system. This is how it would work:

    Let's say you want to modify the Copper Weapons tech's cost by +100 gold:

    1. The player pays the normal cost for this tech to research it as usual.
    2. Once the tech is fully researched and "active" for this player, a quest var called "playerX_loan_gold" (where X is the player ID) is modified by +100.
    3. A trigger checks if the player has a loan he needs to pay off and keeps removing the resources until the loan has been fully paid off:

    Trigger name: Player1_Pay_Off_Gold_Loan
    Active [X] Loop [ ] Run Immediately [ ]
    @HIGH Priority

    Condition: Quest Var Check
    Var name: player1_loan_gold
    Operator: >
    Value: 0

    Condition: Player Resource Count
    Player: 1
    Resource: Gold
    Operator: >
    Number: 0

    Effect: Grant Resources
    Player: 1
    Resource: Gold
    Amount: -1

    Effect: Quest Var Modify
    Var name: player1_loan_gold
    Operator: -
    Value: 1

    Effect: Fire Event
    Trigger: Player1_Pay_Off_Gold_Loan_


    Trigger name: Player1_Pay_Off_Gold_Loan_
    Active [ ] Loop [ ] Run Immediately [ ]
    @HIGH Priority

    This trigger has similar conditions and effects. Make sure to change the Trigger parameter in the Fire Event effect to the other trigger.

    One of the downsides of this loan system is that the modified costs aren't visible to the player (the UI would still show the usual tech cost). What you could do is: whenever a player selects e.g. an Armory building, send chat messages to this player that list all the modified Armory tech costs.


    Another way to modify the tech cost is to check if the player is researching a tech, and then check if the player has the additional required resources for this tech. Let's say the player is researching the Copper Weapons tech that costs 100 additional gold (so 200 food and 300 gold). If the player doesn't have more than 100 gold after he clicked the tech, change all the Armory buildings to new Armory buildings (change unit type effect) cancel this tech research process in all the Armory buildings. This will reset the tech research process and refund the tech's cost to the player.

    One of the downsides of this method is that changing the buildings might reset other tech research processes that shouldn't have been reset. This method also shares the same downside as the previous one.

    So basically, there isn't a very good reliable way to modify the tech cost. So maybe it's for the best not to do this at all. But if you really want it, then I would go with the first method I posted because the downsides of the second method are considerably worse.

    EDIT: Oh wait, the armory buildings don't have to change for the second method. I've found a function that could cancel a tech research process in a building: researchCancelByID(int techID, int unitID, int playerID). So the second method is definitely the way to go if you really want this.

    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 06-13-2017 @ 09:58 AM).]

    « Previous Page  1 ··· 10 ··· 20 ··· 30 ··· 40 ··· 50 ··· 60 61 62 63 64 ··· 68  Next Page »
    You must be logged in to post messages.
    Please login or register

    Hop to:    

    Age of Mythology Heaven | HeavenGames