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.2502 replies, Closed
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 ··· 38 39 40 41 42 ··· 50 ··· 60 ··· 70 ··· 80 ··· 90 ··· 100  Next Page »
invent00r
Mortal
posted 04 October 2007 11:46 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 purpose is only to place trigger request and discuss about them. If you have unrelated questions or need help with triggers, please use OmegasRage 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?
    First of all, you need to have Age of Mythology installed. If you have that, then you are half away done. Now you will need to find your way to your AoM installation folder, and open the trigger folder or the trigger2 folder if you pretend to install the new trigger on The Titans (the expansion). With the notepad, open a file called, typetest.xml - at this point, you need to copy the trigger from this page and paste it there. If you requested a condition, then place it under or under if it was an effect you requested.

    Notes:
    1. Please put the trigger at the end of each list so you can easly remove them and keep the integrity of the typetest file.
    2. When copying the trigger from someone, please click the edit image (), and only then copy the respective effect or condition.
    3. If this is your 1st trigger you're installing, please backup the original typetest file.

  3. So.. How exactly are new triggers done?
    AoM has a built-in engine that can prase XS code. Triggers are programmed and interpreted using this language through a serious 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, usefull triggers - but it does have some limitations...
  4. I want to learn triggers, how do I do that?
    It takes a quite some time, but if you really wish to learn triggers, I recommend fully understanding XS language before you start making triggers, and for that you need to go here - Master XS. If you want to skip all that, and you want to be able to do only simple triggers, read this guide.
  5. Help! My triggers have stopped working!
    Triggers Stop Working Guide. Also using run immediately, linking camera tracks, 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. New triggers for TT v3 by nottud
  7. Conditonal Effects (TT & AoM) by nottud
  8. Angry Levels (TT & AoM) by angryzor
  9. SIMSTools (TT) by angryzor
  10. 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.
Description - Always describe the actions that you want the trigger to perform. Please give atleast one example of use.

Remember that not all triggers are possible but I - and anyone who wants to help me -, will try our best.

Enjoy. .
-invent00r

My Work: 1 2 3 4 5 6 7 8 9 10

WIP: Master XS Battle Micro AI
Paused: AI (%4.247)
Os segredos são de quem os souber guardar.

[This message has been edited by invent00r (edited 08-15-2008 @ 03:40 PM).]

AuthorReplies:
Baseballkid14
Mortal
posted 12 March 2008 05:45 PM EDT (US)     976 / 2502       
The Max is 30 because the game doesn't let you select more than 30 at a time. That question should go on yeebagoons thread not this one.

As for Sir_Simant, I made your trigger but guess what? It doesn't work. It's a good building block for you and I bet you can fix it.
   <Effect name="Share Tech With Player">
<Param name="PlayerID1" dispName="Player" VarType="player">0</Param>
<Param name="TechID" dispName="Tech" VarType="tech">0</Param>
<Param name="PlayerID2" dispName="Player" VarType="player">0</Param>
<Command>for(percent=0;>1)</Command>
<Command>xsSetContextPlayer(%PlayerID%);</Command>
<Command>percent = 100.0*kbGetTechPercentComplete(%TechID%));</Command>
<Command>if(percent >= 100)trTechSetStatus(%PlayerID2, %TechID%, active)</Command>
</Effect>
Mythic_Freak
Mortal
posted 12 March 2008 05:51 PM EDT (US)     977 / 2502       
I discovered something interesting when implamenting the last trigger I posted about, there is a limit to how many objects can be in a "SrcObject". I don't need the answer to finish the scenario but does anyone know why or how to change it?
As a first guess I'd say the limit is 30, and you can't change it.

And yes, MSWord seems to add some strange chars to text when copy pasted to a plain text editor. I recommend not to use Word for any coding stuff, notepad is your man. Or any other serious code editor/IDE. (EmEditor seems to be a good choice.)

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

Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
HailToTheOboe
Bitten by a radioactive ostrich
posted 12 March 2008 06:03 PM EDT (US)     978 / 2502       
<Effect name="Share Tech With Player">      
<Param name="PlayerID1" dispName="Player" VarType="player">0</Param>
<Param name="TechID" dispName="Tech" VarType="tech">0</Param>
<Param name="PlayerID2" dispName="Player" VarType="player">0</Param>
<Command>for(percent=0;>1){}</Command>
<Command>xsSetContextPlayer(%PlayerID1%);</Command>
<Command>percent = 100.0*kbGetTechPercentComplete(%TechID%));</Command>
<Command>if(percent >= 100)trTechSetStatus(%PlayerID2, %TechID%, 4)</Command>
</Effect>
Ok - there's that trigger with a few fixes. I added {} after the for loop to show that it's empty, fixed the PlayerID1 parameter to correspond with how it was declared, and I replaced "active" with 4, because the Status of a tech is represented by a number and active = 4. I found that out by using Set Tech Status trigger in a scenario, then opening trigtemp.xs and seeing what values were put in the arguments.

Here's a completely different version of the trigger that I made, essentially combining Tech Available, and Set Tech Status which were already in my typetest.xml.
   <Effect name="Share Tech With PlayerII">      
<Param name="PlayerID1" dispName="Player1" VarType="player">0</Param>
<Param name="TechID" dispName="Tech" VarType="tech">0</Param>
<Param name="PlayerID2" dispName="Player2" VarType="player">0</Param>
<Command>if(trTechStatusActive(%PlayerID2%, %TechID%))</Command>
<Command>trTechSetStatus(%PlayerID1%, %TechID%, 4);</Command>

</Effect>

If player 2 researches this specific tech, Player 1 gets it too.

A more general version that looks at a whole whack of techs is this:
<Effect name="Share Tech With PlayerIII">      
<Param name="PlayerID1" dispName="Player1" VarType="player">0</Param>
<Param name="PlayerID2" dispName="Player2" VarType="player">0</Param>
<Command>for(i=100;>0){</Command>
<Command>if(trTechStatusActive(%PlayerID2%, i))</Command>
<Command>trTechSetStatus(%PlayerID1%, i, 4);</Command>
<Command>}</Command>
</Effect>


That will check every tech with ID between 1 and 100 and if Player 2 has one researched Player 1 gets it too. I don't know exactly how many techs there are, and if you want to ignore specific ones like Minor Gods, then you need to know the tech IDs for those techs and add some extra ifs to exclude those, and suddenly it starts being a very clumsy trigger, but I don't know if there is a better way.

[This message has been edited by HailToTheOboe (edited 03-12-2008 @ 06:04 PM).]

Mythic_Freak
Mortal
posted 12 March 2008 06:12 PM EDT (US)     979 / 2502       
I found that out by using Set Tech Status trigger in a scenario, then opening trigtemp.xs and seeing what values were put in the arguments.
The quick way is looking at the AI doc file, it has really helpful info in it.
//Tech Status:
const int cTechStatusUnobtainable=0;
const int cTechStatusObtainable=1;
const int cTechStatusAvailable=2;
const int cTechStatusResearching=3;
const int cTechStatusActive=4;
const int cTechStatusPersistent=5;
You can't use those comprehensive names in triggers without defining them yourself though.
I still don't understand what they are all for though.
Oh, and there are 507 techs for TT, vanilla will have less, but if the number doesn't exist, it will probably just return false or something.

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

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

[This message has been edited by Mythic_Freak (edited 03-12-2008 @ 06:13 PM).]

Sir_Simant
Mortal
posted 12 March 2008 06:24 PM EDT (US)     980 / 2502       
Will this work?

<Param name="PlayerID1" dispName="Player1" VarType="player">0</Param>
<Param name="PlayerID2" dispName="Player2" VarType="player">0</Param>
<Command>for(i=500;>0){</Command><!-- I guess thats about how many techs there are -->
<Command>if(kbTechTreeIsMinorGod(i) == false){</Command><!-- It is not a minor God -->
<Command>if(trTechStatusActive(%PlayerID1%, i)){</Command><!-- Player1 Has The Tech -->
<Command>xsSetContextPlayer(%PlayerID2%);</Command>
<Command>if(kbGetTechStatus(i) == 1){</Command><!-- Player2 Is Able to research tech; What is the value for obtainable? -->
<Command>trTechSetStatus(%PlayerID2%, i, 4);</Command><!-- Give Player2 Tech -->
<Command>}}}}</Command>
</Effect>

Does kbGetTechStatus return 1 if the player does not have the resources to research it?

[This message has been edited by Sir_Simant (edited 03-12-2008 @ 06:26 PM).]

greyshark
Mortal
posted 12 March 2008 06:34 PM EDT (US)     981 / 2502       
Type - Condition
Name - Unit kills unit of team
Description - A specified unit kills a unit from a specified team. E.g., militia, from team 2, kills any unit from team 1.

Thanks!
Baseballkid14
Mortal
posted 12 March 2008 08:14 PM EDT (US)     982 / 2502       
Someone asked for something like this in a different thread so I tried to make it. It worked (half). It took me about 5 tries to get where I'm at now (because I'm not good at judging when I need ; ) Anyway, at first it caused trigger breakdown, then I fixed it (by removing a ; ) so it doesn't cause trigger breakdown, it just doesn't work. Here it is:
   <Effect name="Boot By Culture">
<Param name="Culture" dispName="Culture" VarType="string">Greek</Param>
<Param name="Message" dispName="Add Boot Message" VarType="bool">true</Param>
<Command>for(p=cNumberPlayers;>0) {</Command>
<Command>if(kbGetCultureName(kbGetCultureForPlayer(p)) == "%Culture%") {</Command>
<Command>trSetPlayerDefeated(p);</Command>
<Command>trPlayerKillAllUnits(p);</Command>
<Command>trPlayerKillAllBuildings(p);</Command>
<Command>if(%Message%==true)trOverlayText("Player "+p+" has been booted from the game", 3.0, -1, -1, -1);</Command>
<Command>}}</Command>
</Effect>

EDIT: oops, the semi colens turned to

[This message has been edited by Baseballkid14 (edited 03-12-2008 @ 08:16 PM).]

Sir_Simant
Mortal
posted 13 March 2008 01:24 AM EDT (US)     983 / 2502       
Type - Effect
Name - Show Score Freeze Tag
Input Paramaters - Unit, (player does not own)
Description - for each player in the game that does not own the selected unit, show it on the scoreboard, displays the text (scoreboard), for each:
'%PlayerID% + " - Frozen " + trPlayerResourceCount(%PlayerID%, "Food") + " : Saves " + trPlayerResourceCount(%PlayerID%, "Gold")'

Usage Example - In my scenerio each time a unit saves another unit +1 gold, and each time that it is frozen +1 food. I want there to be a scoreboard (on the right side of screen) that can be updated, to show how many times a player has been frozen, and how many times they have unfrozen another unit.
angryzor
Mortal
posted 13 March 2008 06:16 AM EDT (US)     984 / 2502       
@Baseballkid:

You can't just use commands that start with kb everywhere you want to.
Thats because they were designed for AI and are thus designed to work for just one player.
Save a few exceptions (kbGetBlockID, kbGetID, kbGetProtoName, ...),
you will need to add this in front of your trigger to tell them for which player they should operate:
<Command>for(pID=0;>1){} pID = xsGetContextPlayer();</Command>
<Command>xsSetContextPlayer(puttheplayernumberyouwantthetriggerstowor konhere);</Command>
and put this at the end,l to turn it back to normal:
<Command>xsSetContextPlayer(pID);</Command>

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!
nottud
Mortal
posted 13 March 2008 12:53 PM EDT (US)     985 / 2502       
Here is a question:

Why do the commands that begin with kb work while the ones beginning with ai don't? Is it because they both run independently of each other on "different servers"?

The boy with the mad imagination
Prepare for the ultimate duel!
Learn to use all my triggers and what you can do with them. Visit here.
Find out and download the transform trigger here.
Play some minigames I have created outside AOM including some 3D games here.
Mythic_Freak
Mortal
posted 13 March 2008 01:31 PM EDT (US)     986 / 2502       
The prefixes of the commands divide them in subgroups, those are each assigned to a context where they may execute.

console/con files/UI: console
triggers: TR, KB, XS, console
AI file: AI, KB, XS
RM file: RM

As you can see, triggers are already very flexible. AI commands would make them way to powerful.


@Angrzor, but the kbGetContextPlayer() won't always work (not without AI), so you must use another way to find the current player. Or just leave the last set out, since it doesn't seem to cause any other triggers to fail. (Perhaps if they are nested, I'm not sure.)

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

Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
angryzor
Mortal
posted 13 March 2008 01:54 PM EDT (US)     987 / 2502       
Current player? Triggers don't need a current player. I only use that (as you mentioned) to be able to nest triggers. (to introduce some sort of stack-like behaviour)

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!

[This message has been edited by angryzor (edited 03-13-2008 @ 02:05 PM).]

Baseballkid14
Mortal
posted 13 March 2008 02:45 PM EDT (US)     988 / 2502       
Here is the code I used.
   <Effect name="Boot By Culture">
<Param name="Culture" dispName="Culture" VarType="string">Greek</Param>
<Param name="Message" dispName="Add Boot Message" VarType="bool">true</Param>
<Command>for(p=cNumberPlayers;>0) {</Command>
<Command>for(pID=0;>1){} pID = xsGetContextPlayer();</Command>
<Command>xsSetContextPlayer(p);</Command>
<Command>if(kbGetCultureName(kbGetCultureForPlayer(p)) == "%Culture%") {</Command>
<Command>trSetPlayerDefeated(p);</Command>
<Command>trPlayerKillAllUnits(p);</Command>
<Command>trPlayerKillAllBuildings(p);</Command>
<Command>if(%Message%==true)trOverlayText("Player "+p+" has been booted from the game", 3.0, -1, -1, -1);</Command>
<Command>xsSetContextPlayer(pID);</Command>
<Command>}}</Command>
</Effect>
Same thing happens it works only half
angryzor
Mortal
posted 13 March 2008 03:18 PM EDT (US)     989 / 2502       
Hmmm... And the get culture doesn't even need the Context player thingie. It's one of the exceptions apparently.

... weird. the code looks correct
*goes to test*

[edit]Found it

this code should work:
   <Effect name="Boot By Culture">
<Param name="Culture" dispName="Culture" VarType="string">Greek</Param>
<Param name="Message" dispName="Add Boot Message" VarType="bool">true</Param>
<Command>for(p=(cNumberPlayers-1);>0) {</Command>
<Command>if(kbGetCultureName(kbGetCultureForPlayer(p)) == "%Culture%") {</Command>
<Command>trSetPlayerDefeated(p);</Command>
<Command>trPlayerKillAllUnits(p);</Command>
<Command>trPlayerKillAllBuildings(p);</Command>
<Command>if(%Message%==true)trOverlayText("Player "+p+" has been booted from the game", 3.0, -1, -1, -1);</Command>
<Command>}}</Command>
</Effect>
cNumberPlayers gives the number of players, including Mother Nature. however, the IDs of these players start from 0 (0 = Gaia).
so, you have to run from the number of players minus one down to player 1. Otherwise, you would try to get the culture of a player with an ID higher then the highest players ID. the game crashes on that.

That said,
heres also an update onsome triggers i posted earlier that had this mistake too:
<Effect name="Grant Resources to ALL Players">
<Param name="ResName" dispName="Resource" varType="resource">food</Param>
<Param name="Amount" dispName="Amount" varType="long">100</Param>
<Command>for(p=(cNumberPlayers-1);>0) trPlayerGrantResources(p, "%ResName%", %Amount%);</Command>
</Effect>
<Effect name="Grant Resources to ALL HUMAN Players">
<Param name="ResName" dispName="Resource" varType="resource">food</Param>
<Param name="Amount" dispName="Amount" varType="long">100</Param>
<Command>for(p=(cNumberPlayers-1);>0){ if(kbIsPlayerHuman(p)) trPlayerGrantResources(p, "%ResName%", %Amount%);}</Command>
</Effect>

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!

[This message has been edited by angryzor (edited 03-13-2008 @ 03:43 PM).]

Mythic_Freak
Mortal
posted 13 March 2008 04:07 PM EDT (US)     990 / 2502       
cNumberPlayers gives the number of players, including Mother Nature. however, the IDs of these players start from 0 (0 = Gaia).
so, you have to run from the number of players minus one down to player 1. Otherwise, you would try to get the culture of a player with an ID higher then the highest players ID. the game crashes on that.
for(i=cNumberPlayers-1;0> {
Common RMS knowledge. BBK14 even almost had it right there 2 pages back.

Did you try cNumberNonGaiaPlayers yet? Maybe that works in triggers too. (It's just cNumberPlayers-1 though...)

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

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

[This message has been edited by Mythic_Freak (edited 03-13-2008 @ 04:10 PM).]

angryzor
Mortal
posted 13 March 2008 04:13 PM EDT (US)     991 / 2502       
don't think so. Unlike all other working constants (well, the few that work ) i didn't see it in the debugger iirc.
for(i=cNumberPlayers-1;0> {
Common RMS knowledge. BBK14 even almost had it right there 2 pages back.
lol i know.
When I finally saw it (I just didn't even think about looking for it there) I was really thinking omg what a stupid mistake, just looping too far lol.

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!
Sir_Simant
Mortal
posted 13 March 2008 05:44 PM EDT (US)     992 / 2502       
Where is my mistake? I tried to test it, but it wouldnt even appear in trigger list.

<Effect name="Freeze Tag Save Unit">
<Param name="FreezeTagArmy" dispName="Runners" VarType="group">default</Param>
<Param name="ProtoUnit" dispName="Of Unit Type" varType="protounit">Villager Greek</Param>
<Param name="MaxDist" dispName="Radius to other runner" varType="float">0</Param>
<Param name="ProtoUnit2" dispName="Of Unit Type" varType="protounit">Dig Pile</Param>
<Param name="MaxDist2" dispName="Distance of Units To" varType="float">0</Param>
<Param name="TargetUnit" dispName="Unit" varType="unit">default</Param>
<Command>for(sID=0;>0){}for(rID=0;>0){}</Command>
<Command>for(i=kbArmyGetNumberUnits(kbArmyGetID("%FreezeTagArmy%"));>0){</Command>
<Command>trUnitSelectClear();</Command>
<Command>sID = kbArmyGetUnitID(kbArmyGetID("%FreezeTagArmy%"), i);</Command>
<Command>trUnitSelectByID(sID);</Command>
<Command>for(p=12;>0){if(trUnitIsOwnedBy(p)){break;}}</Command>
<Command>if(p!=-1){</Command>
<Command>xsSetContextPlayer(p);</Command>
<Command>if(kbUnitIsType(sID, kbGetProtoUnitID("%ProtoUnit%"))){</Command>
<Command>for(ii=kbArmyGetNumberUnits(kbArmyGetID("%FreezeTagArmy%"));>0){</Command>
<Command>rID = kbArmyGetUnitID(kbArmyGetID("%FreezeTagArmy%"), ii);</Command>
<Command>if(rID != sID){</Command>
<Command>trUnitSelectClear();</Command>
<Command>trUnitSelectByID(rID);</Command>
<Command>for(po=12;>0){if(trUnitIsOwnedBy(p)){break;}}</Command>
<Command>if(po!=-1){</Command>
<Command>xsSetContextPlayer(po);</Command>
<Command>if(kbUnitIsType(rID, kbGetProtoUnitID("%ProtoUnit2%"))){</Command>
<Command>if(trUnitDistanceToUnitID(sID) < %MaxDist%){</Command>
<Command>if(trUnitDistanceToUnit("%TargetUnit%") < %MaxDist2%){</Command>
<Command>trUnitChangeProtoUnit("%ProtoUnit%");</Command>
<Command>trPlayerGrantResources(p, "Food", 1);</Command>
<Command>}}}}}}}}}</Command>
</Effect>

Is it syntax error? or what?

[This message has been edited by Sir_Simant (edited 03-14-2008 @ 01:56 PM).]

Baseballkid14
Mortal
posted 13 March 2008 06:22 PM EDT (US)     993 / 2502       
Hey, I'm wondering if this trigger will work. It's a bit weird
   <Effect name="Culture Send Chat">
<Param name="IMP" dispName="IMPORTANT" VarType="string">This sends the chat with the culture name in place of the players account name</Param>
<Param name="PlayerID" dispName="Player" VarType="player">1</Param>
<Param name="Message" dispName="Message" VarType="string">default</Param>
<Command>trChatSendSpoofed(%PlayerID%, ""+(kbGetCultureForPlayer(%PlayerID%))+":"%Message%">;</Command>
</Effect>
thanks


oops, meant to do this one...
   <Effect name="Culture Send Chat">
<Param name="IMP" dispName="IMPORTANT" VarType="string">This sends the chat with the culture name in place of the players account name</Param>
<Param name="PlayerID" dispName="Player" VarType="player">1</Param>
<Param name="Message" dispName="Message" VarType="string">default</Param>
<Command>trChatSendSpoofed(%PlayerID%, ""+(kbGetCultureName(%PlayerID%))+":"%Message%">;</Command>
</Effect>

[This message has been edited by Baseballkid14 (edited 03-13-2008 @ 06:26 PM).]

Mythic_Freak
Mortal
posted 13 March 2008 06:26 PM EDT (US)     994 / 2502       
Why don't you just try it.
...)+":"%Message%">
There's a quote too much. And where did the > come from?
<Command>trChatSendSpoofed(%PlayerID%, kbGetCultureName(%PlayerID%)+": %Message%");</Command>
Try that.

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

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

[This message has been edited by Mythic_Freak (edited 03-13-2008 @ 06:28 PM).]

nottud
Mortal
posted 13 March 2008 06:37 PM EDT (US)     995 / 2502       
Ah - just noticed you editted your message.

The boy with the mad imagination
Prepare for the ultimate duel!
Learn to use all my triggers and what you can do with them. Visit here.
Find out and download the transform trigger here.
Play some minigames I have created outside AOM including some 3D games here.

[This message has been edited by nottud (edited 03-13-2008 @ 06:38 PM).]

Baseballkid14
Mortal
posted 13 March 2008 06:40 PM EDT (US)     996 / 2502       
Oops, i originally made it w/o the quote but then i added it last minute because i saw a " after message and quickly added on ebefore although i originnnlly didn't do that and i made this fast and accidentily did > in place or ).


Edit: well, well, well, it worked, well, kind of,

it sent the chat but it said egyptian when my culture was greek. (zeus)

and can someone explain why there is only one +" instead of two, i'm a little confused by how that works
   <Effect name="Culture Send Chat">
<Param name="IMP" dispName="IMPORTANT" VarType="string">This sends the chat with the culture name in place of the players account name</Param>
<Param name="PlayerID" dispName="Player" VarType="player">1</Param>
<Param name="Message" dispName="Message" VarType="string">default</Param>
<Command>trChatSendSpoofed(%PlayerID%, kbGetCultureName(%PlayerID%)+": %Message%");</Command>
</Effect>
I kind of get it but not 100%. I think it adds the culture name of the player to the chat but i;m not completely sure.


Oh, and why does it think my culture is egyptian??!!??!?

[This message has been edited by Baseballkid14 (edited 03-13-2008 @ 06:57 PM).]

angryzor
Mortal
posted 13 March 2008 09:27 PM EDT (US)     997 / 2502       
Because you're not getting the player's culture name.
You forgot kbGetCultureForPlayer.
<Command>trChatSendSpoofed(%PlayerID%, kbGetCultureName(%PlayerID%)+": %Message%");</Command>
should be
<Command>trChatSendSpoofed(%PlayerID%, kbGetCultureName(kbGetCultureForPlayer(%PlayerID%))+": %Message%");</Command>

Angry Levels|SIMSTools|PHTC|TriggersToOne Trigger Anti Edit Utility
Triggers coming up quite soon: Camera Master!!!!! (Have complete control over your camera. Make Camera tracks based on unit positions, aim the camera based on mathematical expressions. Multiple levels of advancedness!
Ace5762
Mortal
posted 14 March 2008 03:53 AM EDT (US)     998 / 2502       
Could anyone make an easy 'buy lot' trigger? If there is already one, could you give me a link

This is my signature. I wasn't feeling enthusiastic enough to write something witty. Sorry everyone, sorry.
Baseballkid14
Mortal
posted 14 March 2008 07:03 AM EDT (US)     999 / 2502       
I made some but if you're talking about a shop then it would be called Easy Shop Effect in nottuds pack. (i made some more specific ones) if you want mine you'll have to wait
Mythic_Freak
Mortal
posted 14 March 2008 10:23 AM EDT (US)     1000 / 2502       
and can someone explain why there is only one +" instead of two, i'm a little confused by how that works
Well, a group of words between quotes will be interpreted as a string, and not as code. So if you would do:

trChatSendSpoofed("My message kbGetCultureName(kbGetCultureForPlayer(%PlayerID%))");

it would just send that text to the chat literally, without executing the command. So commands shouldn't be between quotes.

Whatever value is returned by a function will be converted into a string by the compiler if it sees you want to add it to another string. Say a function returns 1 (an interger, without quotes) and you want to output it like:

trChatSendSpoofed(myFunctionThatReturnsInt);

The compliler will add the quotes for you automatically. So it converts too:

trChatSendSpoofed("1");

So you don't have to add them yourself.

When it returns a string like "greek" the quotes are already added to the return value. And the + operator just concatenates 2 strings (put one right after the other). So you have your function kbGetCultureName(kbGetCultureForPlayer(%PlayerID%)) that returns a string (with quotes included) you have to concatenate it by using the + operator with the other string(s) you want:

trChatSendSpoofed("blablabla "+kbGetCultureName(kbGetCultureForPlayer(%PlayerID%))+" blablabla"); ==(execute command)==>
trChatSendSpoofed("blablabla "+"greek"+" blablabla"); ==(execute + operator)==>
trChatSendSpoofed("blablabla greek blablabla");

Of course you have to add the spaced bewteen the 2 parts yourself, that won't happen automatically.

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

Wow, I never thought that I would actually know something before nottud did... it's actually not all that satisfying ~ Steak
« Previous Page  1 ··· 10 ··· 20 ··· 30 ··· 38 39 40 41 42 ··· 50 ··· 60 ··· 70 ··· 80 ··· 90 ··· 100  Next Page »
You must be logged in to post messages.
Please login or register

Hop to:    

Age of Mythology Heaven | HeavenGames