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 ··· 37 38 39 40 41 ··· 50 ··· 60 ··· 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:
    Hugar
    Mortal
    posted 24 March 2012 07:46 PM EDT (US)     951 / 1680       
    Hi, I am back. I have found many help here in forums, many thanks for everyone. And I need a little help again.

    I need a condition that should like: A Protounit from Player died.

    Exemple:
    A trigger is fired when a hoplite from player 1 dies.

    Note that is not a particular unit, any hoplite who dies would fire the trigger.

    Conditions like Player Unit Count won't help, as long as the player can train more hoplites. What would fire the trigger is the death of any hoplite from that player.

    I even tried some sort of QV, very complex, but did not worked.

    Can anyone please create a condition for me? It would be very useful for everyone!

    (Warcraft III World Editor is very good, and has conditions like this one. I miss them in AoM)

    Greetings, Mortal.
    Ghostoo
    Mortal
    posted 25 March 2012 02:46 AM EDT (US)     952 / 1680       
    @Hugar

    Just use this trigger looped with a always condition:

    <Effect name="Conditional Unit leaves area">
    <Param name="DstObject" dispName="$$22300$$Center Unit" VarType="unit">default</Param>
    <Param name="Player" dispName="$$22301$$Player" VarType="player">0</Param>
    <Param name="UnitType" dispName="$$22302$$Unit Type" VarType="string">Unit</Param>
    <Param name="Dist" dispName="$$22303$$Radius" VarType="float">10</Param>
    <Param name="QV" dispName="unused QV" VarType="string">Make this different for different units and players</Param>
    <Command>if (trCountUnitsInArea("%DstObject%",%Player%,"%UnitType%",%Dist%) > trQuestVarGet("%QV%")){</Command>
    <Command>trQuestVarSet("%QV%", trCountUnitsInArea("%DstObject%",%Player%,"%UnitType%",%Dist%));}</Command>
    <Command>if (trQuestVarGet("%QV%") > trCountUnitsInArea("%DstObject%",%Player%,"%UnitType%",%Dist%)){</Command>
    <Command>trQuestVarSet("%QV%", trCountUnitsInArea("%DstObject%",%Player%,"%UnitType%",%Dist%));</Command>
    </Effect>
    then put your effect here
    and then end it with this:

    <Effect name="Conditional zEnd">
    <Command>}</Command>
    </Effect>
    what it'll do is simply check whether a unit leaves an area, in which leaving can also be classified as dying (in this case set the distobject to an invisible unit in the center of the map and have the radius 999).


    First method i thought of that also worked:
    It's going to take 3 different trigger to pull this off (for the way i found at least).

    First, you're going to need this:

    <Effect name="QV on units in area">
    <Param name="DstObject" dispName="$$22300$$Center Unit" VarType="unit">default</Param>
    <Param name="Player" dispName="$$22301$$Player" VarType="player">0</Param>
    <Param name="UnitType" dispName="$$22302$$Unit Type" VarType="string">Unit</Param>
    <Param name="Dist" dispName="$$22303$$Radius" VarType="float">10</Param>
    <Param name="QV" dispName="Set to QV" varType="string">QV1</Param>
    <Command>trQuestVarSet("%QV%", trCountUnitsInArea("%DstObject%",%Player%,"%UnitType%",%Dist%));</Command>
    </Effect>

    It converts the count of units into a quest var. If you want to count units on the map just use this effect on an invisible object in the middle of the map with a radius of 999.

    Trigger 1:
    [x] active
    [x] loop
    [ ] run immediately
    (above normal priority)
    Conditions: Always
    Effects: QV on Units in Area
    This will keep track of all the units at all times


    Trigger 2:
    [x] active
    [x] loop
    [ ] run immediately
    Conditions: QV Compare
    Compare your QV that counts units
    and ask if it's greater than a second QV
    Effects: QV on Units in Area
    have this count all the units for the second QV, so now both QV's should be the same, regardless if more are spawned.


    Trigger 3:
    [x] active
    [x] loop
    [ ] run immediately
    Conditions: QV Compare
    Compare the first QV to check if it's less than the second QV
    Effects: QV on Units in Area (makes second QV keep up with first)
    [Your effect here] Finally, add your desired effect

    i tested it myself using flares for my desired effect. When my anubite (any anubute) died, it would set off a flare once, and it would do so ever time an anubite died. I could spawn more anubites and if one ever died it would set off the flare, whether i spawned 5 or 50, killing 1 set off the effect.

    I hope this helps. I think i can pull this off with just 1 condition, so give me some time for that one.

    [This message has been edited by Ghostoo (edited 03-25-2012 @ 03:28 PM).]

    Lewonas
    Mortal
    posted 25 March 2012 11:23 AM EDT (US)     953 / 1680       
    Ghostoo, your method could do the trick, but it isn't ideal. What if a unit is converted to another player or the unit is changed to a cinematic block? Those two things would trigger the effects.

    What I would do, Hugar, is use the Target Protounit Query Triggers (AKA vtriggers). Use the vTarget Protounit Query trigger to search for all dead hoplites and then change the hoplites' corpses to e.g. Blood Cinematic (otherwise the corpses would be detected more than once):

    Trigger - Search_Dead_Hoplites
    Active, Loop
    HIGH PRIORITY

    Conditions
    Always

    Effects
    vTarget Protounit Query start
    Unit = Hoplite
    Center unit = Cinematic block
    Radius = -1
    State = 4 (state 4 = death)

    vChange Unit Type
    Unit type = Blood Cinematic (if you like lots of blood)

    Put your effects here, or use a fire event effect to fire a seperate trigger with your effects

    vTarget Protounit Query end

    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 03-25-2012 @ 11:26 AM).]

    Hugar
    Mortal
    posted 25 March 2012 05:53 PM EDT (US)     954 / 1680       
    Well, I never worked with these vtriggers, maybe they work! i will try.

    Exactly, the situation is this:

    Everytime a caribou, elk or deer dies in the map, his "body" (the body still has 1 hp and 150 that can be gathered) desappears and player 1 gains 150 food. So, the trigger I want would be set like:

    Trigger 1 - loop
    Condition: Protounit: caribou, Player: 0
    Effect: Grant Player 1 150 food.

    EDIT: Where can I get these vTriggers?

    Greetings, Mortal.

    [This message has been edited by Hugar (edited 03-25-2012 @ 05:59 PM).]

    Zenophobia
    Irrational Fear
    posted 25 March 2012 06:22 PM EDT (US)     955 / 1680       
    http://aom.heavengames.com/downloads/showfile.php?fileid=9175

    [This message has been edited by Zenophobia (edited 02-29-2094 @ 10:60 AM).]
    Hugar
    Mortal
    posted 25 March 2012 08:46 PM EDT (US)     956 / 1680       
    It worked properly! Just some adjusts.

    I wanted, to make a good eyecandy map, to delay the effect.

    Exemple: the hoplite dies, wait a few seconds so the unit plays the animation of death, a then his body is changed into cinematic blood or anything like that. That's why I wanted a condition, not an effect.

    But great thanks for the triggers!

    Greetings, Mortal.
    Lewonas
    Mortal
    posted 26 March 2012 12:40 PM EDT (US)     957 / 1680       
    Try this trigger setup:

    Trigger - Search_Dead_Hoplites
    Active, Loop
    HIGH PRIORITY

    Conditions
    Quest Var Check

    Var name = QV1
    Operator = ==
    Value = 0

    Effects
    vTarget Protounit Query start

    Unit = Hoplite
    Center unit = Cinematic block
    Radius = -1
    State = 4 (state 4 = death)

    Sound Timer
    Milliseconds = 2000
    Trigger = Change_Type

    Quest Var Modify
    Var name = QV1
    Operator = +
    Value = 1

    vTarget Protounit Query end


    Trigger - Change_Type
    Inactive
    HIGH PRIORITY

    Conditions
    Always


    Effects
    vTarget Protounit Query start

    Unit = Hoplite
    Center unit = Cinematic block
    Radius = -1
    State = 4 (state 4 = death)

    vChange Unit Type
    Unit = Blood Cinematic

    vTarget Protounit Query end

    Quest Var Set
    Var name = QV1
    Value = 0

    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 03-26-2012 @ 12:40 PM).]

    Ghostoo
    Mortal
    posted 05 April 2012 07:16 PM EDT (US)     958 / 1680       
    this isn't about triggers.. or AoM at all, but i feel it fits in this thread.

    so you know how in programming triggers we can do stuff like:
    <Command>trQuestVarSet("%Var%x"+1*trQuestVarGet("%Varcnt%"), (value here));

    where i set a variable as "variablename("other variable name")" so my variable would be declared "variablename4" [assuming "other variable name" was on 4].


    well i'm having difficulties doing such on C.. i'm very novice so bear with me.

    Just, how do i name a variable a name INCLUDING the result of another variable (not just naming a variable as the result, but just the result attached to part of the variable name).

    Extremely useful to me, if anyone would be so kind.

    Regards
    perpetual_n00b
    Immortal
    posted 06 April 2012 06:49 AM EDT (US)     959 / 1680       
    I don't think you can concatenate variable names in C. Maybe you could use an array instead.
    Ghostoo
    Mortal
    posted 06 April 2012 12:35 PM EDT (US)     960 / 1680       
    arrays and structs work but they're limited in memory, whereas naming variables by other variables can be unlimited.

    i know you can define a variable as another variables result, such as
    $a=hello
    $$a=11
    so that $hello = 11

    but that's exact results as values, not a conjunction of characters plus a variable, which is what i'm searching for.

    if we do it in aom, shouldn't it be possible in c? or do we just have a very good compiler

    [This message has been edited by Ghostoo (edited 04-06-2012 @ 12:38 PM).]

    perpetual_n00b
    Immortal
    posted 07 April 2012 09:22 AM EDT (US)     961 / 1680       
    Well, in aom we are setting QuestVar names dynamically not normal var names and I think Quest Vars are stored in some sort of array/table.

    In lua, global variables are accessible via the _G table, which gives you a way to name variables on the fly and you can embed lua in C, so that gives you a round-about way of having dynamically named variables.

    For example,
    texttouse="MyVar"
    for i=1,5 do
    _G[texttouse..i]=i
    end
    will give you the variables MyVar1, MyVar2, MyVar3, MyVar4 and MyVar5
    Ghostoo
    Mortal
    posted 13 April 2012 03:16 AM EDT (US)     962 / 1680       
    back to checking over my amateur triggers, i've looked at this one up and down and am certain there's nothing wrong with it.

    i'm not concerned with getting the correct result, i'm concerned about it derping all triggers, which is usually a coding mistake.

    <Effect name="Quest Var Square Root">
    <Param name="QV" dispName="Sqrt this Var" varType="string">QV1</Param>
    <Command>trQuestVarSet("isneg", 0);</Command>
    <Command>if (0 > trQuestVarGet("%QV%") ){</Command>
    <Command>trQuestVarSet("isneg", 1);</Command>
    <Command>trQuestVarSet("%QV%", 0-trQuestVarGet("%QV%"));}</Command>
    <Command>trQuestVarSet("close", 0);</Command>
    <Command>while ( trQuestVarGet("%QV%") > (trQuestVarGet("close")*trQuestVarGet("close")) ){</Command>
    <Command>trQuestVarSet("close", trQuestVarGet("close") + 1);}</Command>
    <Command>trQuestVarSet("close", trQuestVarGet("close") - 1);</Command>
    <Command>trQuestVarSet("dclose", trQuestVarGet("%QV%") - (trQuestVarGet("close")*trQuestVarGet("close")) );</Command>
    <Command>trQuestVarSet("pclose", trQuestVarGet("dclose")/2*trQuestVarGet("close") );</Command>
    <Command>trQuestVarSet("aclose", trQuestVarGet("close")+trQuestVarGet("pclose") );</Command>
    <Command>trQuestvarSet("pclose2", trQuestVarGet("pclose")*trQuestVarGet("pclose") );</Command>
    <Command>trQuestVarSet("%QV%", trQuestVarGet("aclose")-(trQuestVarGet("pclose2")/2*trQuestVarGet("aclose")) );</Command>
    <Command>if (trQuestVarGet("isneg") == 1){</Command>
    <Command>trQuestVarSet("%QV%", 0-trQuestVarGet("%QV%"));}</Command>
    </Effect>

    i have the active trigger loader, don't worry
    i have access to "math_sqrt"

    [This message has been edited by Ghostoo (edited 04-13-2012 @ 03:18 AM).]

    Elrich
    Hero
    posted 13 April 2012 09:41 AM EDT (US)     963 / 1680       
    @Ghostoo: I can't see any syntactical errors with your effect. What problem is it causing exactly: ?
    1. None of the triggers in the file it is included in show up in the editor (XML fail).
    2. When it is added to a scenario, all triggers stop firing(trigger coding error)
    3. When a trigger with this effect is run, the game locks up.(effect is stuck in an infinite loop)


    p.s. I do like your ingenuity on creating your own square root function. It will be slower for larger numbers but maybe instead of starting with zero, you could use the given QV value to estimate a closer, but safe (less than the square root) starting point. Even though the math.sqrt function will always be faster (cuz it's compiled to assembly language), I think it's good brain excercise to know how to work from 'scratch' - you won't be like the pilot that never learned to use paper maps to navigate, who completely lost when the nav computer breaks down in mid-flight. Old school - cool school.

    double p.s. that reminds me that I never released my circle effect which doesn't use trig to spin objects around a center object in a circle.

    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
    Ghostoo
    Mortal
    posted 13 April 2012 11:45 AM EDT (US)     964 / 1680       
    it's problem 2 (sorry forgot to mention)
    i add it to scenario and nothing works

    this game usually doesn't like my inqueries, so i'll take those out 1 by one and see if i can't isolate what it doesn't like

    as always, thanks for the help
    perpetual_n00b
    Immortal
    posted 13 April 2012 01:32 PM EDT (US)     965 / 1680       
    Ghostoo, I can see one error - one of your trQuestVarSet commands has a lower case v

    Corrected it, not tested it.

    <Effect name="Quest Var Square Root">
    <Param name="QV" dispName="Sqrt this Var" varType="string">QV1</Param>
    <Command>trQuestVarSet("isneg", 0);</Command>
    <Command>if (0 > trQuestVarGet("%QV%") ){</Command>
    <Command>trQuestVarSet("isneg", 1);</Command>
    <Command>trQuestVarSet("%QV%", 0-trQuestVarGet("%QV%"));}</Command>
    <Command>trQuestVarSet("close", 0);</Command>
    <Command>while ( trQuestVarGet("%QV%") > (trQuestVarGet("close")*trQuestVarGet("close")) ){</Command>
    <Command>trQuestVarSet("close", trQuestVarGet("close") + 1);}</Command>
    <Command>trQuestVarSet("close", trQuestVarGet("close") - 1);</Command>
    <Command>trQuestVarSet("dclose", trQuestVarGet("%QV%") - (trQuestVarGet("close")*trQuestVarGet("close")) );</Command>
    <Command>trQuestVarSet("pclose", trQuestVarGet("dclose")/2*trQuestVarGet("close") );</Command>
    <Command>trQuestVarSet("aclose", trQuestVarGet("close")+trQuestVarGet("pclose") );</Command>
    <Command>trQuestVarSet("pclose2", trQuestVarGet("pclose")*trQuestVarGet("pclose") );</Command>
    <Command>trQuestVarSet("%QV%", trQuestVarGet("aclose")-(trQuestVarGet("pclose2")/2*trQuestVarGet("aclose")) );</Command>
    <Command>if (trQuestVarGet("isneg") == 1){</Command>
    <Command>trQuestVarSet("%QV%", 0-trQuestVarGet("%QV%"));}</Command>
    </Effect>
    Ghostoo
    Mortal
    posted 13 April 2012 06:45 PM EDT (US)     966 / 1680       
    omg AoM is such a troll

    yeah perpetual that was it lol
    as for the result, i had to place some parenthesis to get it right.
    if anyone is interested, the working trigger for square root is:

    <Effect name="Quest Var Square Root">
    <Param name="QV" dispName="Sqrt this Var" varType="string">QV1</Param>
    <Command>trQuestVarSet("isneg", 0);</Command>
    <Command>if (0 > trQuestVarGet("%QV%") ){</Command>
    <Command>trQuestVarSet("isneg", 1);</Command>
    <Command>trQuestVarSet("%QV%", 0-trQuestVarGet("%QV%"));}</Command>
    <Command>trQuestVarSet("asdfclose", 0);</Command>
    <Command>while ( trQuestVarGet("%QV%") >= (trQuestVarGet("asdfclose")*trQuestVarGet("asdfclose")) ){</Command>
    <Command>trQuestVarSet("asdfclose", trQuestVarGet("asdfclose") + 1);}</Command>
    <Command>trQuestVarSet("asdfclose", trQuestVarGet("asdfclose") - 1);</Command>
    <Command>if (trQuestVarGet("%QV%") == (trQuestVarGet("asdfclose")*trQuestVarGet("asdfclose")) ){</Command>
    <Command>trQuestVarSet("%QV%", trQuestVarGet("asdfclose"));}</Command>
    <Command>else {</Command>
    <Command>trQuestVarSet("dasdfclose", trQuestVarGet("%QV%") - (trQuestVarGet("asdfclose")*trQuestVarGet("asdfclose")) );</Command>
    <Command>trQuestVarSet("pasdfclose", trQuestVarGet("dasdfclose")/(2*trQuestVarGet("asdfclose")) );</Command>
    <Command>trQuestVarSet("aasdfclose", trQuestVarGet("asdfclose")+trQuestVarGet("pasdfclose") );</Command>
    <Command>trQuestVarSet("pasdfclose2", trQuestVarGet("pasdfclose")*trQuestVarGet("pasdfclose") );</Command>
    <Command>trQuestVarSet("%QV%", trQuestVarGet("aasdfclose")-(trQuestVarGet("pasdfclose2")/(2*trQuestVarGet("aasdfclose"))) );}</Command>
    <Command>if (trQuestVarGet("isneg") == 1){</Command>
    <Command>trQuestVarSet("%QV%", 0-trQuestVarGet("%QV%"));}</Command>
    </Effect>



    now for more experimental purposes, i tried to throw the entire thing into a trigger, with "as you can imagine" no success. it does the same error, when added to scenario no triggers work. i'll be checking it thoroughly, tell me if you find anything.

    <Effect name="Army Deploy in a line every x paces">
    <Param name="SrcArmy" dispName="$$22348$$Army" VarType="group">default</Param>
    <Param name="ProtoName" dispName="$$22434$$ProtoName" varType="protounit">Villager</Param>
    <Param name="obj1" dispName="Between unit" varType="unit">default</Param>
    <Param name="obj2" dispName="and unit" varType="unit">default</Param>
    <Param name="Count" dispName="Per Distance" varType="long">1</Param>
    <Param name="Heading" dispName="$$22432$$Heading" varType="long">0</Param>
    <Command>trQuestVarSet("deployzz", 1);</Command>
    <Command>trQuestVarSet("xco", xsVectorGetX(kbGetBlockPosition("%obj2%")) - xsVectorGetX(kbGetBlockPosition("%obj1%")));</Command>
    <Command>if (0 > trQuestVarGet("xco") ){</Command>
    <Command>trQuestVarSet("xco" 0-trQuestVarGet("xco") );}</Command>
    <Command>trQuestVarSet("zco", xsVectorGetZ(kbGetBlockPosition("%obj2%")) - xsVectorGetZ(kbGetBlockPosition("%obj1%")));</Command>
    <Command>if (0 > trQuestVarGet("zco") ){</Command>
    <Command>trQuestVarSet("zco" 0-trQuestVarGet("zco") );}</Command>
    <Command>trQuestVarSet("divz", (trQuestVarGet("xco")*trQuestVarGet("xco"))+(trQuestVarGet("zco")*trQuestVarGet("zco")) );</Command>
    //-------------------------start taking square root--------------------------
    <Command>trQuestVarSet("isneg", 0);</Command>
    <Command>if (0 > trQuestVarGet("divz") ){</Command>
    <Command>trQuestVarSet("isneg", 1);</Command>
    <Command>trQuestVarSet("divz", 0-trQuestVarGet("divz"));}</Command>
    <Command>trQuestVarSet("asdfclose", 0);</Command>
    <Command>while ( trQuestVarGet("divz") >= (trQuestVarGet("asdfclose")*trQuestVarGet("asdfclose")) ){</Command>
    <Command>trQuestVarSet("asdfclose", trQuestVarGet("asdfclose") + 1);}</Command>
    <Command>trQuestVarSet("asdfclose", trQuestVarGet("asdfclose") - 1);</Command>
    <Command>if (trQuestVarGet("divz") == (trQuestVarGet("asdfclose")*trQuestVarGet("asdfclose")) ){</Command>
    <Command>trQuestVarSet("divz", trQuestVarGet("asdfclose"));}</Command>
    <Command>else {</Command>
    <Command>trQuestVarSet("dasdfclose", trQuestVarGet("divz") - (trQuestVarGet("asdfclose")*trQuestVarGet("asdfclose")) );</Command>
    <Command>trQuestVarSet("pasdfclose", trQuestVarGet("dasdfclose")/(2*trQuestVarGet("asdfclose")) );</Command>
    <Command>trQuestVarSet("aasdfclose", trQuestVarGet("asdfclose")+trQuestVarGet("pasdfclose") );</Command>
    <Command>trQuestVarSet("pasdfclose2", trQuestVarGet("pasdfclose")*trQuestVarGet("pasdfclose") );</Command>
    <Command>trQuestVarSet("divz", trQuestVarGet("aasdfclose")-(trQuestVarGet("pasdfclose2")/(2*trQuestVarGet("aasdfclose"))) );}</Command>
    <Command>if (trQuestVarGet("isneg") == 1){</Command>
    <Command>trQuestVarSet("divz", 0-trQuestVarGet("divz"));}</Command>
    //-------------------------finish taking square root-------------------------
    <Command>trQuestVarSet("divz", trQuestVarGet("divz")/(%Count%) );</Command> //the total distance divided by the amount per paces desired, giving the number of units to spawn
    <Command>while(trQuestVarGet("divz") > trQuestVarGet("deployzz")+0.5){</Command> //the number of units to spawn is greater than the amount spawned plus half (for rounding reasons)
    <Command>trQuestVarSet("zzza",xsVectorGetX(kbGetBlockPosition("%obj1%")) + ((trQuestVarGet("xco")/trQuestVarGet("divz"))*trQuestVarGet("deployzz")));</Command>
    <Command>trQuestVarSet("zzzb",xsVectorGetY(kbGetBlockPosition("%obj1%")));</Command>
    <Command>trQuestVarSet("zzzc",xsVectorGetZ(kbGetBlockPosition("%obj1%")) + ((trQuestVarGet("zco")/trQuestVarGet("divz"))*trQuestVarGet("deployzz")));</Command>
    <Command>trArmyDispatch("%SrcArmy%", "%ProtoName%", 1, trQuestVarGet("zzza"), trQuestVarGet("zzzb"), trQuestVarGet("zzzc"), %Heading%, true);</Command> //spawn unit on next x paces
    <Command>trQuestVarSet("deployzz", trQuestVarGet("deployzz")+1);}</Command>
    </Effect>

    the parts particularly in question is everything after the square root has been taken

    [This message has been edited by Ghostoo (edited 04-13-2012 @ 06:53 PM).]

    Lewonas
    Mortal
    posted 14 April 2012 07:05 AM EDT (US)     967 / 1680       
    Ghostoo, I can see one error - one of your trQuestVarSet commands has a lower case v
    I encountered the same problem when I was making my inventory triggers. The only difference is that one of the million v's in my code was in lower case...

    Ghostoo, you can easily fix the code yourself by just repeatedly removing small parts of code. Then test the trigger for errors in the editor. If there's no error, you know where the problem is.

    Profit: You learn from your own mistakes and you feel good about solving the problem yourself.

    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%]
    Ghostoo
    Mortal
    posted 14 April 2012 01:11 PM EDT (US)     968 / 1680       
    well to be multi-productive i do a decent, thorough search through the code to see if i can't find the issue.
    if i can't i'll post in here and then do said steps. I don't do those first because there's still things i've yet to learn that might interfere with my troubleshooting.

    like the first time i learned you can't have an inquery with a less than sign (<) i was looking through for it about an hour lol

    but it seems like you're assuming if i can't find it i give up and post it here so i don't have to deal with it.
    that is never the case so please don't assume that
    Zenophobia
    Irrational Fear
    posted 14 April 2012 08:44 PM EDT (US)     969 / 1680       
    double p.s. that reminds me that I never released my circle effect which doesn't use trig to spin objects around a center object in a circle.
    Is that more effective than HttO's transport in circle?

    [This message has been edited by Zenophobia (edited 02-29-2094 @ 10:60 AM).]
    Lewonas
    Mortal
    posted 15 April 2012 06:51 AM EDT (US)     970 / 1680       
    Ghostoo, no offense but, I can't imagine you really searched the code thoroughly. 'Cause I have already detected some simple syntax problems in the first seven command lines...

    <Command>trQuestVarSet("zco" 0-trQuestVarGet("zco") );}</Command>

    There should be a comma between "zco" and "0-tr..."

    <Command>trQuestVarSet("zco" 0-trQuestVarGet("zco") );}</Command>

    Same problem here.

    I know you are getting pretty decent at triggering, that's why I want to push you to solve your own problem because you have the knowledge to do so. Analyze your trigger code, figure out which lines of code are causing the problem (by using the method in my previous post) then try to come up with a solution. If you can't - which is alright - post those lines of code here so we can help you out.
    but it seems like you're assuming if i can't find it i give up and post it here so i don't have to deal with it.
    Yes you're right, I did assume that. But that's only because you always post the entire trigger code and ask us to look at it and find the problem ourselves. This reached a point where I thought you just gave up entirely on analyzing your own triggers. But it turns out I'm wrong.

    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%]
    Ghostoo
    Mortal
    posted 15 April 2012 11:59 PM EDT (US)     971 / 1680       
    @lewo

    i don't even see how it was possible for there to be an error in the beginning, that beginning part came straight from a working trigger. trolled by aom again

    and you're right, i'll admit i don't do what might be considered a complete thorough search, but i don't give it a half-ass troubleshoot either. i'll definitely start doing a complete and utter search for the errors. as usual, thanks for all your help and same to the rest of the community.

    p.s.: the trigger i ripped the top half from did indeed have those commas. i don't even

    edit: also thanks, that was it -.-, if i didn't post the whole thing it wouldn't have got fixed. i wasn't even considering looking anywhere above the startsqrt

    [This message has been edited by Ghostoo (edited 04-16-2012 @ 00:08 AM).]

    Lewonas
    Mortal
    posted 16 April 2012 01:31 PM EDT (US)     972 / 1680       
    Argh, I was in a very bad mood yesterday and after rereading my post I wish I hadn't said some things so harsh.
    if i didn't post the whole thing it wouldn't have got fixed.
    Of course you had to post it, and you should always post the entire code. What I said was unreasonable and I only said it out of annoyance.

    I wouldn't have posted the reply if I hadn't seen the syntax error with the missing comma (gotta love these random errors). I took this opportunity to be a total *******. =/

    But I'm glad you got your trigger working now.

    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%]
    Ghostoo
    Mortal
    posted 22 April 2012 00:39 AM EDT (US)     973 / 1680       
    ok guys i'm back, and no dw i'll never ask you guys to look at my code for syntax errors again.
    This time my problem is a little different.. the trigger works but as soon as it tries to fire the game will freeze. I tried to have a timer within an activation of a trigger with multiple instances and clearly it didn't like that. I'm not so good at making in-depth triggers so i wouldn't know how to make a walk-around for something like this. I'll explain in a sec, first:

    <Effect name="Army Deploy in a line with delay">
    <Param name="SrcArmy" dispName="$$22348$$Army" VarType="group">default</Param>
    <Param name="ProtoName" dispName="$$22434$$ProtoName" varType="protounit">Villager</Param>
    <Param name="obj1" dispName="Between unit" varType="unit">default</Param>
    <Param name="obj2" dispName="and unit" varType="unit">default</Param>
    <Param name="Count" dispName="Per Distance" varType="long">1</Param>
    <Param name="spawn" dispName="Time Between Spawn (ms)" varType="long">1</Param>
    <Param name="Heading" dispName="$$22432$$Heading" varType="long">0</Param>
    <Command>trQuestVarSet("deployzz", 1);</Command>
    <Command>trQuestVarSet("xco", xsVectorGetX(kbGetBlockPosition("%obj2%")) - xsVectorGetX(kbGetBlockPosition("%obj1%")));</Command>
    <Command>if (0 > trQuestVarGet("xco") ){</Command>
    <Command>trQuestVarSet("xco", 0-trQuestVarGet("xco") );}</Command>
    <Command>trQuestVarSet("zco", xsVectorGetZ(kbGetBlockPosition("%obj2%")) - xsVectorGetZ(kbGetBlockPosition("%obj1%")));</Command>
    <Command>if (0 > trQuestVarGet("zco") ){</Command>
    <Command>trQuestVarSet("zco", 0-trQuestVarGet("zco") );}</Command>
    <Command>trQuestVarSet("divz", (trQuestVarGet("xco")*trQuestVarGet("xco"))+(trQuestVarGet("zco")*trQuestVarGet("zco")) );</Command>
    //-------------------------start taking square root--------------------------
    <Command>trQuestVarSet("isneg", 0);</Command>
    <Command>if (0 > trQuestVarGet("divz") ){</Command>
    <Command>trQuestVarSet("isneg", 1);</Command>
    <Command>trQuestVarSet("divz", 0-trQuestVarGet("divz"));}</Command>
    <Command>trQuestVarSet("asdfclose", 0);</Command>
    <Command>while ( trQuestVarGet("divz") >= (trQuestVarGet("asdfclose")*trQuestVarGet("asdfclose")) ){</Command>
    <Command>trQuestVarSet("asdfclose", trQuestVarGet("asdfclose") + 1);}</Command>
    <Command>trQuestVarSet("asdfclose", trQuestVarGet("asdfclose") - 1);</Command>
    <Command>if (trQuestVarGet("divz") == (trQuestVarGet("asdfclose")*trQuestVarGet("asdfclose")) ){</Command>
    <Command>trQuestVarSet("divz", trQuestVarGet("asdfclose"));}</Command>
    <Command>else {</Command>
    <Command>trQuestVarSet("dasdfclose", trQuestVarGet("divz") - (trQuestVarGet("asdfclose")*trQuestVarGet("asdfclose")) );</Command>
    <Command>trQuestVarSet("pasdfclose", trQuestVarGet("dasdfclose")/(2*trQuestVarGet("asdfclose")) );</Command>
    <Command>trQuestVarSet("aasdfclose", trQuestVarGet("asdfclose")+trQuestVarGet("pasdfclose") );</Command>
    <Command>trQuestVarSet("pasdfclose2", trQuestVarGet("pasdfclose")*trQuestVarGet("pasdfclose") );</Command>
    <Command>trQuestVarSet("divz", trQuestVarGet("aasdfclose")-(trQuestVarGet("pasdfclose2")/(2*trQuestVarGet("aasdfclose"))) );}</Command>
    <Command>if (trQuestVarGet("isneg") == 1){</Command>
    <Command>trQuestVarSet("divz", 0-trQuestVarGet("divz"));}</Command>
    //-------------------------finish taking square root-------------------------
    <Command>trQuestVarSet("divz", trQuestVarGet("divz")/(%Count%) );</Command> //the total distance divided by the amount per paces desired, giving the number of units to spawn
    <Command>while(trQuestVarGet("divz") > trQuestVarGet("deployzz")+0.5){</Command> //the number of units to spawn is greater than the amount spawned plus half (for rounding reasons)

    //----------------------------timer ms start-------------------
    <Command>if(trQuestVarGet("Accurate_Timer_QVasdftimermsac_DidFirstPass") == 0) {</Command>
    <Command>trQuestVarSet("Accurate_Timer_QVasdftimermsac_CompTime", trTimeMS());</Command>
    <Command>for(Accurate_Timer_QVasdftimermsac_IsTrue=0;>2) {}</Command>
    <Command>trQuestVarSet("Accurate_Timer_QVasdftimermsac_DidFirstPass", 1);</Command>
    <Command>}</Command>
    <Command>if((trTimeMS() - trQuestVarGet("Accurate_Timer_QVasdftimermsac_CompTime")) >= %spawn%) {</Command>
    <Command>for(Accurate_Timer_QVasdftimermsac_IsTrue=1;>2) {}</Command>
    <Command>trQuestVarSet("Accurate_Timer_QVasdftimermsac_DidFirstPass", 0);}</Command>
    <Command>if (Accurate_Timer_QVasdftimermsac_IsTrue == 1){</Command>
    //---------------------------finish timer---------------------
    <Command>trQuestVarSet("zzza",xsVectorGetX(kbGetBlockPosition("%obj1%")) + ((trQuestVarGet("xco")/trQuestVarGet("divz"))*trQuestVarGet("deployzz")));</Command>
    <Command>trQuestVarSet("zzzb",xsVectorGetY(kbGetBlockPosition("%obj1%")));</Command>
    <Command>trQuestVarSet("zzzc",xsVectorGetZ(kbGetBlockPosition("%obj1%")) + ((trQuestVarGet("zco")/trQuestVarGet("divz"))*trQuestVarGet("deployzz")));</Command>
    <Command>trArmyDispatch("%SrcArmy%", "%ProtoName%", 1, trQuestVarGet("zzza"), trQuestVarGet("zzzb"), trQuestVarGet("zzzc"), %Heading%, true);</Command> //spawn unit on next x paces
    <Command>trQuestVarSet("deployzz", trQuestVarGet("deployzz")+1);}}</Command>
    </Effect>

    The part for the timer is the part i added which freezes the game. I used (i think nottud's?) Timer Ms Accurate condition for the time. What it's going to do is spawn my unit on my line, but each spawn will have an x amount of milliseconds in between it.
    I think i remember reading you can't have things which require time inside of triggers.. like in the way i described. It won't hurt to ask though, right?

    EDIT: i also tried it with the normal time settings (the trTime and cActivationTime) and got the same problem

    [This message has been edited by Ghostoo (edited 04-22-2012 @ 00:47 AM).]

    Mister SCP
    Scenario Reviewer
    posted 22 April 2012 05:48 AM EDT (US)     974 / 1680       
    pretty simple reason: You cannot use timers in trigger effects... the while loop run forever and the time will not never be true. You have start a second trigger like i did with my Typewriter which write every few miliseconds another letter.

    Notes: it uses the AOE3 Typeloader which works like the AOM "Activate Triggerloader"

    new commands this trigger uses:
    QVSet ->trQuestVarSet
    QVr ->increase the QV +1 (QVraise)
    QVGet->trQuestVarGet
    And some new AOE3 effects
    all the array effects
    (compareable to trStringQuestVarGet/Set)


    <Effect name="Array: Typewriter *TL* SP">
    <Param name="Subtitle2" dispName="Before" varType="stringid"></Param>
    <Param name="Subtitle" dispName="$$22385$$Subtitle" varType="stringid"></Param>
    <Param name="Portrait" dispName="$$22386$$Portrait" varType="string"></Param>
    <Param name="ArrayName" dispName="Array" varType="string">Writer1</Param>
    <Param name="Id" dispName="Id" varType="long">1</Param>
    <Param name="Timeout" dispName="Timeout (msec.)" varType="long">1</Param>
    <Param name="A" dispName="Event" varType="event">-1</Param>
    <Command>QVSet("length",String_length("%Subtitle%"));</Command>
    <Command>QVSet("xtimex",trTimeMS()+%Timeout%);</Command>
    <Command>QVSet("pos",0);</Command>
    <Command>xsEnableRule("SCP_Typewriter%Id%");</Command>
    <Command>xsDisableSelf();}}</Command>
    <Command>rule SCP_Typewriter%Id%</Command>
    <Command> inactive</Command>
    <Command> highFrequency</Command>
    <Command>{</Command>
    <Command> if(trTimeMS() >= QVGet("xtimex"))</Command>
    <Command> {</Command>
    <Command> xsDisableSelf();</Command>
    <Command>QVr("pos");if (("?" == ""+String_charAt("%Subtitle%",QVGet("pos")))</Command>
    <Command><![CDATA[&& ("?" != ""+String_charAt("%Subtitle%",QVGet("pos")+1)) && ("?" == ""+String_charAt("%Subtitle%",QVGet("pos")+2))){]]></Command>
    <Command>QVr("pos");xsArraySetString(QVGet("%ArrayName%"),0, xsArrayGetString(QVGet("%ArrayName%"),0) + "" +String_toUpperCase(""+String_charAt("%Subtitle%",QVGet("pos"))));</Command>
    <Command>QVr("pos");}</Command>
    <Command>else {xsArraySetString(QVGet("%ArrayName%"),0, xsArrayGetString(QVGet("%ArrayName%"),0) + "" +String_charAt("%Subtitle%",QVGet("pos")));}</Command>
    <Command>trSoundPlayDialog("default","1", -1, true, "%Subtitle2%"+xsArrayGetString(QVGet("%ArrayName%"),0), "%Portrait%");</Command>
    <Command>if (QVGet("length") > QVGet("pos"))</Command>
    <Command>{QVSet("xtimex",trTimeMS()+%Timeout%);</Command>
    <Command>xsEnableRule("SCP_Typewriter%Id%");} else trEventFire(%A%);</Command>
    </Effect>

    I have simpliefid the system a bit

    <Effect name="Array: Typewriter *TL* SP">
    <Param name="Subtitle2" dispName="Before" varType="stringid"></Param>
    <Param name="Subtitle" dispName="$$22385$$Subtitle" varType="stringid"></Param>
    <Param name="Portrait" dispName="$$22386$$Portrait" varType="string"></Param>
    <Param name="ArrayName" dispName="Array" varType="string">Writer1</Param>
    <Param name="Id" dispName="Id" varType="long">1</Param>
    <Param name="Timeout" dispName="Timeout (msec.)" varType="long">1</Param>
    <Param name="A" dispName="Event" varType="event">-1</Param>
    <Command>QVSet("xtimex",trTimeMS()+%Timeout%);</Command>
    <Command>QVSet("pos",0);</Command>
    <Command>xsEnableRule("SCP_Typewriter%Id%");</Command>
    <Command>xsDisableSelf();}}</Command>
    <Command>rule SCP_Typewriter%Id%</Command>
    <Command> inactive</Command>
    <Command> highFrequency</Command>
    <Command>{</Command>
    <Command> if(trTimeMS() >= QVGet("xtimex"))</Command>
    <Command> {</Command>
    <Command> xsDisableSelf();//important</Command>
    <Command>//My effects</Command>
    <Command>if (QVGet("length") > QVGet("pos"))//if true loop itself, if not stop the loop</Command>
    <Command>{QVSet("xtimex",trTimeMS()+%Timeout%);//Sets the new timer since the effect is looped</Command>
    <Command>xsEnableRule("SCP_Typewriter%Id%");} else trEventFire(%A%);</Command>
    </Effect>


    and by the way you can see syntay errors by using invent00r`s debugger files.


    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 04-22-2012 @ 05:56 AM).]

    Ghostoo
    Mortal
    posted 22 April 2012 01:59 PM EDT (US)     975 / 1680       
    thanks SCP.
    -removed-

    [This message has been edited by Ghostoo (edited 04-22-2012 @ 03:27 PM).]

    « Previous Page  1 ··· 10 ··· 20 ··· 30 ··· 37 38 39 40 41 ··· 50 ··· 60 ··· 68  Next Page »
    You must be logged in to post messages.
    Please login or register

    Hop to:    

    Age of Mythology Heaven | HeavenGames