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

Scenario Design
Moderated by Yeebaagooon, nottud

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: Have a Trigger Request? Post it here!
« Previous Page  1 ··· 10 ··· 20 ··· 30 ··· 40 ··· 50 ··· 60 ··· 70 ··· 80 ··· 90 ··· 95 96 97 98 99 ··· 101  Next Page »
posted 01 February 2009 11:53 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

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak

    [This message has been edited by Mythic_Freak (edited 01-16-2010 @ 08:01 AM).]

    Replies:
    posted 28 June 2010 00:39 AM EDT (US)     2401 / 2506  
    It's in post 2352. still on this page in fact! I figured it was farther back. Use that to set the qv string, and then put trStringQuestVarGet("qv string name") in your change name effect.
    Hehe, for the QV Vector triggers, Tl required, what does the round param do? and for qv vector modify, its like this,
    Rounds the values to the nearest integer. Actually, it probably just truncates it, so it rounds down to the lower integer.
    Im not sure what it is supposed to do. I just want a qv vector modify where like qv vector set, I can pick another point on the map, and it changes the qv vector to that point.
    Maybe you mean "Quest Var Vector Set"
    Also stuff like Unit Position to QV Vector, and Army Position to QV Vector, if you want to use a unit location instead of just clicking on the map.
    And also, what can the qv vectors store? Can they have more than one point?
    A QV vector is 3 numbers, which can represent 1 location on a map (x,y,z). If you want 2 points, you need 2 QV vectors.
    What does qv vector modify two do, by adding the vector of another to it?
    If your QV Vector is (50,0,25), and you add (10,10,10) to it, it will be (60,10,35) which is a new location (northeast, and up from previous point).

    If you haven't rotated the camera, X is along the bottom edge towards the right side. Z is along the bottom edge towards the left side. Y is up. (0,0,0) is the bottom corner. I think. Unless I got X and Z mixed up, but I think that's right.
    What would qqv vector echo show in the chats?
    3 numbers, like this: (-1,-1,1).
    FOr quest strings, if I want to basically modify the quest string, changing the text in it ot something else, could I just use quest string set with the same name and different text to accomplish that?
    Quest string Set will just replace the whole thing, like Quest Var Set. You can use Quest String Add suffix or Add prefix to change it by tagging things on the beginning and the end, if you want.

    For the Units in UDA w units instead of points, i can probably do that (and finish the circle one) later, but haven't done them yet.
    posted 28 June 2010 10:42 AM EDT (US)     2402 / 2506  
    @ Winston
    I posted these in Thymole's Star Ship Ultra thread.
       <Effect name="Unit Patrol">
    <Param name="PatrolID" dispName="Patrol ID" varType="string">P1</Param>
    <Param name="SrcObject" dispName="Units" VarType="unit">default</Param>
    <Param name="DstPoint1" dispName="$$22410$$X" varType="area">0</Param>
    <Param name="DstPoint2" dispName="$$22410$$X" varType="area">0</Param>
    <Param name="DstPoint3" dispName="$$22410$$X" varType="area">0</Param>
    <Param name="DstPoint4" dispName="$$22410$$X" varType="area">0</Param>
    <Param name="AttackMove" dispName="$$18986$$Attack Move" varType="bool">false</Param>
    <Command>trUnitSelectClear();</Command>
    <Command loop="" loopParm="SrcObject">trUnitSelect("%SrcObject%");</Command>
    <Command>if (trQuestVarGet("UnitPatrol%PatrolID%") == 0) {</Command>
    <Command>trUnitMoveToPoint(%DstPoint1%, -1, %AttackMove%);</Command>
    <Command>if (1 > trUnitDistanceToPoint(%DstPoint1%)) {</Command>
    <Command>trQuestVarSet("UnitPatrol%PatrolID%", 1);</Command>
    <Command>}</Command>
    <Command>}</Command>
    <Command>if (trQuestVarGet("UnitPatrol%PatrolID%") == 1) {</Command>
    <Command>trUnitMoveToPoint(%DstPoint2%, -1, %AttackMove%);</Command>
    <Command>if (1 > trUnitDistanceToPoint(%DstPoint2%)) {</Command>
    <Command>trQuestVarSet("UnitPatrol%PatrolID%", 2);</Command>
    <Command>}</Command>
    <Command>}</Command>
    <Command>if (trQuestVarGet("UnitPatrol%PatrolID%") == 2) {</Command>
    <Command>trUnitMoveToPoint(%DstPoint3%, -1, %AttackMove%);</Command>
    <Command>if (1 > trUnitDistanceToPoint(%DstPoint3%)) {</Command>
    <Command>trQuestVarSet("UnitPatrol%PatrolID%", 3);</Command>
    <Command>}</Command>
    <Command>}</Command>
    <Command>if (trQuestVarGet("UnitPatrol%PatrolID%") == 3) {</Command>
    <Command>trUnitMoveToPoint(%DstPoint4%, -1, %AttackMove%);</Command>
    <Command>if (1 > trUnitDistanceToPoint(%DstPoint4%)) {</Command>
    <Command>trQuestVarSet("UnitPatrol%PatrolID%", 0);</Command>
    <Command>}</Command>
    <Command>}</Command>
    </Effect>

    <Effect name="Army Patrol">
    <Param name="PatrolID" dispName="Patrol ID" varType="string">P1</Param>
    <Param name="SrcArmy" dispName="Army" VarType="group">0,0</Param>
    <Param name="DstPoint1" dispName="$$22410$$X" varType="area">0</Param>
    <Param name="DstPoint2" dispName="$$22410$$X" varType="area">0</Param>
    <Param name="DstPoint3" dispName="$$22410$$X" varType="area">0</Param>
    <Param name="DstPoint4" dispName="$$22410$$X" varType="area">0</Param>
    <Param name="AttackMove" dispName="$$18986$$Attack Move" varType="bool">false</Param>
    <Command>trUnitSelectClear();</Command>
    <Command>trArmySelect("%SrcArmy%");</Command>
    <Command>if (trQuestVarGet("ArmyPatrol%PatrolID%") == 0) {</Command>
    <Command>trUnitMoveToPoint(%DstPoint1%, -1, %AttackMove%);</Command>
    <Command>if (3 > trUnitDistanceToPoint(%DstPoint1%)) {</Command>
    <Command>trQuestVarSet("ArmyPatrol%PatrolID%", 1);</Command>
    <Command>}</Command>
    <Command>}</Command>
    <Command>if (trQuestVarGet("ArmyPatrol%PatrolID%") == 1) {</Command>
    <Command>trUnitMoveToPoint(%DstPoint2%, -1, %AttackMove%);</Command>
    <Command>if (3 > trUnitDistanceToPoint(%DstPoint2%)) {</Command>
    <Command>trQuestVarSet("ArmyPatrol%PatrolID%", 2);</Command>
    <Command>}</Command>
    <Command>}</Command>
    <Command>if (trQuestVarGet("ArmyPatrol%PatrolID%") == 2) {</Command>
    <Command>trUnitMoveToPoint(%DstPoint3%, -1, %AttackMove%);</Command>
    <Command>if (3 > trUnitDistanceToPoint(%DstPoint3%)) {</Command>
    <Command>trQuestVarSet("ArmyPatrol%PatrolID%", 3);</Command>
    <Command>}</Command>
    <Command>}</Command>
    <Command>if (trQuestVarGet("ArmyPatrol%PatrolID%") == 3) {</Command>
    <Command>trUnitMoveToPoint(%DstPoint4%, -1, %AttackMove%);</Command>
    <Command>if (3 > trUnitDistanceToPoint(%DstPoint4%)) {</Command>
    <Command>trQuestVarSet("ArmyPatrol%PatrolID%", 0);</Command>
    <Command>}</Command>
    <Command>}</Command>
    </Effect>

    Remember to put them on loop and change the condition from Always to Timer seconds = 1

    This is from invent00r's proactive triggers pack

    <Condition name="Units in User Defined Area">
    <Param name="Obj" dispName="$$22295$$Source Units" VarType="unit">default</Param>
    <Param name="Location" dispName="" varType="area">0,0,0</Param>
    <Param name="Location2" dispName="" varType="area">0,0,0</Param>
    <Param name="Op" dispName="$$22297$$Operator" VarType="operator">==</Param>
    <Param name="Count" dispName="$$22304$$Count" VarType="float">1</Param>
    <Command>for(result=0;>1){} for(q=0;>1){} for(w=0;>1){} for(a=0;>1){} for(s=0;>1){}</Command>
    <Command>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 loop="" loopParm="Obj">x=xsVectorGetX(kbGetBlockPosition("%Obj%"));y=xsVectorGetZ(kbGetBlockPosition("%Obj%"));if(((w>=y)!=true||(y>=s)!=true||(x>=q)!=true||(a>=x)!=true)!=true){result++;}</Command>
    <Expression>result %Op% %Count%</Expression>
    </Condition>
    posted 28 June 2010 03:35 PM EDT (US)     2403 / 2506  
    Thanks for the answers hail, and the trigger, perp. Yeah I would like to have cinematic blocks for the UDA condition, would be better for my needs. But in that condition, I dont get, what are these for?

    <Param name="Op" dispName="$$22297$$Operator" VarType="operator">==</Param>
    <Param name="Count" dispName="$$22304$$Count" VarType="float">1</Param>

    Wouldn't I just need the units, the defined area, then if that shows as true the effects would fire? I dont know what those last two parameters mean.

    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.
    posted 28 June 2010 03:41 PM EDT (US)     2404 / 2506  
    If you select multiple source units, it counts how many are in the area, and compares it to Count using the Operator of your choice.

    If you're only using 1 unit just leave it at >= 1
    posted 28 June 2010 03:53 PM EDT (US)     2405 / 2506  
    oh so kinda like using the OR/AND buttons with multiple conditions, cept it narrowed it down into one trigger?

    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.
    posted 28 June 2010 04:52 PM EDT (US)     2406 / 2506  
    Hey guys, can someone please post the trigger where you can change a units name by whatever 'player one' for example typed in.
    Your prompted to choose a name for your character
    You type 'john'
    Your units name changes to 'john'.
    I could not find it.

    Currently Designing Elder Scrolls Project (ESP) 12% Complete
    1000+ character combinations,Vast Open World Environments,Twisting Story,All on the AOM engine.
    Release date is unknown.Small breaks are being taken to prevent loss of interest due to overwhelming designing.
    posted 28 June 2010 05:06 PM EDT (US)     2407 / 2506  
    @ DaedricSparta

    Here's the effect you're after.

    <Effect name="QV String Set From Player Chat">
    <Param name="PlayerID" dispName="$$22301$$Player" VarType="string">1</Param>
    <Param name="S1" dispName="Var Name" VarType="string">S1</Param>
    <Param name="tag" dispName="Chat tag" varType="string">name </Param>
    <Param name="length" dispName="Length of string" VarType="long">5</Param>
    <Command>string alphabet = "abcdefghijklmnopqrstuvwxyz1234567890 ";</Command>
    <Command>trStringQuestVarSet("%S1%","");</Command>
    <Command><![CDATA[for(n=1; <= %length%) {]]></Command>
    <Command><![CDATA[for(i=1; <= 26) {]]></Command>
    <Command>if(trChatHistoryContains("%tag%"+ trStringQuestVarGet("%S1%") +""+ String_charAt(alphabet,i), %PlayerID%)) {</Command>
    <Command>trStringQuestVarSet("%S1%", ""+trStringQuestVarGet("%S1%") +""+ String_charAt(alphabet,i));}</Command>
    <Command>}</Command>
    <Command>}</Command>
    </Effect>

    Be aware that you need to use the Trigger Loader for this to work. Also, this doesn't actually change a unit's name, it saves what's typed in chat after the tag to a QV string. You can then use the QV string in the Change Name effect by putting in "+trStringQuestVarGet("QVStringName")+" into the name field.
    posted 28 June 2010 10:21 PM EDT (US)     2408 / 2506  
    @ n00b
    excuse my noobishness, but trigger loader?
    And would it be better just to have the player select from a group of names?

    Currently Designing Elder Scrolls Project (ESP) 12% Complete
    1000+ character combinations,Vast Open World Environments,Twisting Story,All on the AOM engine.
    Release date is unknown.Small breaks are being taken to prevent loss of interest due to overwhelming designing.
    posted 28 June 2010 10:25 PM EDT (US)     2409 / 2506  
    Daedric, tthe trigger loader is a huge genius invention by Mythic freak and Inventoor, loaded with custom functions to make all new lines of different triggers possible. The link to downlaod it is in the main post. And you can have it select players from the drop down list, but the list only has 0 - 10 normally, and having a float or string parameter allows you to select players 11 and 12

    edit: Does this do what I think it does? How would I cause it to work.
    uiIncreaseTextureDensity(int keyState)

    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.

    [This message has been edited by WinstonShnozwick (edited 06-29-2010 @ 08:40 PM).]

    posted 30 June 2010 04:47 PM EDT (US)     2410 / 2506  

    uiIncreaseTextureDensity
    public void uiIncreaseTextureDensity(int keyState)
    Indicates that the increase texture density button has gone up/down.

    I never tried it, but generally uiIncreaseTextureDensity(1) should make it start increasing the density of the selected unit, and uiIncreaseTextureDensity(0) should stop increasing it. If it still works (looks like a beta'ish funcion to me) it'd probably only do so in editor mode.

    If we knew what it was we were doing, it would not be called research, would it? - Einstein, A.
    Master XS - AoM Code Reference - Trigger Loader - Trigger Requests - Chess

    Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
    posted 01 July 2010 02:21 AM EDT (US)     2411 / 2506  
    Yea I think the function no longer works now...

    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.
    posted 02 July 2010 03:14 AM EDT (US)     2412 / 2506  
    It doesn't work why? I can get resource triggers to do positive, but never negative by themselves.

    <Effect name="QV Grant Res Reverse">
    <Param dispName="Player" name="PlayerID" varType="player">1</Param>
    <Param dispName="Resource" name="ResName" varType="resource">food</Param>
    <Param name="QV1" dispName="QV1" VarType="string">QV1</Param>
    <Command>trQuestVarSet("SnarlyWarlie", (1*trQuestVarGet("%QV1%") - 2*trQuestVarGet("%QV1%")));</Command>
    <Command>trPlayerGrantResources(%PlayerID%, "%ResName%", 1*trQuestVarGet("SnarlyWarlie"));</Command>
    </Effect>

    Also I am requesting this trigger ~ Khan

    <||=================================||>
    Proud Member of Forgotten Empires
    96Reviews KaS Dota2 Halo 5 Reach
    { "Work until your idols become your rivals" }
    ༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ

    [This message has been edited by Steak And Khan (edited 07-02-2010 @ 03:15 AM).]

    posted 02 July 2010 04:59 AM EDT (US)     2413 / 2506  
    I can get resource triggers to do positive, but never negative by themselves
    Do you mean you can't put in a negative number in the normal Grant Resources effect to subtract resources? Weird, I use that a lot for shops.

    You could just use 3 effects and do QV Copy, QV Modify (* -1), QV Grant Resources.

    Anyway, this effect (untested but should work) will multiply the QV value by -1 so if the QV value is positive it will subtract resources and if it's negative it should add resources.

    <Effect name="QV Grant Resource Reverse">
    <Param name="PlayerID" dispName="Player" varType="string">1</Param>
    <Param name="ResName" dispName="Resource" varType="resource">food</Param>
    <Param name="QV1" dispName="QV1" VarType="string">QV1</Param>
    <Command>trPlayerGrantResources(%PlayerID%, "%ResName%", -1*trQuestVarGet("%QV1%"));</Command>
    </Effect>
    posted 02 July 2010 06:58 AM EDT (US)     2414 / 2506  
    Yeah I could subtract resources away if I put in a QV with a pre-set negative number... but not by any other way Thanks for the trigger ~ Khan

    <||=================================||>
    Proud Member of Forgotten Empires
    96Reviews KaS Dota2 Halo 5 Reach
    { "Work until your idols become your rivals" }
    ༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ
    posted 02 July 2010 09:19 AM EDT (US)     2415 / 2506  
    If you ever have trouble doing a subtraction operation try putting the whole thing in parantheses.
    I've had the problem come up a few times when trying to do math operations for a send chat

    In the message box I put

    "+1*trQuestVarGet("QV1") - 1*trQuestVarGet("QV2")+"

    which looks like it should work, but it is misleading because that whole thing is being tucked inside a string. The + sign is for string concatenation, not addition, and it has no idea what to do with the minus sign, so it trigger locks.
    "+(1*trQuestVarGet("QV1") - 1*trQuestVarGet("QV2"))+"
    When doing it like this, it recognizes the minus sign as a mathematical operator and it works.

    It's a different issue because mine is related to string concatenation and yours isn't (plus it was in parantheses anyway), but maybe it'll be a useful tip at some point.

    I don't see why your trigger didn't work Khan. Was it a trigger lock, or just not granting the right amount of resources? The only explanation I can think of is AOM rebelling against oddly named QVs.

    [This message has been edited by HailToTheOboe (edited 07-02-2010 @ 09:23 AM).]

    posted 02 July 2010 10:32 AM EDT (US)     2416 / 2506  
    it worked for positive numbers... I've been battling with it all day to figure out why is doesn't work. Originally I had this trigger:

    <Effect name="QV Grant Resources Pro">
    <Param dispName="$$22301$$Player" name="PlayerID" varType="player">0</Param>
    <Param dispName="$$22455$$Resource" name="ResName" varType="resource">food</Param>
    <Param name="QV1" dispName="QV1" VarType="string">QV1</Param>
    <Param name="Oper1" dispName="Operator" VarType="string">+</Param>
    <Param name="QV2" dispName="QV2" VarType="string">QV2</Param>
    <Param name="Oper1" dispName="Operator" VarType="string">+</Param>
    <Param name="QV3" dispName="QV3" VarType="string">QV3</Param>
    <Command>trQuestVarSet("ArbleGarble", (trQuestVarGet("%QV1%") %Oper1% trQuestVarGet("%QV2%") %Oper2% trQuestVarGet("%QV3%")));</Command>
    <Command>trPlayerGrantResources(%PlayerID%, "%ResName%", 1*trQuestVarGet("ArbleGarble"));</Command>
    </Effect>

    Which works but has the same issues as the first one I uploaded. I made this trigger specifically so that it could be used by a negative number. However I only tested it using positive QVs thinking that if it worked with positives it would work with negative, silly me.
    In the map I made this trigger for I had QV1 and QV3 set to 0 and QV2 set to 50 the first operator was a - and the second a +. Does absolutley nothing (no trigger lock though), but if both the operators were '+' then it would add fine. Interestingly though, when tested later on a test map, QV1 was 25, QV2 was 50 and QV3 was 0. Operators where both '-'. The trigger actually added 25 Food. Weird, I checked it something like 4 times to make sure that everything was as said above.

    Actually, in writing it down, it looks as if it just grants the first QV and doesn't bother with the rest. Doesn't explain why it does addition fine though... Oh well. I give up lol ~ Khan

    <||=================================||>
    Proud Member of Forgotten Empires
    96Reviews KaS Dota2 Halo 5 Reach
    { "Work until your idols become your rivals" }
    ༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ

    [This message has been edited by Steak And Khan (edited 07-02-2010 @ 10:34 AM).]

    posted 02 July 2010 11:43 PM EDT (US)     2417 / 2506  
    Which works but has the same issues as the first one I uploaded. I made this trigger specifically so that it could be used by a negative number. However I only tested it using positive QVs thinking that if it worked with positives it would work with negative, silly me.
    In the map I made this trigger for I had QV1 and QV3 set to 0 and QV2 set to 50 the first operator was a - and the second a +. Does absolutley nothing (no trigger lock though), but if both the operators were '+' then it would add fine. Interestingly though, when tested later on a test map, QV1 was 25, QV2 was 50 and QV3 was 0. Operators where both '-'. The trigger actually added 25 Food. Weird, I checked it something like 4 times to make sure that everything was as said above.
    Well, that one does trigger lock, because you have two parameters named Oper1 . If you rename the second one to Oper2 it does not trigger lock, and it worked with subtraction for me (Qvs 0, 5, 0 and operators -, +)

    Maybe tt is just useless
    posted 03 July 2010 10:16 PM EDT (US)     2418 / 2506  
    Hey hail, whats the progress on redoing Transport in Circle, and making Units in UDA with unit select for corners?

    I am currently working in triggering a map where I need the UDA condition.

    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.
    posted 03 July 2010 11:04 PM EDT (US)     2419 / 2506  
    Okay this one was super easy.
    Based on invent00r's Units in User Defined Area with 4 miniscule changes.


    <Condition name="Units in User Defined Area (objects)">
    <Param name="Obj" dispName="$$22295$$Source Units" VarType="unit">default</Param>
    <Param name="Location" dispName="Corner object 1" varType="unit">default</Param>
    <Param name="Location2" dispName="Corner object 2" varType="unit">default</Param>
    <Param name="Op" dispName="$$22297$$Operator" VarType="operator">==</Param>
    <Param name="Count" dispName="$$22304$$Count" VarType="float">1</Param>
    <Command>for(result=0;>1){} for(q=0;>1){} for(w=0;>1){} for(a=0;>1){} for(s=0;>1){}</Command>
    <Command>for(x=0;>1){} for(y=0;>1){}</Command>
    <Command>q=xsVectorGetX(kbGetBlockPosition("%Location%"));w=xsVectorGetZ(kbGetBlockPosition("%Location%"));</Command>
    <Command>a=xsVectorGetX(kbGetBlockPosition("%Location2%"));s=xsVectorGetZ(kbGetBlockPosition("%Location2%"));</Command>
    <Command loop="" loopParm="Obj">x=xsVectorGetX(kbGetBlockPosition("%Obj%"));y=xsVectorGetZ(kbGetBlockPosition("%Obj%"));if(((w>=y)!=true||(y>=s)!=true||(x>=q)!=true||(a>=x)!=true)!=true){result++;}</Command>
    <Expression>result %Op% %Count%</Expression>
    </Condition>


    Going to have a look at the circle now.

    OKAY, it's working, but I may need a little input on how you want to use it to get it all working smoothly.

    <Effect name="Transport Units in Circle 2 TL SP">
    <Param name="SrcObject" dispName="Source Units" varType="unit">default</Param>
    <Param name="DstObject" dispName="Centre Object" varType="unit">default</Param>
    <Param name="Height" dispName="Height" varType="string">0</Param>
    <Param name="Radius" dispName="Radius" varType="float">10</Param>
    <Param name="PhaseStep" dispName="Starting angle, Step Size (degrees)" varType="string">0,5</Param>
    <Param name="Stop" dispName="Stop at angle (400+ never stops)" varType="string">400</Param>
    <Param name="Event" dispName="Event" varType="event">-1</Param>
    <Command>for(id=0;>1) {} for(theta=0;>1) {}</Command>
    <Command>for(count=0;>1) {}</Command>
    <Command>id=kbGetBlockID("%SrcObject%")+kbGetBlockID("%DstObject%");</Command>
    <Command>theta=trQuestVarGet("transportcircle"+id);</Command>
    <Command>if(trQuestVarGet("circlecount"+id)==0){</Command>
    <Command loop="" loopParm="SrcObject">count = count+1; trQuestVarSet("circle"+id+"unit"+count,kbGetBlockID("%SrcObject%"));</Command>
    <Command>trQuestVarSet("circlecount"+id,count);</Command>
    <Command>}</Command>
    <Command>for(i=trQuestVarGet("circlecount"+id);>0) {</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(trQuestVarGet("circle"+id+"unit"+i));</Command>
    <Command>trVectorQuestVarSet("DstObjPos", kbGetBlockPosition("%DstObject%"));</Command>
    <Command>trQuestVarSet("stepx",trVectorQuestVarGetX("DstObjPos")+1.0*%Radius%*Math_sin(1.0*(1.0*theta+360.0*(1.0*i-1.0)/trQuestVarGet("circlecount"+id)+1.0*xsVectorGetX(vector(%PhaseStep%,0)))*PI/180.0));</Command>
    <Command>trQuestVarSet("stepy",trVectorQuestVarGetY("DstObjPos")+1.0*%Height%);</Command>
    <Command>trQuestVarSet("stepz",trVectorQuestVarGetZ("DstObjPos")+1.0*%Radius%*Math_cos(1.0*(1.0*theta+360.0*(1.0*i-1.0)/trQuestVarGet("circlecount"+id)+1.0*xsVectorGetX(vector(%PhaseStep%,0)))*PI/180.0));</Command>
    <Command>trUnitTeleport(trQuestVarGet("stepx"),trQuestVarGet("stepy"),trQuestVarGet("stepz"));</Command>
    <Command>}</Command>
    <Command>if(0 > trQuestVarGet("transportcircle"+id)) {</Command>
    <Command>if((%Stop%-360) >= trQuestVarGet("transportcircle"+id)) {</Command>
    <Command>trEventFire(%Event%);</Command>
    <Command>trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)+1.0*xsVectorGetY(vector(%PhaseStep%,0)));</Command>
    <Command>xsDisableSelf(); </Command>
    <Command>return;}}</Command>
    <Command>if(trQuestVarGet("transportcircle"+id) >= 0) {</Command>
    <Command>if(trQuestVarGet("transportcircle"+id) >= (%Stop%)) {</Command>
    <Command>trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)+1.0*xsVectorGetY(vector(%PhaseStep%,0)));</Command>
    <Command>trEventFire(%Event%);</Command>
    <Command>xsDisableSelf(); </Command>
    <Command>return;}}</Command>
    <Command>trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)+1.0*xsVectorGetY(vector(%PhaseStep%,0)));</Command>
    <Command>if(-361.0>=trQuestVarGet("transportcircle"+id)) trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)+360.0);</Command>
    <Command>if(trQuestVarGet("transportcircle"+id)>=361.0) trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)-360.0);</Command>
    </Effect>

    Some things that may need changing depending on how you use it:
  • Stop must be within one revolution (less than 360 degrees). If you are going counterclockwise, put a negative number.
  • When it stops, the entire trigger gets disabled, not just stopping this one circle. Is this going to be a problem? I did it this way so you can just fire event again to start up with no other trouble.
  • If you stop it then restart it, continues where it left off. This means the fired event can fire the circle trigger again and it'll keep looping and firing an event at a certain point on the circle (like a clock!) Should it reset to zero instead? If you put a QV in for the stop point, you can change it every time.

    Hope this works for you.

    [This message has been edited by HailToTheOboe (edited 07-03-2010 @ 11:58 PM).]

  • posted 04 July 2010 10:59 AM EDT (US)     2420 / 2506  
    If I choose not to stop, when would the event fire, if at all? And the angle thing is all good, but what If I want whatever I am transporting go go around in a few circles THEN stop. Which would be past 360 degrees.

    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.
    posted 04 July 2010 12:13 PM EDT (US)     2421 / 2506  
    Hey guys.

    Is it possible to set a unit's stance with triggers?
    posted 04 July 2010 12:25 PM EDT (US)     2422 / 2506  
    Easily. There is one in the game I believe.

    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.
    posted 04 July 2010 12:26 PM EDT (US)     2423 / 2506  
    Woohoo, time to scroll through that trigger list, then.
    posted 04 July 2010 12:42 PM EDT (US)     2424 / 2506  
    Can someone post the effect 'camera cut at unit/object'. So I can get the camera to follow my main character. simply camera cut isnt working for me (even on loop).

    EDIT: Why isnt this trrigger working! It is essential for my project, and I cant figure out why..

    Effect name="Change Name For All Protounits"
    All my oither added triggers work, why not this one, ive recopied it into my typetest.xml SOOO many times. It does not work! Help?

    EDIT2: Ive worked on 'change name in area'and centered a unit id, but I can do that if no body knows , its jsut that trigger will be much easier if it just worked, it'll be a pain searching up all the unitsd id's that I need ti properly change all units name.

    Currently Designing Elder Scrolls Project (ESP) 12% Complete
    1000+ character combinations,Vast Open World Environments,Twisting Story,All on the AOM engine.
    Release date is unknown.Small breaks are being taken to prevent loss of interest due to overwhelming designing.

    [This message has been edited by DaedricSparta (edited 07-04-2010 @ 01:11 PM).]

    posted 04 July 2010 03:08 PM EDT (US)     2425 / 2506  
    This one came with Reyk's editor.



    <Effect name="CAMERA Cut Object">
    <Param name="ScenName" dispName="Unit" varType="unit">default</Param>
    <Command>uiLookAtUnit(kbGetBlockID("%ScenName%"));</Command>
    </Effect>



    The change name trigger in the Question thread works for me Daedric. If it really doesn't work at all for you, you can use v triggers.
    v 1 tpq start
    v Change Name
    v 2 tpq end
    If I choose not to stop, when would the event fire, if at all? And the angle thing is all good, but what If I want whatever I am transporting go go around in a few circles THEN stop. Which would be past 360 degrees.
    If you choose not to stop, the event would not fire. If you want to keep going you can make the fired event fire the circle trigger again and it'll keep looping and firing an event at a certain point on the circle
    I'll add something to let you go more than 360 degrees.
    hm this is tricky to make it work for both directions of rotation.

    ok I got it. Here goes nothing.
    <Effect name="Transport Units in Circle 2 TL SP">
    <Param name="SrcObject" dispName="Source Units" varType="unit">default</Param>
    <Param name="DstObject" dispName="Centre Object" varType="unit">default</Param>
    <Param name="Height" dispName="Height" varType="string">0</Param>
    <Param name="Radius" dispName="Radius" varType="float">10</Param>
    <Param name="PhaseStep" dispName="Starting angle, Step Size (degrees)" varType="string">0,5</Param>
    <Param name="Stop" dispName="Stop at angle (negative never stops)" varType="string">-1</Param>
    <Param name="Event" dispName="Event" varType="event">-1</Param>
    <Command>for(id=0;>1) {} for(theta=0;>1) {}</Command>
    <Command>for(count=0;>1) {}</Command>
    <Command>id=kbGetBlockID("%SrcObject%")+kbGetBlockID("%DstObject%");</Command>
    <Command>theta=trQuestVarGet("transportcircle"+id);</Command>
    <Command>if(trQuestVarGet("circlecount"+id)==0){</Command>
    <Command loop="" loopParm="SrcObject">count = count+1; trQuestVarSet("circle"+id+"unit"+count,kbGetBlockID("%SrcObject%"));</Command>
    <Command>trQuestVarSet("circlecount"+id,count);</Command>
    <Command>}</Command>
    <Command>for(i=trQuestVarGet("circlecount"+id);>0) {</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(trQuestVarGet("circle"+id+"unit"+i));</Command>
    <Command>trVectorQuestVarSet("DstObjPos", kbGetBlockPosition("%DstObject%"));</Command>
    <Command>trQuestVarSet("stepx",trVectorQuestVarGetX("DstObjPos")+1.0*%Radius%*Math_sin(1.0*(1.0*theta+360.0*(1.0*i-1.0)/trQuestVarGet("circlecount"+id)+1.0*xsVectorGetX(vector(%PhaseStep%,0)))*PI/180.0));</Command>
    <Command>trQuestVarSet("stepy",trVectorQuestVarGetY("DstObjPos")+1.0*%Height%);</Command>
    <Command>trQuestVarSet("stepz",trVectorQuestVarGetZ("DstObjPos")+1.0*%Radius%*Math_cos(1.0*(1.0*theta+360.0*(1.0*i-1.0)/trQuestVarGet("circlecount"+id)+1.0*xsVectorGetX(vector(%PhaseStep%,0)))*PI/180.0));</Command>
    <Command>trUnitTeleport(trQuestVarGet("stepx"),trQuestVarGet("stepy"),trQuestVarGet("stepz"));</Command>
    <Command>}</Command>
    <Command>for(numrevs=0;>1) {}</Command>
    <Command>numrevs=(%Stop%-1)/360;</Command>
    <Command>if(%Stop% > 0) {</Command>
    <Command>if(trQuestVarGet("transportnumRevs"+id) >= numrevs) {</Command>
    <Command>if(0.0 > trQuestVarGet("transportcircle"+id)) {</Command>
    <Command>if((%Stop%-360.0*(1+numrevs)) >= trQuestVarGet("transportcircle"+id)) {</Command>
    <Command>trEventFire(%Event%);</Command>
    <Command>trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)+1.0*xsVectorGetY(vector(%PhaseStep%,0)));</Command>
    <Command>xsDisableSelf(); </Command>
    <Command>return;}}</Command>
    <Command>if(trQuestVarGet("transportcircle"+id) > 0.0) {</Command>
    <Command>if(trQuestVarGet("transportcircle"+id) >= (%Stop% - 360.0*numrevs)) {</Command>
    <Command>trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)+1.0*xsVectorGetY(vector(%PhaseStep%,0)));</Command>
    <Command>trEventFire(%Event%);</Command>
    <Command>xsDisableSelf(); </Command>
    <Command>return;}}}}</Command>
    <Command>trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)+1.0*xsVectorGetY(vector(%PhaseStep%,0)));</Command>
    <Command>if(-361.0>=trQuestVarGet("transportcircle"+id)) {trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)+360.0);</Command>
    <Command>trQuestVarSet("transportnumRevs"+id,trQuestVarGet("transportnumRevs"+id) + 1);}</Command>
    <Command>if(trQuestVarGet("transportcircle"+id)>=361.0) {trQuestVarSet("transportcircle"+id,trQuestVarGet("transportcircle"+id)-360.0);</Command>
    <Command>trQuestVarSet("transportnumRevs"+id,trQuestVarGet("transportnumRevs"+id) + 1);}</Command>
    </Effect>

    Now you can put in stop conditions above 360, but not below zero.
    If you are going counterclockwise (negative step size) your stop condition should still be a positive number, just convert it to a positive angle by adding 360 for each revolution, -90 = 270. -450 = 630, etc

    [This message has been edited by HailToTheOboe (edited 07-04-2010 @ 04:17 PM).]

    « Previous Page  1 ··· 10 ··· 20 ··· 30 ··· 40 ··· 50 ··· 60 ··· 70 ··· 80 ··· 90 ··· 95 96 97 98 99 ··· 101  Next Page »
    Age of Mythology Heaven » Forums » Scenario Design » Have a Trigger Request? Post it here!
    Top
    You must be logged in to post messages.
    Please login or register
    Hop to:    
    Age of Mythology Heaven | HeavenGames