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

Scenario Design
Moderated by MosheLevi, Mister SCP

Hop to:    
Welcome! You are not logged in. Please Login or Register.849 replies, Sticky
Age of Empires III Heaven » Forums » Scenario Design » Have a Trigger Request? Post it here!
Bottom
Topic Subject:Have a Trigger Request? Post it here!
« Previous Page  1 ··· 9 10 11 12 13 ··· 20 ··· 30 ··· 34  Next Page »
Mister SCP
Scenario Reviewer
posted 05-22-09 02:11 AM EDT (US)         
So you have a 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.


    ------------------------------------------------------------ --------------------

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

    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 AOE§ installation folder. C:\Program Files\Microsoft Games\Age of Empires3 by default).
    Now open the trigger folder if you use vanilla -trigger1, if you use TWC -trigger2, and finally if you use TAD go to -trigger3.
    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 ,
    if you requested an effect paste it right above . Note the "s" at the end of both tags.

    Notes:

  • When copying the trigger from someone please click first and only then copy the required code.

  • If you're still uncomfortable with installing triggers please backup the original typetest file, i.e. copy the original to another folder.

    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.


    Help! My triggers have stopped working! If this doesnt help you can send an email including your scenario to mister.scp@gmail.com.


    ------------------------------------------------------------ --------------------

    Recommended Downloads:
    -Advanced Trigger Set
    -My Trigger Set
    -Gunner`s Trigger Set
    -Random22`s Trigger Set
    -Hedanito`s Trigger Set
    -Kolt`S Trigger Set
    -SH Trigger
    -M925's Trigger Set

    ------------------------------------------------------------ --------------------


    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. An example can be a great help when requesting complex triggers.

    [b]Name[/b]
    [b]Description[/b]
    [b]Params[/b]
    (A List of Params. If you are pretty nice you set them in the context with your request.)


    Unfinished Requests

    -a lot

    Finished Requests
    -even more (list isnt up to date)

    Not Possible:
    -Fixing Modify Protounit
    -Fixing Chat Contain
    -Change name of the protounit which affect also the name when you train it
    ------------------------------------------------------------ --------------------
    Additional: XS - Basics (mostly based on pftq's guide for XS - Effects + Conditions)

    XS - Triggers are a bit different from other triggers, since they use strings instead for e.g. PlayerID, Unit Select...
    The key highlight of these effects/conditions is to allow Unit Selections to be specified by number or QV. This makes great use of the effects which set QV to an OBJECT ID and opens up a whole new world of possibilites.

    This includes all original and new effects/conditions with ALL appliable fields set to use ANY form of data, including but not limited to:
  • -- Quest Var Code: enter trQuestVarGet("QVNAME")
  • -- Player Stats: enter trGetStatValue(PLAYER, STATID_NUMBER) e.g. trGetStatValue(1, 2)-> count "Enemy Units Killed" for Player 1
  • -- Math Operations: (5*PlayerStat) ...allowed are + - * / as Math Operations
  • -- Any XS Code: (just open the typetest.xml and start digging!)

    typical strings: (strings with * have additional informations on the bottom)
  • Amount (of resources), Radius, Headings, Duration, Damage Percent, Count (e.g. in Army Deploy), Rate (e.g. of Construction), Value
  • the table of PlayerID´s is a string
  • Operators* (don't use any numbers for them!)
  • Center Unit OBJECT ID/Source Unit OBJECT ID/Target Unit OBJECT ID **
  • Unit Type ID /ProtounitID ***



  • *Operators you can use are:
    == equal to
    >= equal to or higher
    <= equal to or lower
    > higher
    < lower
    != is not equal to

  • **The Unit Selections require an OBJECT ID. This is NOT the same as a NAME ID (like in Reyk's triggers). To find an OBJECT ID, use the supplied "QV Set.. OBJECT ID" effects OR select a unit and open the "Object Info" window. Open the Object Debug Info Window if you are using Age of Empires III and the ID is not readily available in the "Object Info".


    The first amount show you the Unit ID, every unit have a unique one. The third amount show you the Unit Type ID/ Protounit ID. Every MercJaeger have the ProtounitID -387-. Note that you can select ALL Units with Unit ID's but not even all with Protounit ID like cinematic blocks.

    1. ***TO USE NAME IDS: If you have the Name ID of a unit, you can convert it to OBJECT ID by using the kbGetBlockID("") function.
    2. ***For string (text) IDs, example: kbGetBlockID("ThisIsMyUnit")
    3. ***For QV, example: kbGetBlockID(""+trQuestVarGet("ThisIsMyQV"))
    4. ***For # NAME ID, example: kbGetBlockID("NUMBER")
      *** Generally, you can use kbGetBlockID(""+ID) for all, except text. As said above, enclose the text entirely with the quotes.


~MisterSCP


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 08-21-2011 @ 03:07 AM).]

AuthorReplies:
Mister SCP
Scenario Reviewer
posted 06-08-10 10:59 AM EDT (US)     251 / 849       
   <Effect name="QV Grant Resources">
<Param name="PlayerID" dispName="$$22301$$Player" varType="long">0</Param>
<Param name="ResName" dispName="$$22455$$Resource" varType="resource">food</Param>
<Param name="QVName" dispName="$$32954$$Var Name" VarType="string">QV1</Param>
<Command>trPlayerGrantResources(%PlayerID%, "%ResName%", trQuestVarGet("%QVName%"));</Command>
</Effect> <Effect name="QV Set Player Resource Count">
<Param name="PlayerID" dispName="$$22301$$Player" VarType="player">1</Param>
<Param name="Resource" dispName="$$22324$$Resource" VarType="resource">food</Param>
<Param name="QVName" dispName="$$23952$$Var Name" VarType="string">QV1</Param>
<Command>trQuestVarSet("%QVName%", trPlayerResourceCount(%PlayerID%, "%Resource%"));</Command>
</Effect>

The last cant be done


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
Jelmer
Skirmisher
posted 06-11-10 02:24 PM EDT (US)     252 / 849       
Well this is not possible. Just possible if you can't anymore build this unit, in this case you can raise kill costs and check the kill costs with another trigger

you're sure it is not possible?
and without the param to choose how many?

This is where i need it for:

You need to kill 50 musketeers.
When one musketeer is killed, the QV muske gets +1 (modefy QV)
When QV musket == 50 the objective will be done.(compare QV)

Any otherways to do it?
musketeer925
Skirmisher
posted 06-11-10 10:07 PM EDT (US)     253 / 849       
There are absolutely no ways to do it. It's that simple. There's no command to see how many of a certain protounit you have killed. It doesn't matter how you go about doing it, its juts doing it thats the problem
Jelmer
Skirmisher
posted 06-14-10 02:42 PM EDT (US)     254 / 849       
i also need a trigger called "play scenario"
params:
file, then you will be able to choose from your scenario folder (if not possible jut type the filename)

Effect will be: You advance to that scenario.
just like advance campaign on AOM
kjnn
Skirmisher
posted 06-14-10 04:02 PM EDT (US)     255 / 849       
@Jelmer
If you go to page 6 of this thread and scroll to the bottom. You will see the code for "Load scenario" It's a custom trigger by reyk..It seems to work alright and should do what you're after.
Regards

[This message has been edited by kjnn (edited 06-14-2010 @ 04:03 PM).]

Jelmer
Skirmisher
posted 06-15-10 09:39 AM EDT (US)     256 / 849       
thanks... i was to lazy to check myself
Mister SCP
Scenario Reviewer
posted 06-16-10 03:11 PM EDT (US)     257 / 849       
For PRO Trigger Scripters:
Arrays:
Pro Store: Strings, Floats and Ints
1.Step: Use Array: Create (Type:0=Int, 1=Float, 2=String
2.Use Array Set (Int/Float/String) Value
Important: When you defines a String Array you need to use "Array Set String Value", for Floats use "Array Set Float Value" and for Integers use "Array Set Int Value". Else your Triggers will BREAK!

To get them use
1.For Ints: xsArrayGetInt(trQuestVarGet("YourUsedQV"),Position[is a Integer like 1 or 5])
2.For Floats: xsArrayGetFloat(trQuestVarGet("YourUsedQV"),PositionNumber)
3.For Strings: xsArrayGetString(trQuestVarGet("YourUsedQV"),PositionNumber)

Why Do I need trQuestVarGet("...MyQV...")?
Because the Array is saved by an ID. The first Array you create may have the ID 0. The QV actually contains the ID so it is important NOT to change your QV with QV Modify or QV Set. In best case it is a unique QV. If you change your ID you will refer either to another Array or to an Array that does NOT exist

Effects:



<Effect name="Array: Create">
<Param name="Type" dispName="Type" varType="string">0</Param>
<Param name="qvnamexd" dispName="Type: Integer" varType="string">0</Param>
<Param name="qvnamexd" dispName="Type: Float" varType="string">1</Param>
<Param name="qvnamexd" dispName="Type: String" varType="string">2</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Max Amount of Positions" varType="string">10</Param>
<Command>if (%Type%==0) trQuestVarSet("%qvname%",xsArrayCreateInt(%Max%, -1, "%qvname%"));</Command>
<Command>if (%Type%==1) trQuestVarSet("%qvname%",xsArrayCreateFloat(%Max%, -1.0, "%qvname%"));</Command>
<Command>if (%Type%==2) trQuestVarSet("%qvname%",xsArrayCreateString(%Max%, " ", "%qvname%"));</Command>
</Effect>

<Effect name="Array: Set Int Value">
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Value" dispName="Value" varType="string">1</Param>
<Command>xsArraySetInt(trQuestVarGet("%qvname%"), %Max%, %Value%);</Command>
</Effect>
<Effect name="Array: Set Float Value">
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Value" dispName="Value" varType="string">1.0</Param>
<Command>xsArraySetFloat(trQuestVarGet("%qvname%"), %Max%, %Value%);</Command>
</Effect>
<Effect name="Array: Set String Value">
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Value" dispName="Value" varType="string">MyString</Param>
<Command>xsArraySetString(trQuestVarGet("%qvname%"), %Max%, "%Value%");</Command>
</Effect>



Wish you nice ideas with the possibilty to store Strings and Numbers. I for my self will do a inventory system for RPG's


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 06-16-2010 @ 03:42 PM).]

As_Saffah
Scenario Reviewer
posted 06-16-10 06:01 PM EDT (US)     258 / 849       
I sorta get the general idea of what these are all about - you use the effects to save and recall a value, integer, or floating result.

Can you give us a specific example how we might see this used in an RPG scenario e.g. an inventory system, as you mentioned?

Crunkatog on ESO
Bart331 balance suggestion: aztec: remove civ
Voltiguer: Ender, Sioux in 1.04 will be a top civ, no matter how many layers of Sioux goggles you put on
schildpad on Elephants: ...their mansabdar unit sucks so hard it looks like a black hole
Crunkatog on Steam.
Mister SCP
Scenario Reviewer
posted 06-17-10 03:45 AM EDT (US)     259 / 849       
We (me and musketeer925) are working on basic effects as Array: Echo and compare conditions as Array: Check, sort algoríthmen for strings and numbers. As well we are working on Methodes to isolates Letters of the Strings. So after that we will release Inventory system (nearly done) and others with practical use for scenario designers.

I have written these in my IT lessons . I havent tested them yet so i guess they don't work. I'll fix them at afternoon
Inventory: Array Create
Inventory: Array Set Item
Inventory: QV Get Item Position
Inventory: Kill Item
Inventory: Echo Item
Inventory: Echo All Items
Inventory: Modify Item Number


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 06-17-2010 @ 04:53 AM).]

Mister SCP
Scenario Reviewer
posted 06-18-10 01:03 PM EDT (US)     260 / 849       
Array: Echo done (Array Echo All must be done)
Array: Check done
sort algoríthmen for strings and numbers not yet done
Methodes to isolates Letters of the Strings done
Inventory system done
Save Used Techs (since if you load a scen it forget about used techs) not yet done
some others

Some of them as Inventory and Isolate Letters use the latest version of Typeloader which isnt uploaded yet... the new typeloader is about 347 lines


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 06-18-2010 @ 01:09 PM).]

Mister SCP
Scenario Reviewer
posted 06-20-10 04:49 AM EDT (US)     261 / 849       
New Array Effects:



<Effect name="Array: Set String Player Name">
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="PlayerID" dispName="Player" varType="string">1</Param>
<Command>xsArraySetString(trQuestVarGet("%qvname%"), %Max%, ""+kbGetPlayerName(%PlayerID%));</Command>
</Effect>

<Effect name="Array: Echo">
<Param name="Type" dispName="Int/Float/String" varType="string">Int</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Note" dispName="Note" varType="string">Don't include Array data</Param>
<Command>trChatSend(0,""+xsArrayGet%Type%(trQuestVarGet("%qvname%"),%Max%)+"");</Command>
</Effect>
<Effect name="Array: Echo2">
<Param name="Type" dispName="Int/Float/String" varType="string">Int</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Note" dispName="Note" varType="string">Include Array data</Param>
<Command>trChatSend(0,"Array(%qvname%,%Max%): "+xsArrayGet%Type%(trQuestVarGet("%qvname%"),%Max%)+"");</Command>
</Effect>
<Effect name="Inventory: Array Create">
<Param name="qvname" dispName="QV Name of Inventory Array" varType="string">Inventory</Param>
<Param name="Max" dispName="Max Amount of Different Item" varType="string">10</Param>
<Param name="Max2" dispName="Kill Items with Amount of 0" varType="bool">true</Param>
<Command> trQuestVarSet("%qvname%1",xsArrayCreateInt(%Max%, 0, "%qvname%"));</Command>
<Command>trQuestVarSet("%qvname%2",xsArrayCreateString(%Max%, " ", "%qvname%2"));</Command>
<Command>trQuestVarSet("%qvname%3",%Max%);</Command>
<Command>if (%Max2% == true)trQuestVarSet("%qvname%4",1);</Command>
</Effect>
<Effect name="Inventory: Array Set Item *TL*">
<Param name="qvname" dispName="QV Name of Array" varType="string">Inventory</Param>
<Param name="Pos" dispName="known Position or -1" varType="string">-1</Param>
<Param name="Value2" dispName="Item Name" varType="string">Item</Param>
<Param name="Value" dispName="Count" varType="string">1</Param>
<Command>if (%Pos% !=-1) {</Command>
<Command>xsArraySetInt(trQuestVarGet("%qvname%1"), %Pos%, %Value%);</Command>
<Command>xsArraySetString(trQuestVarGet("%qvname%2"), %Pos%, "%Value2%");}</Command>
<Command>else {</Command>
<Command>for (i=xsArrayGetStringPos(trQuestVarGet("%qvname%2"),"%Value2%",trQuestVarGet("%qvname%3"));>50000){}</Command>
<Command>if (i !=-1) {</Command>
<Command>xsArraySetInt(trQuestVarGet("%qvname%1"), i, %Value%);</Command>
<Command>xsArraySetString(trQuestVarGet("%qvname%2"), i, "%Value2%");}</Command>
<Command>else {for (j=xsArrayGetStringPos(trQuestVarGet("%qvname%2")," ",trQuestVarGet("%qvname%3"));>50000){}</Command>
<Command>xsArraySetInt(trQuestVarGet("%qvname%1"), j, %Value%);</Command>
<Command>xsArraySetString(trQuestVarGet("%qvname%2"), j, "%Value2%");}}</Command>
</Effect>
<Effect name="Inventory: QV Get Item Position *TL*">
<Param name="qvname" dispName="QV Name of Array" varType="string">Inventory</Param>
<Param name="Value" dispName="Item Name" varType="string">Item</Param>
<Param name="qvname2" dispName="Output QV" varType="string">QV1</Param>
<Command>trQuestVarSet("%qvname2%",xsArrayGetStringPos(trQuestVarGet("%qvname%2"),"%Value%",trQuestVarGet("%qvname%3")));</Command>

</Effect>
<Effect name="Inventory: Kill Item">
<Param name="qvname" dispName="QV Name of Array" varType="string">Inventory</Param>
<Param name="Value2" dispName="Item Name" varType="string">Item</Param>
<Command><![CDATA[for (j=-1;<=trQuestVarGet("%qvname%3")) {]]></Command>
<Command>if (""+xsArrayGetString(trQuestVarGet("%qvname%2"),j)=="%Value2%") break;}</Command>
<Command>xsArraySetInt(trQuestVarGet("%qvname%1"), j, 0);</Command>
<Command>xsArraySetString(trQuestVarGet("%qvname%2"), j," ");}</Command>
</Effect>
<Effect name="Inventory: Echo Item">
<Param name="qvname" dispName="QV Name of Array" varType="string">Inventory</Param>
<Param name="Value2" dispName="Item Name" varType="string">Item</Param>
<Command><![CDATA[for (j=-1;<=trQuestVarGet("%qvname%3")) {]]></Command>
<Command>if (""+xsArrayGetString(trQuestVarGet("%qvname%2"),j)=="%Value2%") break;}</Command>
<Command>if (""+xsArrayGetString(trQuestVarGet("%qvname%2"),j)=="%Value2%") trChatSend(0,""+xsArrayGetInt(trQuestVarGet("%qvname%1"), j)+"x "+xsArrayGetString(trQuestVarGet("%qvname%2"),j)+"");</Command>
</Effect>
<Effect name="Inventory: Echo All Items">
<Param name="qvname" dispName="QV Name of Array" varType="string">Inventory</Param>
<Command><![CDATA[for (j=-1;<=trQuestVarGet("%qvname%3")) {]]></Command>
<Command><![CDATA[if ((""+xsArrayGetString(trQuestVarGet("%qvname%2"),j)!=" ") && (""+xsArrayGetString(trQuestVarGet("%qvname%2"),j)!=""))]]></Command>
<Command>trChatSend(0,""+xsArrayGetInt(trQuestVarGet("%qvname%1"), j)+"x "+xsArrayGetString(trQuestVarGet("%qvname%2"),j)+"");}</Command>
</Effect>
<Effect name="Inventory: Modify Item Number *TL*">
<Param name="qvname" dispName="QV Name of Array" varType="string">Inventory</Param>
<Param name="Value2" dispName="Item Name" varType="string">Item</Param>
<Param name="op" dispName="op" varType="string">+</Param>
<Param name="NewCount" dispName="Modify by" varType="string">1</Param>
<Command>for (j=xsArrayGetStringPos(trQuestVarGet("%qvname%2"),"%Value2%",trQuestVarGet("%qvname%3"));>50000){}</Command>
<Command>if (j!=-1){</Command>
<Command>xsArraySetInt(trQuestVarGet("%qvname%1"),j,xsArrayGetInt(trQuestVarGet("%qvname%1"), j) %op% %NewCount%);</Command>
<Command><![CDATA[if ((xsArrayGetInt(trQuestVarGet("%qvname%1"), j))<=0 &&(trQuestVarGet("%qvname%4")==1)){]]></Command>
<Command>xsArraySetInt(trQuestVarGet("%qvname%1"), j, 0);</Command>
<Command>xsArraySetString(trQuestVarGet("%qvname%2"), j," ");</Command>
<Command><![CDATA[for (i=j+1;< trQuestVarGet("%qvname%3")) {]]></Command>
<Command>if (""+xsArrayGetString(trQuestVarGet("%qvname%2"),i)!=" ")</Command>
<Command>xsArrayStringSwap(trQuestVarGet("%qvname%2"),i,i-1);}}}</Command>
</Effect>
<Effect name="Array: Modify Numbers">
<Param name="Type" dispName="Int/Float" varType="string">Int</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Op" dispName="$$22297$$Operator" varType="string">+</Param>
<Param name="Value" dispName="Value" varType="string">1</Param>
<Command>xsArraySet%Type%(trQuestVarGet("%qvname%"), %Max%, xsArrayGet%Type%(trQuestVarGet("%qvname%"), %Max%) %Op% %Value%);</Command>
</Effect>
<Effect name="Tech: Array Create">
<Param name="qvname" dispName="QV Name of Tech Array" varType="string">Tech</Param>
<Param name="Max2" dispName="Note" varType="string">Used to save all used techs in order to load a game (else it forgot all)</Param>
<Command> trQuestVarSet("%qvname%1",xsArrayCreateInt(50000, 0, "%qvname%1"));</Command>
<Command>trQuestVarSet("%qvname%2",xsArrayCreateInt(50000, -1, "%qvname%2"));</Command>
<Command>trQuestVarSet("%qvname%3",xsArrayCreateInt(50000, 0, "%qvname%3"));</Command>
</Effect>
<Effect name="Set Tech Status SP *TL*">
<Param name="qvname" dispName="QV Name of Tech Array" varType="string">Tech</Param>
<Param name="PlayerID" dispName="$$22301$$Player" varType="player">1</Param>
<Param name="TechID" dispName="$$22311$$Tech" varType="tech">0</Param>
<Param name="Status" dispName="$$22340$$Status" varType="techstatus">2</Param>
<Command>trTechSetStatus(%PlayerID%, %TechID%, %Status%);</Command>
<Command>for (j=xsArrayGetIntPos(trQuestVarGet("%qvname%2"),-1,49999);>50000){}</Command>
<Command>xsArraySetInt(trQuestVarGet("%qvname%1"), j,%PlayerID%);</Command>
<Command>xsArraySetInt(trQuestVarGet("%qvname%2"), j,%TechID%);</Command>
<Command>xsArraySetInt(trQuestVarGet("%qvname%3"), j,%Status%);</Command>
</Effect>
<Effect name="Set Tech Status For Lost Techs">
<Param name="qvname" dispName="QV Name of Tech Array" varType="string">Tech</Param>
<Param name="PlayerID" dispName="$$22301$$Player" varType="player">1</Param>
<Param name="TechID" dispName="$$22311$$Tech" varType="tech">0</Param>
<Param name="Status" dispName="$$22340$$Status" varType="techstatus">2</Param>
<Command>trTechSetStatus(%PlayerID%, %TechID%, %Status%);</Command>
<Command><![CDATA[for (j=0;<=50000){]]></Command>
<Command>if (xsArrayGetInt(trQuestVarGet("%qvname%2"),j)==-1) {break;}</Command>
<Command>else{</Command>
<Command>trTechSetStatus(xsArrayGetInt(trQuestVarGet("%qvname%1"),j), xsArrayGetInt(trQuestVarGet("%qvname%2"),j), xsArrayGetInt(trQuestVarGet("%qvname%3"),j));}}</Command>
</Effect>




New Array Conditions:
<Condition name="Array: Check Strings"> <Param name="Type" dispName="Int/Float/String" varType="string">Int</Param> <Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param> <Param name="Max" dispName="Position" varType="string">1</Param> <Param name="Op" dispName="$Operator ==/!=" VarType="string">==</Param> <Param name="Count" dispName="String" VarType="string">1</Param> <Expression>""+xsArrayGetString(trQuestVarGet("%qvname%"),%Max%) %op% "%Count%"</Expression> </Condition> <Condition name="Array: Check Numbers"> <Param name="Type" dispName="Int/Float" varType="string">Int</Param> <Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param> <Param name="Max" dispName="Position" varType="string">1</Param> <Param name="Op" dispName="$$22297$$Operator" VarType="string">==</Param> <Param name="Count" dispName="Count" VarType="string">1</Param> <Expression>xsArrayGet%Type%(trQuestVarGet("%qvname%"),%Max%) %op% %Count%</Expression> </Condition>
New Typeloader!!!!!!!!!
<Effect name="Typeloader (TL)"> <Effect name="Typeloader (TL)"> <Param name="info1" dispName="Info" varType="string">This trigger loads custom functions that can be used by other triggers.</Param> <Param name="info2" dispName="Info" varType="string">Please load this effect in an empty trigger before you add triggers that need this.</Param> <Param name="info3" dispName="Info" varType="string">The triggers requiring this should mention it somewhere. Not all triggers need it.</Param> <Param name="luis" dispName="AI Get Random:" VarType="strwing">%u</Param> <Param name="mod" dispName="Don't touch this!" varType="strwing">%%</Param> <Command>}</Command> <Command>}</Command> <Command>const float PI = 3.14159265358979323846;</Command> <Command>const float e = 2.71828182845904523536;</Command> <Command>/**/ int tla=0;</Command> <Command>/**/ int tlb=0;</Command> <Command>/**/ int tlc=0;</Command> <Command>/**/ int tlpla=0;</Command> <Command>/**/ int ucxs=0;</Command> <Command>/**/ int ress=0;</Command> <Command>/**/ float fla=0;</Command> <Command>/**/ float flb=0;</Command> <Command>/**/ float flc=0;</Command> <Command>/**/ float flucs=0;</Command> <!-- Fact n! Math_fact(n)--> <Command>float Math_fact(int n = 0) {</Command> <Command> float r = 1;</Command> <Command>for(i = n; >= 1) {r = r * i;}</Command> <Command>return (r);</Command> <Command>}</Command> <Command>int kbGetTechID(string techname = ""){</Command> <Command><![CDATA[for (i=-1;<5274){]]></Command> <Command>if (kbGetTechName(i)==techname) break;}</Command> <Command>if (i==5274) i=-1;</Command> <Command>return(i);}</Command> <!-- Exponent n^x Math_pow(n,x)--> <Command>float Math_pow(float n = 0, int x = 0) {</Command> <Command>float r = n;</Command> <Command>if (x >=0 ) {</Command> <Command>for(i = x; > 1) r = r * n;</Command> <Command>}</Command> <Command>else</Command> <Command>{</Command> <Command>for(i = 0.0-x; > 1) r = r * n;</Command> <Command>r=1.0/r;}</Command> <Command>return (r);</Command> <Command>}</Command> <!-- Sine ->Radians<- Math_sinRad(n)--> <Command>float Math_sinRad(float n = 0) { //Matei</Command> <Command> float r = n;</Command> <Command> <![CDATA[for(i = 1; < 100) {]]></Command> <Command> int j = i * 2 + 1;</Command> <Command> float k = Math_pow(n,j) / Math_fact(j);</Command> <Command> if(k == 0) break;</Command> <Command> if(i %mod% 2 == 0) r = r + k;</Command> <Command> if(i %mod% 2 == 1) r = r - k;</Command> <Command> }</Command><Command> return (r);</Command> <Command>}</Command> <!-- Sine ->Degrees<- Math_sin(n)--> <Command>float Math_sin(float n = 0) { //Matei</Command> <Command>n=n*PI/180.0;</Command> <Command> float r = n;</Command> <Command> <![CDATA[for(i = 1; < 100) {]]></Command> <Command> int j = i * 2 + 1;</Command> <Command> float k = Math_pow(n,j) / Math_fact(j);</Command> <Command> if(k == 0) break;</Command> <Command> if(i %mod% 2 == 0) r = r + k;</Command> <Command> if(i %mod% 2 == 1) r = r - k;</Command> <Command> }</Command><Command> return (r);</Command> <Command>}</Command> <Command>float Math_cos(float n = 0) { //Matei</Command> <Command>n=n*PI/180.0;</Command> <Command> float r = 1;</Command> <Command> <![CDATA[for(i = 1; < 100) {]]></Command> <Command> int j = i * 2;</Command> <Command> float k = Math_pow(n,j) / Math_fact(j);</Command> <Command> if(k == 0) break;</Command> <Command> if(i %mod% 2 == 0) r = r + k;</Command> <Command> if(i %mod% 2 == 1) r = r - k;</Command> <Command> }</Command> <Command> return (r);</Command> <Command>}</Command> <Command>float Math_cosRad(float n = 0) { //Matei</Command> <Command> float r = 1;</Command> <Command> <![CDATA[for(i = 1; < 100) {]]></Command> <Command> int j = i * 2;</Command> <Command> float k = Math_pow(n,j) / Math_fact(j);</Command> <Command> if(k == 0) break;</Command> <Command> if(i %mod% 2 == 0) r = r + k;</Command> <Command> if(i %mod% 2 == 1) r = r - k;</Command> <Command> }</Command> <Command> return (r);</Command> <Command>}</Command> <Command>float Math_tan(float n = 0) {</Command> <Command>n=n*PI/180.0;</Command> <Command>return (Math_sin(n)/Math_cos(n));</Command> <Command>}</Command> <Command>float Math_tanRad(float n = 0) {</Command> <Command>return (Math_sin(n)/Math_cos(n));</Command> <Command>}</Command> <Command>float xsArrayGetStringPos(float n = 0,string i="",float k=0) {</Command> <Command><![CDATA[for (j=-1;<=k) {]]></Command> <Command>if (""+xsArrayGetString(n,j)==""+i) break;}</Command> <Command>if (""+xsArrayGetString(n,j)!=""+i) j=-1;</Command> <Command>return(j);}</Command> <Command>float xsArrayGetIntPos(float n = 0,int i=0,float k=0) {</Command> <Command><![CDATA[for (j=-1;<=k) {]]></Command> <Command>if (xsArrayGetInt(n,j)==i) break;}</Command> <Command>if (xsArrayGetInt(n,j)!=i) j=-1;</Command> <Command>return(j);}</Command> <Command>void xsArrayStringSwap(float n = 0,float i=0,float k=0) {</Command> <Command>string o=""+xsArrayGetString(n,i);</Command> <Command>string p=""+xsArrayGetString(n,k);</Command> <Command>xsArraySetString(n, i, ""+p);</Command> <Command>xsArraySetString(n, k, ""+o);}</Command> <Command>string String_substr(string sText = "", int startPos = 0, int endPos = 2048) {</Command> <Command> int pos = 0;</Command> <Command> string dText = "";</Command> <Command> string subText = "";</Command> <Command> string currentChar = "";</Command> <Command> while(true) // To infinity, and beyond!</Command> <Command> {</Command> <Command> if(dText == sText)</Command> <Command> break;</Command> <Command> currentChar = "";</Command> <Command> pos++;</Command> <Command> if(dText+" " > sText) { currentChar = ""; }</Command> <Command> else if(dText+"!" > sText) { currentChar = " "; }</Command> <Command> else if(dText+"\"" > sText){ currentChar = "!"; }</Command> <Command> else if(dText+"#" > sText) { currentChar = "\""; }</Command> <Command> else if(dText+"$" > sText) { currentChar = "#"; }</Command> <Command> else if(dText+"%mod%" > sText) { currentChar = "$"; }</Command> <Command><![CDATA[else if(dText+"&">sText){currentChar="%mod%";}]]></Command> <Command><![CDATA[else if(dText+"'">sText){currentChar="&";}]]></Command> <Command> else if(dText+"(" > sText) { currentChar = "'"; }</Command> <Command> else if(dText+")" > sText) { currentChar = "("; }</Command> <Command> else if(dText+"*" > sText) { currentChar = ")"; }</Command> <Command> else if(dText+"+" > sText) { currentChar = "*"; }</Command> <Command> else if(dText+"," > sText) { currentChar = "+"; }</Command> <Command> else if(dText+"-" > sText) { currentChar = ","; }</Command> <Command> else if(dText+"." > sText) { currentChar = "-"; }</Command> <Command> else if(dText+"/" > sText) { currentChar = "."; }</Command> <Command> else if(dText+"0" > sText) { currentChar = "/"; }</Command> <Command> else if(dText+"1" > sText) { currentChar = "0"; }</Command> <Command> else if(dText+"2" > sText) { currentChar = "1"; }</Command> <Command> else if(dText+"3" > sText) { currentChar = "2"; }</Command> <Command> else if(dText+"4" > sText) { currentChar = "3"; }</Command> <Command> else if(dText+"5" > sText) { currentChar = "4"; }</Command> <Command> else if(dText+"6" > sText) { currentChar = "5"; }</Command> <Command> else if(dText+"7" > sText) { currentChar = "6"; }</Command> <Command> else if(dText+"8" > sText) { currentChar = "7"; }</Command> <Command> else if(dText+"9" > sText) { currentChar = "8"; }</Command> <Command> else if(dText+":" > sText) { currentChar = "9"; }</Command> <Command> else if(dText+";" > sText) { currentChar = ":"; }</Command> <Command><![CDATA[else if(dText+"<">sText){currentChar=";";}]]></Command> <Command><![CDATA[else if(dText+"=">sText){currentChar="<";}]]></Command> <Command> else if(dText+">" > sText) { currentChar = "="; }</Command> <Command> else if(dText+"?" > sText) { currentChar = ">"; }</Command> <Command> else if(dText+"@" > sText) { currentChar = "?"; }</Command> <Command> else if(dText+"a" > sText) { currentChar = "@"; }</Command> <Command> else if(dText+"b" > sText) { currentChar = "a"; }</Command> <Command> else if(dText+"c" > sText) { currentChar = "b"; }</Command> <Command> else if(dText+"d" > sText) { currentChar = "c"; }</Command> <Command> else if(dText+"e" > sText) { currentChar = "d"; }</Command> <Command> else if(dText+"f" > sText) { currentChar = "e"; }</Command> <Command> else if(dText+"g" > sText) { currentChar = "f"; }</Command> <Command> else if(dText+"h" > sText) { currentChar = "g"; }</Command> <Command> else if(dText+"i" > sText) { currentChar = "h"; }</Command> <Command> else if(dText+"j" > sText) { currentChar = "i"; }</Command> <Command> else if(dText+"k" > sText) { currentChar = "j"; }</Command> <Command> else if(dText+"l" > sText) { currentChar = "k"; }</Command> <Command> else if(dText+"m" > sText) { currentChar = "l"; }</Command> <Command> else if(dText+"n" > sText) { currentChar = "m"; }</Command> <Command> else if(dText+"o" > sText) { currentChar = "n"; }</Command> <Command> else if(dText+"p" > sText) { currentChar = "o"; }</Command> <Command> else if(dText+"q" > sText) { currentChar = "p"; }</Command> <Command> else if(dText+"r" > sText) { currentChar = "q"; }</Command> <Command> else if(dText+"s" > sText) { currentChar = "r"; }</Command> <Command> else if(dText+"t" > sText) { currentChar = "s"; }</Command> <Command> else if(dText+"u" > sText) { currentChar = "t"; }</Command> <Command> else if(dText+"v" > sText) { currentChar = "u"; }</Command> <Command> else if(dText+"w" > sText) { currentChar = "v"; }</Command> <Command> else if(dText+"x" > sText) { currentChar = "w"; }</Command> <Command> else if(dText+"y" > sText) { currentChar = "x"; }</Command> <Command> else if(dText+"z" > sText) { currentChar = "y"; }</Command> <Command> else if(dText+"[" > sText) { currentChar = "z"; }</Command> <Command> else if(dText+"\\" > sText){ currentChar = "["; }</Command> <Command> else if(dText+"]" > sText) { currentChar = "\\"; }</Command> <Command> else if(dText+"[" > sText) { currentChar = "]"; }</Command> <Command> else if(dText+"^" > sText) { currentChar = "["; }</Command> <Command> else if(dText+"_" > sText) { currentChar = "^"; }</Command> <Command> else if(dText+"`" > sText) { currentChar = "_"; }</Command> <Command> else if(dText+"{" > sText) { currentChar = "`"; }</Command> <Command> else if(dText+"|" > sText) { currentChar = "{"; }</Command> <Command> else if(dText+"}" > sText) { currentChar = "|"; }</Command> <Command> else if(dText+"~" > sText) { currentChar = "}"; }</Command> <Command> else if(dText+"~~" > sText){ currentChar = "~"; }</Command> <Command> dText = dText + currentChar;</Command> <Command> if(pos >= startPos)</Command> <Command> subText = subText + currentChar;</Command> <Command> if(pos == startPos+endPos-1)</Command> <Command> break;</Command> <Command> }</Command> <Command> return(subText);</Command> <Command>}</Command> <Command>int String_length(string sText = "") {</Command> <Command> int pos = 0;</Command> <Command> string dText = "";</Command> <Command> string currentChar = "";</Command> <Command> while(true) // To infinity, and beyond!</Command> <Command> {</Command> <Command> if(dText == sText)</Command> <Command> break;</Command> <Command> currentChar = "";</Command> <Command> pos++;</Command> <Command> if(dText+" " > sText) { currentChar = ""; }</Command> <Command> else if(dText+"!" > sText) { currentChar = " "; }</Command> <Command> else if(dText+"\"" > sText){ currentChar = "!"; }</Command> <Command> else if(dText+"#" > sText) { currentChar = "\""; }</Command> <Command> else if(dText+"$" > sText) { currentChar = "#"; }</Command> <Command> else if(dText+"%mod%" > sText) { currentChar = "$"; }</Command> <Command><![CDATA[else if(dText+"&">sText){currentChar="%mod%";}]]></Command> <Command><![CDATA[else if(dText+"'">sText){currentChar="&";}]]></Command> <Command> else if(dText+"(" > sText) { currentChar = "'"; }</Command> <Command> else if(dText+")" > sText) { currentChar = "("; }</Command> <Command> else if(dText+"*" > sText) { currentChar = ")"; }</Command> <Command> else if(dText+"+" > sText) { currentChar = "*"; }</Command> <Command> else if(dText+"," > sText) { currentChar = "+"; }</Command> <Command> else if(dText+"-" > sText) { currentChar = ","; }</Command> <Command> else if(dText+"." > sText) { currentChar = "-"; }</Command> <Command> else if(dText+"/" > sText) { currentChar = "."; }</Command> <Command> else if(dText+"0" > sText) { currentChar = "/"; }</Command> <Command> else if(dText+"1" > sText) { currentChar = "0"; }</Command> <Command> else if(dText+"2" > sText) { currentChar = "1"; }</Command> <Command> else if(dText+"3" > sText) { currentChar = "2"; }</Command> <Command> else if(dText+"4" > sText) { currentChar = "3"; }</Command> <Command> else if(dText+"5" > sText) { currentChar = "4"; }</Command> <Command> else if(dText+"6" > sText) { currentChar = "5"; }</Command> <Command> else if(dText+"7" > sText) { currentChar = "6"; }</Command> <Command> else if(dText+"8" > sText) { currentChar = "7"; }</Command> <Command> else if(dText+"9" > sText) { currentChar = "8"; }</Command> <Command> else if(dText+":" > sText) { currentChar = "9"; }</Command> <Command> else if(dText+";" > sText) { currentChar = ":"; }</Command> <Command><![CDATA[else if(dText+"<">sText){currentChar=";";}]]></Command> <Command><![CDATA[else if(dText+"=">sText){currentChar="<";}]]></Command> <Command> else if(dText+">" > sText) { currentChar = "="; }</Command> <Command> else if(dText+"?" > sText) { currentChar = ">"; }</Command> <Command> else if(dText+"@" > sText) { currentChar = "?"; }</Command> <Command> else if(dText+"a" > sText) { currentChar = "@"; }</Command> <Command> else if(dText+"b" > sText) { currentChar = "a"; }</Command> <Command> else if(dText+"c" > sText) { currentChar = "b"; }</Command> <Command> else if(dText+"d" > sText) { currentChar = "c"; }</Command> <Command> else if(dText+"e" > sText) { currentChar = "d"; }</Command> <Command> else if(dText+"f" > sText) { currentChar = "e"; }</Command> <Command> else if(dText+"g" > sText) { currentChar = "f"; }</Command> <Command> else if(dText+"h" > sText) { currentChar = "g"; }</Command> <Command> else if(dText+"i" > sText) { currentChar = "h"; }</Command> <Command> else if(dText+"j" > sText) { currentChar = "i"; }</Command> <Command> else if(dText+"k" > sText) { currentChar = "j"; }</Command> <Command> else if(dText+"l" > sText) { currentChar = "k"; }</Command> <Command> else if(dText+"m" > sText) { currentChar = "l"; }</Command> <Command> else if(dText+"n" > sText) { currentChar = "m"; }</Command> <Command> else if(dText+"o" > sText) { currentChar = "n"; }</Command> <Command> else if(dText+"p" > sText) { currentChar = "o"; }</Command> <Command> else if(dText+"q" > sText) { currentChar = "p"; }</Command> <Command> else if(dText+"r" > sText) { currentChar = "q"; }</Command> <Command> else if(dText+"s" > sText) { currentChar = "r"; }</Command> <Command> else if(dText+"t" > sText) { currentChar = "s"; }</Command> <Command> else if(dText+"u" > sText) { currentChar = "t"; }</Command> <Command> else if(dText+"v" > sText) { currentChar = "u"; }</Command> <Command> else if(dText+"w" > sText) { currentChar = "v"; }</Command> <Command> else if(dText+"x" > sText) { currentChar = "w"; }</Command> <Command> else if(dText+"y" > sText) { currentChar = "x"; }</Command> <Command> else if(dText+"z" > sText) { currentChar = "y"; }</Command> <Command> else if(dText+"[" > sText) { currentChar = "z"; }</Command> <Command> else if(dText+"\\" > sText){ currentChar = "["; }</Command> <Command> else if(dText+"]" > sText) { currentChar = "\\"; }</Command> <Command> else if(dText+"[" > sText) { currentChar = "]"; }</Command> <Command> else if(dText+"^" > sText) { currentChar = "["; }</Command> <Command> else if(dText+"_" > sText) { currentChar = "^"; }</Command> <Command> else if(dText+"`" > sText) { currentChar = "_"; }</Command> <Command> else if(dText+"{" > sText) { currentChar = "`"; }</Command> <Command> else if(dText+"|" > sText) { currentChar = "{"; }</Command> <Command> else if(dText+"}" > sText) { currentChar = "|"; }</Command> <Command> else if(dText+"~" > sText) { currentChar = "}"; }</Command> <Command> else if(dText+"~~" > sText){ currentChar = "~"; }</Command> <Command> dText = dText + currentChar;</Command> <Command> }</Command> <Command> return(pos);</Command> <Command>}</Command> <Command>string String_charAt(string sText = "", int pos = 1) {</Command> <Command> return(String_substr(sText, pos, 1));</Command> <Command>}</Command> <Command>float String_parseFloat(string sText = "") {</Command> <Command> float number = 0.0;</Command> <Command> float multiplayer = 10.0; // We will use this to increment the number in the right position.</Command> <Command> // It will increase by 10 as we add more numbers, decrease 10 when we find a .</Command> <Command> bool isNegative = false; // We all like to be positive. =)</Command> <Command> string dText = "";</Command> <Command> string currentChar = "";</Command> <Command> while(true)</Command> <Command> {</Command> <Command> if(dText == sText)</Command> <Command> break;</Command> <Command> int currentNumber = -1;</Command> <Command> if(dText+"-" > sText) { currentChar = "I'm so Fabulicious OMG!!!"; }</Command> <Command> else if(dText+"." > sText) { isNegative = true; currentChar = "-"; }</Command> <Command> else if(dText+"0" > sText) { currentChar = "."; multiplayer = 0.1; } // Slash Dot Dash dot dot dot dot com</Command> <Command> else if(dText+"1" > sText) { currentChar = "0"; currentNumber = 0; }</Command> <Command> else if(dText+"2" > sText) { currentChar = "1"; currentNumber = 1; }</Command> <Command> else if(dText+"3" > sText) { currentChar = "2"; currentNumber = 2; }</Command> <Command> else if(dText+"4" > sText) { currentChar = "3"; currentNumber = 3; }</Command> <Command> else if(dText+"5" > sText) { currentChar = "4"; currentNumber = 4; }</Command> <Command> else if(dText+"6" > sText) { currentChar = "5"; currentNumber = 5; }</Command> <Command> else if(dText+"7" > sText) { currentChar = "6"; currentNumber = 6; }</Command> <Command> else if(dText+"8" > sText) { currentChar = "7"; currentNumber = 7; }</Command> <Command> else if(dText+"9" > sText) { currentChar = "8"; currentNumber = 8; }</Command> <Command> else if(dText+":" > sText) { currentChar = "9"; currentNumber = 9; }</Command> <Command> else { return(-1.0); } // We only accept the above characters.</Command> <Command> dText = dText + currentChar;</Command> <Command> if(currentNumber != -1)</Command> <Command> {</Command> <Command> if(multiplayer == 10.0)</Command> <Command> {</Command> <Command> number = 1*(number*10.0+currentNumber);</Command> <Command> }</Command> <Command> else</Command> <Command> {</Command> <Command> number = number + multiplayer*currentNumber;</Command> <Command> multiplayer = multiplayer*0.1;</Command> <Command> }</Command> <Command> }</Command> <Command> }</Command> <Command> if(isNegative)</Command> <Command> return(-1.0*number);</Command> <Command> return(number);</Command> <Command>}</Command> <Command>rule _DeclareGlobalsEnd</Command> <Command>inactive</Command> <Command>{</Command> <Command>if (1==1) {</Command> </Effect> </Effect>
Some effects are not tested as I go on vacations tomorrow for 3 weeks.
->the tech Array:
purpose:save all used techs so you can reload them when loading your scenario again. Else you will loose all
->1.Tech Array Create
2.Set Tech Status SP *TL*
->if you found out that your game was loaded you can now use "Set Tech Status For Lost Techs"

->Inventory:
First use the create trigger (kill items with amount of 0 is not recommended yet it might be reworked)
->Use Inventory: Array Set Item (this is the only way to define the name of item). If you choose pos==-1 it will automaticly detect an empty space/try to find allready existing string with the same item name
->you can now modify the number of items, echo items... and kill them by hand

->Usage e.g. rpg in Combination with Hotkeys (would only work in SP but I try to fix Hotkeys so they work for MP)

For Coders
Typeloader includs some effects for manipulate strings and working with Arrays
xsArrayGetStringPos(trQuestVarGet("Array QV"),string "For what I search",float Maximum Amount of Positions [defined in Create Array])
xsArrayGetIntPos(trQuestVarGet("Array QV"),int -For what I search-,float Maximum Amount of Positions)
xsArrayStringSwap(...Array QV,Pos1,Pos2)
From Invent00r
String_substr("Text", int startPos, int endPos)
->create a substring from your orginal string e.g
String_substr("IAMBETTER", 1, 3)
will return "IAM"
String_length("MyText")
returns the length of the string (in this case -6-)
string String_charAt("Mytext", int pos)
->returns the char at the given position of your text
String_parseFloat("MyNumber")
creates a Float from the given String. If your string isnt a number it will return -1
e.g. trQuestVarSet("QV1",String_parseFloat("4"))
->will set QV1 to 4


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 07-13-2010 @ 03:06 PM).]

musketeer925
Skirmisher
posted 06-20-10 12:10 PM EDT (US)     262 / 849       
I'll post all the Array trigs I made too, since Mister SCP didn't. They're pretty self-explanatory. I also will be gone this week, but will be back 6/24/10 in the evening, Eastern Standard Time(-5 GMT).


<Effect name="Array: Set String to Player Name">
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="PlayerID" dispName="Player" varType="string">1</Param>
<Command>xsArraySetString(trQuestVarGet("%qvname%"), %Max%, ""+kbGetPlayerName(%PlayerID%));</Command>
</Effect>

<Effect name="Array: Overlay Text">
<Param name="Type" dispName="Int/Float/String" varType="string">String</Param>
<Param name="QVName" dispName="QV Name of Array" VarType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Command>trOverlayText("" + xsArrayGet%Type%(trQuestVarGet("%qvname%"),%Max%) + "", 5.0, -1, -1, -1,);</Command>
</Effect>

<Effect name="Array: Overlay Text2">
<Param name="Type" dispName="Int/Float/String" varType="string">String</Param>
<Param name="Text1" dispName="TextBefore" VarType="stringid">Default</Param>
<Param name="QVName" dispName="QV Name of Array" VarType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Text2" dispName="TextAfter" VarType="stringid">Default</Param>
<Command>trOverlayText("%Text1%" + xsArrayGet%Type%(trQuestVarGet("%qvname%"),%Max%) + "%Text2%", 5.0, -1, -1, -1,);</Command>
</Effect>

<Effect name="Array: Send Chat">
<Param name="Type" dispName="Int/Float/String" varType="string">Int</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Command>trChatSend(0,"" + xsArrayGet%Type%(trQuestVarGet("%qvname%"),%Max%) + "");</Command>
</Effect>

<Effect name="Array: Send Chat2">
<Param name="Text1" dispName="TextBefore" VarType="stringid">Default</Param>
<Param name="Type" dispName="Int/Float/String" varType="string">Int</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Text2" dispName="TextAfter" VarType="stringid">Default</Param>
<Command>trChatSend(0,"%Text1" + xsArrayGet%Type%(trQuestVarGet("%qvname%"),%Max%) + "%Text2%");</Command>
</Effect>

<Effect name="Array: Modify String">
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Value" dispName="Value" varType="string">MyString</Param>
<Param name="BegEnd" dispName="Beginning/End" varType="string">End</Param>
<Command>if("¾gEnd%"=="Beginning") xsArraySetString(trQuestVarGet("%qvname%"), %Max%, "%Value%"+ xsArrayGetString(trQuestVarGet("%qvname%"), %Max%) +"");</Command>
<Command>else if("¾gEnd%"=="End") xsArraySetString(trQuestVarGet("%qvname%"), %Max%, ""+ xsArrayGetString(trQuestVarGet("%qvname%"), %Max%) +"%Value%");</Command>
</Effect>

<Effect name="Array: Modify String by String">
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="qvname2" dispName="QV Name of Added Array" varType="string">QVA2</Param>
<Param name="Max2" dispName="Position of Added" varType="string">1</Param>
<Param name="BegEnd" dispName="Beginning/End" varType="string">End</Param>
<Command>if("¾gEnd%"=="Beginning") xsArraySetString(trQuestVarGet("%qvname%"), %Max%, ""+ xsArrayGetString(trQuestVarGet("%qvname2%"), %Max2%) +""+ xsArrayGetString(trQuestVarGet("%qvname%"), %Max%) +"");</Command>
<Command>else if("¾gEnd%"=="End") xsArraySetString(trQuestVarGet("%qvname%"), %Max%, ""+ xsArrayGetString(trQuestVarGet("%qvname%"), %Max%) +""+ xsArrayGetString(trQuestVarGet("%qvname2%"), %Max2%) +"");</Command>
</Effect>

<Effect name="Array: Modify Numbers">
<Param name="Type" dispName="Int/Float" varType="string">Int</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position" varType="string">1</Param>
<Param name="Op" dispName="$$22297$$Operator" varType="string">+</Param>
<Param name="Value" dispName="Value" varType="string">1</Param>
<Command>xsArraySet%Type%(trQuestVarGet("%qvname%"), %Max%, xsArrayGet%Type%(trQuestVarGet("%qvname%"), %Max%) %Op% %Value%);</Command>
</Effect>

<Effect name="Array: Unit Create Multi">
<Param name="Note" dispName="Note:" varType="string">Use an Array String. The String will be the protounit.</Param>
<Param name="PlayerID" dispName="$$22301$$Player" varType="player">1</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position of Protounit" varType="string">1</Param>
<Param name="Location" dispName="" varType="area">0,0,0</Param>
<Param name="Count" dispName="$$22435$$Count" varType="long">0</Param>
<Command>for (i=0; <%Count%)</Command>
<Command>trUnitCreate(""+ xsArrayGetString(trQuestVarGet("%qvname%"), %Max%) +"", "default", %Location%, 0,, %PlayerID%);</Command>
</Effect>

<Effect name="Array: Unit Create Multi Random">
<Param name="Note" dispName="Note:" varType="string">Use an Array of Strings that are protounits.</Param>
<Param name="PlayerID" dispName="$$22301$$Player" varType="player">1</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Min" dispName="Minimum Position of Protounit" varType="string">1</Param>
<Param name="Max" dispName="Maximum Position of Protounit" varType="string">2</Param>
<Param name="Location" dispName="" varType="area">0,0,0</Param>
<Param name="Count" dispName="$$22435$$Count" varType="long">0</Param>
<Param name="ReRand" dispName="Randomize after Each Unit" VarType="bool">false</Param>
<Command>if(%ReRand% == false){</Command>
<Command>trQuestVarSetFromRand("tinuotorp", %Min%, %Max%, true);</Command>
<Command>for (i=0; <%Count%)</Command>
<Command>trUnitCreate(""+ xsArrayGetString(trQuestVarGet("%qvname%"), trQuestVarGet("tinuotorp")) +"", "default", %Location%,0,, %PlayerID%);}</Command>
<Command>else if(%ReRand% == true){</Command>
<Command>for (i=0; <%Count%){</Command>
<Command>trQuestVarSetFromRand("tinuotorp", %Min%, %Max%, true);</Command>
<Command>trUnitCreate(""+ xsArrayGetString(trQuestVarGet("%qvname%"), trQuestVarGet("tinuotorp")) +"", "default", %Location%, 0,, %PlayerID%);}</Command>
<Command>}</Command>
</Effect>

<Effect name="Array: Fire Event">
<Param name="Note" dispName="Note:" varType="string">Use an Array String. The String will be the trigger name.</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Max" dispName="Position of Event" varType="string">1</Param>
<Command>xsEnableRule("_"+ xsArrayGetString(trQuestVarGet("%qvname%"), %Max%) +"");</Command>
</Effect>

<Effect name="Array: Fire Event Random">
<Param name="Note" dispName="Note:" varType="string">Use an Array String. The String will be the trigger names.</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Min" dispName="Minimum Position of Event" varType="string">1</Param>
<Param name="Max" dispName="Maximum Position of Event" varType="string">2</Param>
<Command>trQuestVarSetFromRand("tneve", %Min%, %Max%, true);</Command>
<Command>xsEnableRule("_"+ xsArrayGetString(trQuestVarGet("%qvname%"), trQuestVarGet("tneve")) +"");</Command>
</Effect>

<Effect name="Array: Fire Event Multi">
<Param name="Note" dispName="Note:" varType="string">Use an Array String. The String will be the trigger names.</Param>
<Param name="qvname" dispName="QV Name of Array" varType="string">QVA1</Param>
<Param name="Min" dispName="Minimum Position of Event" varType="string">1</Param>
<Param name="Max" dispName="Maximum Position of Event" varType="string">2</Param>
<Command>trQuestVarSet("rebmun", %Max% - %Min%);</Command>
<Command>trQuestVarSet("rebmun", trQuestVarGet("rebmun") + 1);</Command>
<Command>trQuestVarSet("tneve", %Min%);</Command>
<Command>for (i=0; <trQuestVarGet("rebmun")){</Command>
<Command>xsEnableRule("_"+ xsArrayGetString(trQuestVarGet("%qvname%"), trQuestVarGet("tneve")) +"");</Command>
<Command>trQuestVarSet("tneve", trQuestVarGet("tneve") + 1);}</Command>
</Effect>

[This message has been edited by musketeer925 (edited 06-20-2010 @ 12:14 PM).]

Skyrate
Scenario Contest Winner
posted 06-25-10 04:23 PM EDT (US)     263 / 849       
I hope someone will be able to help me with this trigger.

I need to make an Army work on Army effect so that I can have two spawned ghost armies attack each other. Since there's a way to define an army to go somewhere I figure there must be some way to define an army to attack another defined army. I just can't figure out how to do this.

I tried duplicating the Army Work effect and changing the destination to being another army but it didn't work. I also tried using code from the AI Attack Army effect but that didn't work either.

Here's what I have currently:
   <Effect name="Army Work on Army NOT WORKING">
<Param name="SrcArmy" dispName="$$22348$$Army" VarType="group">default</Param>
<Param name="DstArmy" dispName="Army To Attack" VarType="group">default</Param>
<Command>trArmySelect("%SrcArmy%");</Command>
<Command>trArmySelect("%DstArmy%");</Command>
<Command>trUnitDoWorkOnUnit("%DstArmy%");</Command>
</Effect>


I put this code into the typetest.xml which is in the trigger2 folder. I only have vanilla and TWC.

.:: Experienced :: [Modder] :: [Scenario Designer] ::.
Currently working on: Western Expansion(1820-1835) Campaign: #2 Defend the fort
Scenarios: The Battle of Lexington and Concord, The Battle of Bunker Hill, Sieging the Fort
musketeer925
Skirmisher
posted 06-26-10 10:26 AM EDT (US)     264 / 849       

<Effect name="Army Work on Army NOT WORKING">
<Param name="SrcArmy" dispName="$$22348$$Army" VarType="group">default</Param>
<Param name="DstArmy" dispName="Army To Attack" VarType="group">default</Param>
<Command>trArmySelect("%SrcArmy%");</Command>
<Command>trArmySelect("%DstArmy%");</Command>
<Command>trUnitDoWorkOnUnit("%DstArmy%");</Command>
</Effect>
One problem with this on is you selected 2 armies; the second one you select with overwrite the currently selected army.

Another VERY IMPORTANT thing I'm trying to get across is that you must have the correct input into the commands. when you say "%DstArmy%", this is not the Units, it is an Army ID/Name (I don't know whether that is an ID number or a Name.) That command is looking for a specific Unit ID.

Before I can do more on this I really need Mister SCP to tell me if the kbArmy commands work; they look very useful, but I'm getting the source from AoM, and I don't know if they work for AoE III.

[This message has been edited by musketeer925 (edited 06-26-2010 @ 10:29 AM).]

Skyrate
Scenario Contest Winner
posted 06-26-10 12:59 PM EDT (US)     265 / 849       
Ahh, so don't select both armies, only select the attacking army.

I thought "%DstArmy%" was defining the second army?

When I use this in game it shows the Army and Army to attack fields correctly, both are drop downs with my list of armies.

I think the problem must be in the last command line:
      <Command>trUnitDoWorkOnUnit("%DstArmy%");</Command>


I guess we need that kbArmy command you're talking about.

.:: Experienced :: [Modder] :: [Scenario Designer] ::.
Currently working on: Western Expansion(1820-1835) Campaign: #2 Defend the fort
Scenarios: The Battle of Lexington and Concord, The Battle of Bunker Hill, Sieging the Fort
musketeer925
Skirmisher
posted 06-26-10 05:10 PM EDT (US)     266 / 849       
I know the problem is in the last line. You made all the params right, which is what makes stuff show up in the scenario editor, ofc.

"%DstArmy%" does define the second army, you're right, you're kind of confused about what that means. It gets a Army ID (or possibly a name, not sure) from the Src/Dst Army params.

That's why it is necessary to use the trArmySelect, because then it selects the units in the Army, not just the Army ID. This is how we can use the trUnitWorkOnUnit; notice there's not a first define for the Unit working on the other one, it uses the 'selected'* units for the first Unit, and then the Units in the thing as the second. Right now, you're trying to work a number or a string.

*This uses the tr Selection System, not the units you see as selected in-game.

Have you tried the suggestion I gave you in your original thread** about this? It may not be necessary to make at all.

**You should just make your appearing armies change unit type from Cinematic Blocks, not Deploy them. This makes them compatible with almost any trigger; for you can select them and use Src Object triggers.


Perhaps, if you are stubborn with making the new trigger, try this?

<Effect name="Army Work on Army NOT WORKING">
<Param name="SrcArmy" dispName="$$22348$$Army" VarType="group">default</Param>
<Param name="DstArmy" dispName="Army To Attack" VarType="group">default</Param>
<Command>trArmySelect("%SrcArmy%");</Command>
<Command>trUnitDoWorkOnUnit(trArmySelect("%DstArmy%"));</Command>
</Effect>

[This message has been edited by musketeer925 (edited 06-26-2010 @ 05:15 PM).]

Skyrate
Scenario Contest Winner
posted 06-26-10 11:00 PM EDT (US)     267 / 849       
That trigger doesn't work either :/

I tried the cinematic block method and it worked. I had one trigger change the unit type of the block to an IGC target, deploy the army, tell the army to work, and then fire the next trigger.

The second trigger fired after 1000ms and changed the target back into a block.

This gave the artillery just enough time to set up but not enough to fire.

I don't like using cinematic blocks outside of cinematics but I'll use this method until we can figure out how to get an army to attack an army. There's got to be a way to get the trigger to work, we just haven't figured it out yet

I'll keep looking over the triggers and see if I can find something that works.

.:: Experienced :: [Modder] :: [Scenario Designer] ::.
Currently working on: Western Expansion(1820-1835) Campaign: #2 Defend the fort
Scenarios: The Battle of Lexington and Concord, The Battle of Bunker Hill, Sieging the Fort
Mister SCP
Scenario Reviewer
posted 06-30-10 02:03 PM EDT (US)     268 / 849       
1.most aom army codes dont work with aoe3
2.afaik army work on army exists for aom google it
3.if that dont work then transform the target army. isolate the unit id AND units scenario name with kbquery commands

musk remember xs-user code and trigtemp.xs are your friends

(I VE written this with my psp)


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
Sir_Hans
Scenario Expert
posted 07-13-10 10:56 AM EDT (US)     269 / 849       
Name: Army Change Name QV (non decimal) Number

I think it should explain everything. I don't want the X.000000000000000000000000000000 (xD) at a QV and want that to an Army name.

[This message has been edited by Sir_Hans (edited 07-13-2010 @ 02:41 PM).]

Mister SCP
Scenario Reviewer
posted 07-13-10 02:54 PM EDT (US)     270 / 849       
if you ve allready the code with decimals simply put it in this form ..."+1*trQuestVarGet("QV")+"...

Alternative Way: put it into a Integer... Integer have no decimals
for(result=trQuestVarGet("YourQV");>500000){}
replace in your change name line: "+trQuestVarGet("YourQV")+" with "+result+" (since you neamed your Integer this way)

btw the new set techs things doesnt work yet... They have a problem with getting right positions of arrays to save and load informations. Will fix it soon


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 07-13-2010 @ 03:07 PM).]

Sir_Hans
Scenario Expert
posted 07-14-10 01:29 PM EDT (US)     271 / 849       
Thanks

Btw, I program with C++ so I know what an Integer is
Sir_Hans
Scenario Expert
posted 07-16-10 01:30 PM EDT (US)     272 / 849       
Add Units to Army in Area
Now I need a trigger that adds all units in area to an army.
I used Copy In Area MP but there it just copies the units and doesn't add them to an army.

Edit:
Copy/Convert In Area MP works so I don't need it for this problem but maybe for another one so it would be good if youcan make the effect.

[This message has been edited by Sir_Hans (edited 07-16-2010 @ 01:59 PM).]

Mister SCP
Scenario Reviewer
posted 07-17-10 03:36 AM EDT (US)     273 / 849       
In aoe3 you cant select units and add them to an army thought it was possible in AOM


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
As_Saffah
Scenario Reviewer
posted 07-17-10 11:15 AM EDT (US)     274 / 849       
can you add army + army? If the units already belong to or are created as part of a predefined army?

Crunkatog on ESO
Bart331 balance suggestion: aztec: remove civ
Voltiguer: Ender, Sioux in 1.04 will be a top civ, no matter how many layers of Sioux goggles you put on
schildpad on Elephants: ...their mansabdar unit sucks so hard it looks like a black hole
Crunkatog on Steam.
Mister SCP
Scenario Reviewer
posted 07-17-10 01:03 PM EDT (US)     275 / 849       
idk, have to try out


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
« Previous Page  1 ··· 9 10 11 12 13 ··· 20 ··· 30 ··· 34  Next Page »
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Empires III Heaven | HeavenGames