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

Scenario Design
Moderated by Yeebaagooon, TAG

Hop to:    
Welcome! You are not logged in. Please Login or Register.1670 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 ··· 63 64 65 66 67  Next Page »
Elrich
Hero
posted 23 July 2010 11:41 AM EDT (US)         
So you have a question trigger request?

You can post it here!



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



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

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

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

    Notes:

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


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

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

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

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


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

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



Resources

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

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




Posting a Request

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

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


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


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




Unfinished Requests

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

  • Finished Requests

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

  • Enjoy.
    Last updated: 03 september 2009

    In all your science of the mind, seeking blind through flesh and bone
    Find the blood inside this stone
    Well, I know I've never shown what I feel, I've always known
    I plan my vengeance on my own - and I was always alone
    AuthorReplies:
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 08 September 2017 09:02 AM EDT (US)     1601 / 1670       
    Thanks a lot I'm testing now

    But I've got also the same problem on the y search condition (the search targets vision revealers, and then the condition is the same (temple in 30 range = 0)


    Another request:
    Also I would like to know if it is possible to kill ONE single player slot god power, because if not it will be very very complicated to remove the god powers that I must give because I have to use plenty of minor gods to have their upgrades and myths.


    EDIT:
    the v condition for any player works perfectly now.
    The y not more... But I can use a work around (it is just that I want to understand what is going on and if this condition is usable).

    Also I would like to know if the condition we set when we start a v tpq (protunit, action, state...) are "better" in terms of processing than the other v condition.
    I mean, does the query target units that doesn't fill the start conditions and then remove from the targeted units (like a v condition)? Or does the query never target the units that doesn't fill ?
    In other terms, is it better to have for exemple 2 query for player 1 and 2 or one query with 99 and v condition player 1 OR v condition player 2 OR last ?

    [This message has been edited by eine_gurkensalad (edited 09-08-2017 @ 09:22 AM).]

    Yeebaagooon
    EXCO Emeritus
    posted 08 September 2017 02:47 PM EDT (US)     1602 / 1670       
    Trying to get some text to appear in the sky of a map. Have tried via circle triggers but think there must be some sort of built in limit that I can't circumvent.

    Another suggestion would be to use implode spheres with the change height tool in the editor superpack which is a bit more messy. Was wondering if anyone could think of a way to change the editor superpack height changer menu to raise/lower the height of a unit by a certain amount so everything is neat?

    Here's the code nottud uses in the superpack:
    <gadget name="Extra stuff3" closebutton="" type="gadget" size1024="805 300 1024 403" background="UI\ui_med_gray" bevel="" titlebar="Change certain unit heights" hidden="" windowzstyle="" closeonesc="" moveable="">
    <gadget name="up" type="button" bevel="" tooltiptext="close" textfont="Arial nodrop" textfontsize="12" size1024="810 330 1015 350">Move up
    <command>uiMoveUnitDown(1) uiMoveUnitUp(0)</command>
    </gadget>
    <gadget name="down" type="button" bevel="" tooltiptext="close" textfont="Arial nodrop" textfontsize="12" size1024="810 355 1015 375">Move down
    <command>uiMoveUnitUp(1) uiMoveUnitDown(0)</command>
    </gadget>
    <gadget name="stop" type="button" bevel="" tooltiptext="close" textfont="Arial nodrop" textfontsize="12" size1024="810 380 1015 400">Stop movement
    <command>uiMoveUnitUp(1) uiMoveUnitDown(1)</command>
    </gadget>
    </gadget>

    So looks like it's a binary command with either on/off being active. Is it possible to add a timer component so the height change is only active for 2 seconds?

    ______________________________________ Yeebaagooon ______________________________________
    ____________________ AoMH Seraph ____________________
    "I saw the picture and became immediately worried about Yeeb seducing and buying out Zen" - Shanks13
    "Yeebaagooon had never seen a more handsome man in all his life. He couldn't control himself, He needed to act. Gripping the mirror in his strong arms he kissed the figure before him..." - Out Reach
    AoMH: Unfinished Scenarios|Singleplayer: Codename Ripto 5.0|Multiplayer: Minigames X 4.7|CSC 7
    Ex Seraphs Dictator, Spore Heaven Seraph
    Lewonas
    Mortal
    posted 08 September 2017 03:20 PM EDT (US)     1603 / 1670       
    The yconditions behave exactly the same as the vconditions, so there shouldn't be any problems. I believe your trigger doesn't work because vision revealers can't be targeted by trigger functions. You need to use units that can be targeted (e.g. invisible target).

    As far as I know, you can't kill a god power in a specific slot. There're triggers that let you disable or hide the god powers in a specific slot which you can find in nottud's superpack. I'm not sure if they work for multiplayer though, but I doubt it's what you're looking for. I would just create a few quest vars that keep track of what god powers a player has in each god power slot. And if a god power in a specific slot has to be removed, use the player kill all god powers effect to remove all the god powers and then regrant all god powers except the one that needed to be removed. Update the god power slots quest vars accordingly.

    The performance difference between using multiple vTPQ start effects and a single one is almost negligible. The difference is like 19 primitive function calls for the single vTQP start effect versus 228 for 12 vTQP start effects for 12 players. Primitive functions are incredibly efficient which have a time complexity of O(1) which equals to something like very few milliseconds versus a bit more than very few milliseconds. So the difference in performance is basically very few milliseconds.

    The target protounit query searches all the units on the world within the radius and location the user provided and checks which ones meet all the criteria provided by the user. The the target protounit query can only be executed for 1 player at a time. So if you set the vTQP start effect's player parameter to 99, seperate protounit queries will be executed for all 12 players one after another. So basically all the units on the world within the radius and location the user provided will be searched 12 times. Not terribly efficient, but it's the way things work in AoM unfortunetaly. This is one reason why I prefer ytriggers (lookup iterations) over vtriggers (querying) because the former is much more efficient. Vtriggers are more user-friendly and convenient to use though.

    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 09-08-2017 @ 03:22 PM).]

    Lewonas
    Mortal
    posted 08 September 2017 03:43 PM EDT (US)     1604 / 1670       
    Yeebaagooon, I've done a similar thing creating numbers in the sky by using the implode spheres and change height function and it turned out looking great (but I removed it later on because it took up too much space). You only need to be careful choosing the height of your first sphere and then just use the copy/paste function which also copies the the sphere's new height. Positioning the spheres to make the letters look smooth and neat is going to be a chore and a half, enjoy. Once you've created (part of) a letter, you can just copy/paste all the spheres to reuse it, so it may not be as tiresome.

    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%]
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 08 September 2017 04:22 PM EDT (US)     1605 / 1670       
    Thank uou for this very interesting answer
    If I understood correctly, the first option (1 v tpq 99 then 2 plyer conditions with OR) will be much heavier than the second (2 v tpq with 1 different player) because in the first it will search 12 times the units while in the second it will search 2 times.

    I've heard that the v tpq is "faster and more reliable" than the y search I don't know if it's true...

    I can just say that most v tpq I use doesn't take time to be executed, which is quite strange because they are in all the map.

    Concerning the y trigger problem, I can say that the vision revealers are targeted by the y search (because they are deleted) but they aren't sorted by the condition temple in area.

    Maybe you said that the trigger function "units in area" can't begin from a vision revealer (which is the unit from which the search of the temples begins)

    Well I can trust you on the code, I will do more tests, unless you say that it is impossible.

    About the god powers, it will be very hard for me.

    Because each time we pass age with my civ, it launches about 2~4 minor gods in order to enable the upgrades and myth units.
    So each time up to 3 new god powers fill the slots, and then I'll remove all but what if the previous haven't been used ?
    I also have in addition some meteors SPC that can be granted to the player without going through ages...

    With a very complex quest var system, I will get it but it will be very complicated.

    So if I can find a work around I will be happy

    I can see in the techtree list that all god powers are present.
    I don't know why, but knowing how it work can help me to use it in order to disable one god power or forbid to get enabled.

    Is it possible ?

    EDIT I've seen also some effects "Tech Tree enabled godpower"
    in nottud's superpack
    <Effect name="$$22518$$Player Tech Tree Enabled God Powers">
    <Param name="Player" dispName="$$22301$$Player" varType="player">0</Param>
    <Param name="Enable" dispName="$$22519$$Enable" varType="bool">true</Param>
    <Command>trPlayerTechTreeEnabledGodPowers(%Player%, %Enable%);</Command>
    </Effect>
    another version:
    <Effect name="Player Tech Tree Enabled God Powers for all normal players">
    <Param name="Enable" dispName="$$22519$$Enable" varType="bool">true</Param>
    <Command>trQuestVarSet("PlayerID", 1);</Command>
    <Command>while(12>=trQuestVarGet("PlayerID")) {</Command>
    <Command>trPlayerTechTreeEnabledGodPowers(1*trQuestVarGet("playerID"), %Enable%);</Command>
    <Command>trQuestVarSet("PlayerID", trQuestVarGet("PlayerID")+1);}</Command>
    </Effect>

    I think this is exactly what I want, because with that we can do that no more god powers are granted by the minor gods, but the effect "grant god power" continue to work.

    And then we just enable with the same trigger when we reach age 4 so we can have a titan gate.

    So this is perfect, unless you say that it isn't a good way

    [This message has been edited by eine_gurkensalad (edited 09-08-2017 @ 05:55 PM).]

    Lewonas
    Mortal
    posted 08 September 2017 06:25 PM EDT (US)     1606 / 1670       
    If I understood correctly, the first option (1 v tpq 99 then 2 plyer conditions with OR) will be much heavier than the second (2 v tpq with 1 different player) because in the first it will search 12 times the units while in the second it will search 2 times.
    Correct.
    I've heard that the v tpq is "faster and more reliable" than the y search I don't know if it's true...
    It depends what you want to do. Unit queries are incredibly fast when they don't have to search a lot of units (small unit queries will outperform ytriggers by a very small margin). Ideally, you want to use the ytriggers for the world-wide unit searches or complicated unit queries (for instance queries involving secondary or even tertiary queries) all the time. You can use the vtriggers for everything else. What makes ytriggers so efficient is that the same units won't ever be searched twice unless you purposely add them to the database so you can use them later. This gives you, the designer, great control over the unit querying.
    Maybe you said that the trigger function "units in area" can't begin from a vision revealer (which is the unit from which the search of the temples begins)
    Yes, that's what I meant.

    And regarding the god powers, yes that tech tree effect is what you want to use. Nice find, I totally forgot about it.

    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%]
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 08 September 2017 06:53 PM EDT (US)     1607 / 1670       
    Interesting to know, so I have plenty of new things to learn.
    For now I was thinking that the y search was here "if the v-tpq can't" only but not necessarely.
    These database things seem to be interesting to (they seem to be able to replace armies as marker ?)

    About the vision revealer it means that some y conditional can't apply to some objects because y search is the most complete search so anything else including this y conditions will be less large.

    Concerning the speed, I think that a v tpq on a single player on all the map (as I use frequently) is faster than a y search (?) but this is not the case when this is 99.

    Also, the reason I prefer v tpq is that we can mix it with plenty of things in a same trigger not on loop, which is very useful.

    It isn't linked but I think I remember some bad issues when I had several fire event on a same trigger, is this always a bad idea or is it in some cases (or in my imagination ?)
    Lewonas
    Mortal
    posted 09 September 2017 01:21 PM EDT (US)     1608 / 1670       
    Yeah, the database functionality is great. You could first do a map-wide unit search and add the units you want in a database. Then you can use the database triggers to apply somekind of behaviour to these units. For instance, if an enemy unit is detected near 1 of these units, you could easily trigger all the other units in this database to attack that unit (so you've created an "combat aid" system where the units in a group come to each others aid to fight off enemies. This would also prevent players from pulling enemies one by one.).
    Concerning the speed, I think that a v tpq on a single player on all the map (as I use frequently) is faster than a y search (?) but this is not the case when this is 99.
    The ysearch triggers are better for map-wide unit searches, regardless of whether the scenario is designed for multi- or singleplayer. I think it would be interesting to see some comparison in performance of the two different search techniques. I'll look into it.
    Also, the reason I prefer v tpq is that we can mix it with plenty of things in a same trigger not on loop, which is very useful.
    You can also use the ytriggers in unlooped triggers. I've used them myself multiple times like that. But indeed, you'll generally use them in looped triggers for the most part. But sometimes it's desirable to only use them in unlooped triggers. It all depends on what you want to achieve really.
    It isn't linked but I think I remember some bad issues when I had several fire event on a same trigger, is this always a bad idea or is it in some cases (or in my imagination ?)
    I think I already answered you about that some time ago. Fire event effects themselves don't cause issues. You can literally have 1000 of them in a single trigger without causing any issues. It all depends on what kind of triggers get enabled by the fire event effects. For instance if you enable like 15 triggers which require many cpu resources, then you could run into issues.

    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 09-09-2017 @ 01:23 PM).]

    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 09 September 2017 03:52 PM EDT (US)     1609 / 1670       
    Thank you for this precisions

    Nottuds said that it was better in looped triggers because it needs this function to be synchronized with something from the game.
    If you use it without looping triggers, I can trust you of course.
    but it is possible that in looped trigger it is more reliable

    Sorry my question wasn't clear...

    I was asking if one trigger fired several times by several fire events (trigger a inactive with a not checked condition a', trigger b fires a, trigger c fires a, [...], condition a' checked)
    or smthg similar

    I also want to use string editable text so I'm searching the function that allows to use a string name in a message (in this case an unit name)
    I didn't find (tested things like "trQuestStringGet("stringname")
    Lewonas
    Mortal
    posted 11 September 2017 07:51 AM EDT (US)     1610 / 1670       
    I was asking if one trigger fired several times by several fire events (trigger a inactive with a not checked condition a', trigger b fires a, trigger c fires a, [...], condition a' checked)
    or smthg similar
    That's fine.
    I also want to use string editable text so I'm searching the function that allows to use a string name in a message (in this case an unit name)
    I didn't find (tested things like "trQuestStringGet("stringname")
    The trigger pack that comes with the trigger loader effect (which I assume you have) also comes with Quest String effects which work with strings. You need to activate the trigger loader before using these effects/conditions. (fyi, the tr commands for these effects start with trStringQuestVar)

    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%]
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 11 September 2017 03:28 PM EDT (US)     1611 / 1670       
    "That's fine." means "not a problem in any way" ?

    For the code I don't see how to do, I've tried with trStringQuestVarGet("stringname") but it did a trigger block
    without the " " it wasn't a code (it displayed as written)
    Even if I thought it wasn't the good way I tried also the exact code of the trigger loader:
    trStringQuestVarGet(string SQVname = "")
    it did exactly the same (trgr block if "" and nothing if no "").

    It is possible that it doesn't work on "Change Name for All Protounit" effect but it also doesn't work with "send chat to player"
    It is strange and it's a pity because it is very simpler for me.

    I also tried to convert a change name for all protounit effect into the same but with a string (I tried to make a mix of 2 triggers) but I don't have any xp for this so it didn't work, here is the code to correct if possible!

    <Effect name="Change Name For All Protounits string"> <Param name="Proto" dispName="$$22449$$ProtoUnit" varType="protounit">Villager</Param> <Param name="Plyr" dispName="$$22301$$Player" varType="long">1</Param> <Param name="NewName" dispName="New Name" varType="string">S1</Param> <Command>for(QID%Plyr%=-1;>0) {}</Command> <Command>QID%Plyr% = kbUnitQueryCreate2("Get_all_p%Plyr%_units", kbGetProtoUnitID("%Proto%"), -1, cUnitStateAliveOrBuilding, %Plyr%);</Command> <Command>for(count=0;>1) {} count = kbUnitQueryNumberResults(QID%Plyr%);</Command> <Command><![CDATA[for(i=0; < count) {]]></Command> <Command>for(UID=0;>1) {} UID = kbUnitQueryGetResult(QID%Plyr%, i);</Command> <Command>trUnitSelectClear();</Command> <Command>trUnitSelectByID(UID);</Command> <Command>trUnitChangeName(+trStringQuestVarGet("%NewName%")+);</Command> <Command>}</Command> </Effect>

    (How to avoid this line display ??)

    the original

    <Effect name="Change Name For All Protounits">
    <Param name="Proto" dispName="$$22449$$ProtoUnit" varType="protounit">Villager</Param>
    <Param name="Plyr" dispName="$$22301$$Player" varType="long">1</Param>
    <Param name="NewName" dispName="New Name" varType="string">My New Name</Param>
    <Command>for(QID%Plyr%=-1;>0) {}</Command>
    <Command>QID%Plyr% = kbUnitQueryCreate2("Get_all_p%Plyr%_units", kbGetProtoUnitID("%Proto%"), -1, cUnitStateAliveOrBuilding, %Plyr%);</Command>
    <Command>for(count=0;>1) {} count = kbUnitQueryNumberResults(QID%Plyr%);</Command>
    <Command><![CDATA[for(i=0; < count) {]]></Command>
    <Command>for(UID=0;>1) {} UID = kbUnitQueryGetResult(QID%Plyr%, i);</Command>
    <Command>trUnitSelectClear();</Command>
    <Command>trUnitSelectByID(UID);</Command>
    <Command>trUnitChangeName("%NewName%");</Command>
    <Command>}</Command>
    </Effect>

    the send chat with QV string effect (from which I stoled a bit of code)

    <Effect name="Send Chat With QV String">
    <Param name="PlayerID" dispName="$$22444$$From Player" VarType="long">0</Param>
    <Param name="Message" dispName="$$20056$$Message" VarType="stringid">default</Param>
    <Param name="QSName" dispName="String Name" VarType="string">S1</Param>
    <Param name="Message2" dispName="$$20056$$Message" VarType="stringid">default</Param>
    <Command>trChatSend(%PlayerID%,"%Message%"+trStringQuestVarGet("%QSName%")+"%Message2%");</Command>
    </Effect>


    Also I would like to know what is the use/principle of the "by name" effects (mostly from Nottud's editor superpack)

    [This message has been edited by eine_gurkensalad (edited 09-11-2017 @ 03:32 PM).]

    Milkman Matty
    Mortal
    (id: Khan And Steak)
    posted 12 September 2017 11:00 AM EDT (US)     1612 / 1670       
    I was asking if one trigger fired several times by several fire events
    You can expect no problems doing this. IT should function fine.
    Also I would like to know what is the use/principle of the "by name" effects (mostly from Nottud's editor superpack)
    These use the "scenario unit name" which is what is returned to the back end when you use the UI Trigger editor buttons to select a source/target unit. These are NOT the visible name of the unit. Confusing choice of words by the original developers I know.
    You can view the "scenario unit name" of a unit in the editor by looking at the object info window - and having a unit selected (see image below)

    trStringQuestVarGet(string SQVname = "")
    These custom functions from the Trigger Loader have always been a pain to use in my experience - most of the time they do not work as intended (although this might just be me)

    <||=================================||>
    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 Milkman Matty (edited 09-12-2017 @ 11:03 AM).]

    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 12 September 2017 11:49 AM EDT (US)     1613 / 1670       
    Thank you for this interesting answer !

    So for the name it was what I supposed but I really don't see what is the interrest/use of this because we can only have the name of existing units... But this units can be targeted by Every triggers sourcing an unit..

    So for the string get i will use a work around for now, but i will be happy if someone knows how to use !
    Lewonas
    Mortal
    posted 12 September 2017 01:04 PM EDT (US)     1614 / 1670       
    The main use of the "By Name" effects is to use them for units that aren't present on the map yet. For instance, let's say there is a special unit that appears on the map at certain time intervals which you want to give a few special behaviour rules. You use the ytriggers to detect this unit and then save its scenario name in a quest var. Then you can use all the "By Name" effects on this unit with this quest var. So basically, the units for the "By Name" effects can be targeted in a dynamic fashion as opposed to the regular effects which only offer a static selection of the source units.

    I personally have never experienced any problems with the trigger loader's custom functions. Are you sure you're activating the trigger loader in a trigger that was created before any other triggers that contain conditions/effects that require the trigger loader? A trigger lock would occur otherwise.

    As for your custom effect, there're a few small errors in the second to last command line:

    <Command>trUnitChangeName(+trStringQuestVarGet("%NewName%")+);</Command>

    Change it to:

    <Command>trUnitChangeName(""+trStringQuestVarGet("%NewName%"));</Command>

    Note that you're also using a custom trigger loader function in this effect, so activation of the trigger loader is required.

    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%]
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 12 September 2017 02:19 PM EDT (US)     1615 / 1670       
    Ok so it works with ytriggers, it can be very useful for me because I think that the effects used on a single name are very light for the processor (same as armies no ?).

    I was more using the "v add unit to army" effect, but for one unit alone this should be better.

    I can swear that I'm using the trigger loader in the first trigger, run immediately and active (no loop is required ?)

    Yeaaaah now this effect is perfect !
    But I don't have the knowledge of the code to write without an adaptated trigger :/ Anyway I really don't need this because this effect was the only one for which I wanted this.

    About the processing now:
    Does a v tpq with a protounit specified target all units and then untarget all except the protounit or does it target only the protounit ?
    Is a v-tpq lighter if we have an object at the center of the map and we do smgth like 180 for the area (on Midgard) or is it better for this values to put simply "-1"?

    EDIT: but... this name stuff it is the database no ?
    All is linked !

    [This message has been edited by eine_gurkensalad (edited 09-12-2017 @ 03:03 PM).]

    Milkman Matty
    Mortal
    (id: Khan And Steak)
    posted 13 September 2017 01:04 AM EDT (US)     1616 / 1670       
    I personally have never experienced any problems with the trigger loader's custom functions. Are you sure you're activating the trigger loader in a trigger that was created before any other triggers that contain conditions/effects that require the trigger loader? A trigger lock would occur otherwise.
    It's been a long time since I tried to use them because I have just assumed that they were broken after my first couple attempts at using them. I must admit it was some time ago. But everything else worked, they just always returned nothing. Maybe I should give them another shot.
    I can swear that I'm using the trigger loader in the first trigger, run immediately and active (no loop is required ?)
    The trigger loader does NOT need to be "run immediately" or even active. The trigger that has it is within is automatically disabled, and then the Trigger loader injects itself into the XS file directly beneath the trigger that has the effect in it.

    To ensure that you are adding it to the first trigger, you can look at the first trigger shown at the top of a "Fire Event" UI trigger.


    Or you can look in your /triggers2/trigtemp.xs file at the top and look for the first "rule _*trigger_name*" both tell you first trigger so just use which ever method is easiest for you.



    If you have not added the trigger loader to your first trigger, and your first trigger is used to do things - you can copy the entire first trigger - wire everything up to use the copy instead, and then replace the original trigger's effects with the triggerloader.

    <||=================================||>
    Proud Member of Forgotten Empires
    96Reviews KaS Dota2 Halo 5 Reach
    { "Work until your idols become your rivals" }
    ༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 13 September 2017 03:23 AM EDT (US)     1617 / 1670       
    Yeah it is the first trigger.

    But you said "does not need" , does it mean that it is better to use it in an inactive trigger or just it isn't useful to make that ?

    Thank you for this answer
    Milkman Matty
    Mortal
    (id: Khan And Steak)
    posted 13 September 2017 07:31 AM EDT (US)     1618 / 1670       
    does it mean that it is better to use it in an inactive trigger or just it isn't useful to make that
    It makes absolutely no difference whatsoever. Since the trigger loader disables the trigger its in anyway.

    <||=================================||>
    Proud Member of Forgotten Empires
    96Reviews KaS Dota2 Halo 5 Reach
    { "Work until your idols become your rivals" }
    ༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 13 September 2017 09:41 AM EDT (US)     1619 / 1670       
    OK thx, would be interesting to know how this effect work because it seems to be op
    Milkman Matty
    Mortal
    (id: Khan And Steak)
    posted 13 September 2017 05:32 PM EDT (US)     1620 / 1670       
    Playtest your scenario, when it loads immediately exit the playtest. Go to the trigtemp.xs file and look for the first trigger -- then you will see what it does ^_^

    <||=================================||>
    Proud Member of Forgotten Empires
    96Reviews KaS Dota2 Halo 5 Reach
    { "Work until your idols become your rivals" }
    ༼ つ ◕_◕ ༽つ trGetUnitScenarioName(); ༼ つ ◕_◕ ༽つ
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 19 September 2017 12:57 PM EDT (US)     1621 / 1670       
    Well I can see that even if it is inactive it is launched... but I can't see why! Anyway this isn't a problem for now the most important thing is that it works

    A question that was quite hidden:

    Does a v tpq with a protounit specified target all units and then untarget all except the protounit or does it target only the protounit ?

    Is a v-tpq lighter if we have an object at the center of the map and we do smgth like 180 for the area (on Midgard) or is it better for this values to put simply "-1"?
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 22 September 2017 05:04 PM EDT (US)     1622 / 1670       
    You use the ytriggers to detect this unit and then save its scenario name in a quest var. Then you can use all the "By Name" effects on this unit with this quest var.
    Well I tried with the database effect
    Don't know if it added to the database
    But the by name effects don't work if I put the same QV, and it makes a trigger block if I use the code trQuestVarGet("QVname")

    What is the good way ?
    scragins
    Heretic of December
    posted 22 September 2017 08:19 PM EDT (US)     1623 / 1670       
    I think there is a problem in your syntax, trQuestVarGet should not cause trigger lock. It is probably one of the top five commands I use in my triggers.
    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 23 September 2017 01:40 AM EDT (US)     1624 / 1670       
    So you think that this code is the good way. I will try asap.

    EDIT

    Now it's ok I hadn't the good piece of code, the real is
    "+(1*trQuestVarGet("Database1"))+" because this is a string.

    But I'm surprised because I suppose that most people have this by name effects, and most people don't know how to run them (just like me before today :,/)

    [This message has been edited by eine_gurkensalad (edited 09-23-2017 @ 02:36 PM).]

    eine_Gurkensalat
    Mortal
    (id: eine_gurkensalad)
    posted 25 September 2017 09:50 AM EDT (US)     1625 / 1670       
    I was wondering, though it has nothing urgent, if it is possible to mix y triggers and v ones.
    This will be smthg like "yv Secondary Target Protounit Start" which will search units around each units found by the y search
    « Previous Page  1 ··· 10 ··· 20 ··· 30 ··· 40 ··· 50 ··· 63 64 65 66 67  Next Page »
    You must be logged in to post messages.
    Please login or register

    Hop to:    

    Age of Mythology Heaven | HeavenGames