pftq.com
Welcome! Please Login or Register!
November 21, 2024, 02:43:23 AM
Home Login Register
pftq Forums  |  Game Design  |  Age of Empires III  |  Custom Triggers 0 Members and 1 Guest are viewing this topic. « previous next »
Latest News!Lunar Trigger(Aug 27, 2023)
Pages: [1] 2 Print
Author Topic: Custom Triggers  (Read 11241 times)
River_God
Member
*****
Offline Offline



Posts: 184

« on: November 04, 2008, 11:08:18 AM »

Ok, I have reached a point where I am limited by the stock triggers. I can't seem to find anything on custom triggers in other places either. The only thing I found was for scenarios, not custom maps. So to get me going, how do I start them, use them, type them? Is XS insertion necessary?
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #1 on: November 05, 2008, 04:40:15 PM »

XS insertion is another name for custom effects in RMS.

Look at TwentyOneScore's maps (BloodSport) on aom.heavengames.com
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #2 on: November 09, 2008, 03:11:25 PM »

Unfortunately the only dl for that map is not in any language I can read (it loads in some asian language).
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #3 on: November 09, 2008, 07:18:31 PM »

It's never in any language other than English - try opening with different encoding.

Here's the download for your reference.

* BloodSport-v3_0002.zip (71.05 KB - downloaded 278 times.)
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #4 on: November 11, 2008, 03:31:20 PM »

Thanks, not sure why it wasn't working.
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #5 on: November 16, 2008, 03:28:20 PM »

ok, I get the whole send message thing, and the end globals to end it. What I don't get yet are the triggers themselves. Blood sport is all very nicely complicated, I can get the gist of what is going on, but there is no basic trigger I can learn from.

So, for the specific questions, I have to use the tr - trigger code yes? that I can find in the Type test?
Then, to make a trigger, do I need to stick it in a function that I have to call? or can I just call up an effect if I don't want any conditions? For example:

AddXS("trChatSend(0, \"Made by River_God\");");

I know this is a little specific to AoE, but this above should be working for me and it isn't.
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #6 on: November 17, 2008, 07:13:45 PM »

AddXS is a function defined in TOS script - double check whether I made the same function for Castle Blood, it may be slightly different.

That line should work, but remember you have to put it in a trigger as an effect.

More importantly, you have to start with a declaration and an end.  I forget but it's something along the lines of begin/end globals.  TOS should have something similar in his script (the name of the function, of course it'd be a send chat effect tho).
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #7 on: November 19, 2008, 12:45:10 PM »

Yes, I have the beginning and end, and the function AddXS itself is not the problem.

Put it in a trigger as an effect?  I guess that is where I am confused, I am not sure how to do that. Like how would I set up a specific trigger? I am so used to having rmCreateTrigger and all the other rm- code, I seem to be looking for an equivalent, without success.
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #8 on: November 19, 2008, 05:03:45 PM »

As in - use the global start/end and AddXS like you would condition or effect.  Don't leave them hanging out in the middle of the script; they have to be part of a trigger.
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #9 on: November 21, 2008, 02:32:49 PM »

No, I had those fine, the Globals start and end are in the same function, AddXS is another function made before and the code inserted is in the same function as the globals, between the start and end. Still not working.
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #10 on: November 22, 2008, 10:23:40 AM »

Define not working.
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #11 on: November 24, 2008, 11:07:16 AM »

it loads, but nothing happens.
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #12 on: November 24, 2008, 08:00:10 PM »

Ok so it doesn't crash the map.  Does it crash the other triggers (or do they still function as normal)?

What is the code you put?
Logged
River_God
Member
*****
Offline Offline



Posts: 184

« Reply #13 on: November 26, 2008, 12:16:38 PM »

I didn't have any other triggers. But I will try that to see if they do. This was my code:
void AddTriggerCode(string code="") {
   rmAddTriggerEffect("Send Chat");
   rmSetTriggerEffectParam("Message", "*/"+code+"/*", false);
}
void InjectXS() {
int id = rmCreateTrigger("DeclareGlobalsStart");
rmSwitchToTrigger(id);
rmSetTriggerActive(false);
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParam("Message", "\"); }} /*", false);
AddTriggerCode("true; trChatSend(0, \"hmmmm\");");

rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParam("Message", "*/ rule _DeclareGlobalsEnd inactive { if (1==1) { trChatSend(0, \"", false);
}

then in the main:

InjectXS();
Logged

"I am not sure why people are so afraid of new ideas, I am afraid of the old ones"   :p
pftq
Administrator
*****
Offline Offline



Posts: 4204

WWW
« Reply #14 on: November 26, 2008, 01:21:31 PM »

Take out true; in AddTriggerCode.  There's no reason for it to be there.
Logged
Pages: [1] 2 Print 
pftq Forums  |  Game Design  |  Age of Empires III  |  Custom Triggers « previous next »
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2006-2007, Simple Machines | RSS Feed Valid XHTML 1.0! Valid CSS!
Page created in 0.099 seconds with 21 queries.