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

Scenario Design
Moderated by MosheLevi, Mister SCP

Hop to:    
loginhomeregisterhelprules
Bottom
Topic Subject: RMS Trigger Problem
posted 01-14-06 03:52 PM EDT (US)   
I'm working on an RMS which contains a number of triggers for special game modes. These triggers work perfectly as long as I playtest them in the editor. But when I start the map from the game window the triggers usually work in two player mode, they sometimes work in three player mode and (it seems) don't work at all for four or more players. The triggertemp.xs file is created properly, so the triggers are obviously there - they just don't work. I didn't even do anything fancy: some counters, some chats, and that's it.

Any ideas?

Replies:
posted 01-14-06 05:08 PM EDT (US)     1 / 20  
Not all triggers work online.. Alot of us learned that the hard way.


Check the Scen Design Database/Library or whatever it's called now (pinned at top). There's a list I think.

posted 01-14-06 05:14 PM EDT (US)     2 / 20  
I no nothing about RMS and may be miles off, but if the triggers are in a seperate file and you transfered it over eso, are you sure the trigger file got transfered?

Edit: Nvm, just let my stupidity go unnoticed


I think FOG.

[This message has been edited by Villi (edited 01-14-2006 @ 05:15 PM).]

posted 01-15-06 02:29 AM EDT (US)     3 / 20  

Quote:

Not all triggers work online

I know, but I get this problem without even going online, on a single machine. So these kinds of problems can be ruled out.

posted 01-15-06 11:02 AM EDT (US)     4 / 20  
Could you paste the code here?

posted 01-16-06 01:59 PM EDT (US)     5 / 20  
I doubt that it will help - as I said, the triggers work perfectly in the editor or when the map is started with two players only. But desperate times call for desperate measures, so here it is:


// Init quest vars
rmCreateTrigger("InitQuestVar");
rmSwitchToTrigger(rmTriggerID("InitQuestVar"));
rmSetTriggerActive(true);
rmSetTriggerLoop(false);
rmSetTriggerRunImmediately(true);
rmSetTriggerPriority(4);
for (i = 1; <=cNumberNonGaiaPlayers)
{
rmAddTriggerEffect("Quest Var Set");
rmSetTriggerEffectParam("QVName", "CounterActive"+i);
rmSetTriggerEffectParamInt("Value", 0);
}

// Initial message
rmCreateTrigger("KotHMessage");
rmSwitchToTrigger(rmTriggerID("KotHMessage"));
rmSetTriggerActive(true);
rmSetTriggerLoop(false);
rmSetTriggerRunImmediately(true);
rmSetTriggerPriority(4);
rmAddTriggerCondition("Timer");
rmSetTriggerConditionParamInt("Param1", 2);
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParamInt("PlayerID", 0);
rmSetTriggerEffectParam("Message", " ");
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParamInt("PlayerID", 0);
rmSetTriggerEffectParam("Message", " ");
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParamInt("PlayerID", 0);
rmSetTriggerEffectParam("Message", "King of the Valleys, King of the Hill style!");
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParamInt("PlayerID", 0);
rmSetTriggerEffectParam("Message", "Capture all trading posts to start victory counter.");
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParamInt("PlayerID", 0);
rmSetTriggerEffectParam("Message", "Destroy two trading posts to stop victory counter.");
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParamInt("PlayerID", 0);
rmSetTriggerEffectParam("Message", " ");
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParamInt("PlayerID", 0);
rmSetTriggerEffectParam("Message", " ");

// Counters & victory
for (i = 1; <=cNumberNonGaiaPlayers)
{
//Create all triggers first
rmCreateTrigger("StartCounter"+i);
rmCreateTrigger("StopCounter"+i);
rmCreateTrigger("Victory"+i);

// Define triggers
rmSwitchToTrigger(rmTriggerID("StartCounter"+i));
rmSetTriggerActive(true);
rmSetTriggerLoop(true);
rmSetTriggerRunImmediately(false);
rmSetTriggerPriority(4);
rmAddTriggerCondition("Player Unit Count");
rmSetTriggerConditionParamInt("PlayerID", i);
rmSetTriggerConditionParam("ProtoUnit", "TradingPost");
rmSetTriggerConditionParam("Op", "==");
rmSetTriggerConditionParamInt("Count", numTradingPosts);
rmAddTriggerCondition("Quest Var Check");
rmSetTriggerConditionParam("QuestVar", "CounterActive"+i);
rmSetTriggerConditionParam("Op", "==");
rmSetTriggerConditionParamInt("Value", 0);
rmAddTriggerEffect("Counter:Add Timer");
rmSetTriggerEffectParam("Name", "Countdown"+i);
rmSetTriggerEffectParamInt("Start", 600);
rmSetTriggerEffectParamInt("Stop", 0);
rmSetTriggerEffectParam("Msg", rmGetPlayerName(i)+" will win in");
rmSetTriggerEffectParamInt("Event", rmTriggerID("Victory"+i));
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParamInt("PlayerID", 0);
rmSetTriggerEffectParam("Message", rmGetPlayerName(i)+" has captured all trading posts!");
rmAddTriggerEffect("Quest Var Set");
rmSetTriggerEffectParam("QVName", "CounterActive"+i);
rmSetTriggerEffectParamInt("Value", 1);

rmSwitchToTrigger(rmTriggerID("StopCounter"+i));
rmSetTriggerActive(true);
rmSetTriggerLoop(true);
rmSetTriggerRunImmediately(false);
rmSetTriggerPriority(4);
rmAddTriggerCondition("Player Unit Count");
rmSetTriggerConditionParamInt("PlayerID", i);
rmSetTriggerConditionParam("ProtoUnit", "TradingPost");
rmSetTriggerConditionParam("Op", "<");
rmSetTriggerConditionParamInt("Count", (numTradingPosts - 1));
rmAddTriggerCondition("Quest Var Check");
rmSetTriggerConditionParam("QuestVar", "CounterActive"+i);
rmSetTriggerConditionParam("Op", "==");
rmSetTriggerConditionParamInt("Value", 1);
rmAddTriggerEffect("Counter Stop");
rmSetTriggerEffectParam("Name", "Countdown"+i);
rmAddTriggerEffect("Send Chat");
rmSetTriggerEffectParamInt("PlayerID", 0);
rmSetTriggerEffectParam("Message", "Two trading posts of "+rmGetPlayerName(i)+" have been destroyed and the victory counter stopped!");
rmAddTriggerEffect("Quest Var Set");
rmSetTriggerEffectParam("QVName", "CounterActive"+i);
rmSetTriggerEffectParamInt("Value", 0);

rmSwitchToTrigger(rmTriggerID("Victory"+i));
rmSetTriggerActive(false);
rmSetTriggerLoop(false);
rmSetTriggerRunImmediately(false);
rmSetTriggerPriority(4);
rmAddTriggerEffect("Set Player Won");
rmSetTriggerEffectParamInt("Player", i);
rmAddTriggerEffect("End Game");
}


Ok - ideas, anyone?

posted 01-16-06 02:27 PM EDT (US)     6 / 20  
Seems fine but I'm not sure what I'm looking for. Could you state exactly what doesn't work or what happens?
posted 01-16-06 02:45 PM EDT (US)     7 / 20  
As mentioned in my first post, the triggers work perfectly as long as I playtest them in the editor, so the syntax is obviously correct. But when I start the map from the game window (single player) the triggers usually work in two player mode, they sometimes work in three player mode and (it seems) don't work at all for four or more players. The triggertemp.xs file is created properly, so the triggers are obviously there - they just don't work. It's as if they were all set to inactive (which is not the case, as the triggertemp.xs file clearly shows).

I have the same problem if I just take the code provided here and add it to a "skeleton map" with nothing but player TCs. You can actually try it out for yourself - just add the code to any working random map script. See if you receive the initial message in two player mode, and then check what happens in six player mode.

posted 01-16-06 02:50 PM EDT (US)     8 / 20  
hmm .. the code looks unsuspiciously on first view.
You said "..on a single machine.." - I assume, the other players are NPC? Then it could be, that the NPC AI's triggers interfere with your triggers (timing problem). This is also indicated by the fact, they work correctly with less players.
For test, I suggest
1) lower the trigger priority - just for the looped triggers,
2) if possible, run the scenario on a quicker rig.,
3) try performance enhancement by reducing game options.

PS another idea
4) try increasing the loop interval - iirc the default is 3-4? I donno exactly func. name by heart - should be like 'rmSetTriggerMinInterval()'

[This message has been edited by BilboBeutlin (edited 01-16-2006 @ 03:03 PM).]

posted 01-16-06 05:35 PM EDT (US)     9 / 20  
DID U PUT DA TRIGRS IN ORDR I DON NO BUT IF DER NOT IN ORDR MAYBI THEY DON WORK? I DON NO DONT ASK MEE ALSO U HAV TO CLIK ACTIVE IN DA TRGGR THIN I THINK U FORGET EASY MAYBI U SHOLDN'T DO TRIGRS AN LEAVE IT TO DA MASTRS LIKE GAURIDAN_118 DATS WAT U SHOLUD DO
posted 01-16-06 05:41 PM EDT (US)     10 / 20  
@Cirruis
oops .. is your keyboard damaged ? or what are you drinking/smoking ? *g*
posted 01-16-06 05:55 PM EDT (US)     11 / 20  
vodka catnip cellery
posted 01-17-06 11:09 AM EDT (US)     12 / 20  

Quote:

I assume, the other players are NPC? Then it could be, that the NPC AI's triggers interfere with your triggers (timing problem).

What "AI triggers" are you referring to? Are you talking about the rules in the AI script?


Quote:

For test, I suggest...

I'm using a 3.4 GHz machine - if that's not enough to process these few triggers... Anyway, you've given me an idea or two to play around with. As an engineer you learn never to exclude anything off-hand.

posted 01-17-06 11:50 AM EDT (US)     13 / 20  
Yes, triggers => rules in XS (see trigtemp.xs).

Indeed, machine power should master it easily. However, if they kept the method, triggers (rules) are handled frame dependent, not after realtime clock. So lightening the frame procedure could help in some cases, when more triggers are enqueued.

posted 01-18-06 03:44 PM EDT (US)     14 / 20  
Put a Timer in your looping trigger. This is certainly the problem.

Why do you need something to fire constantly? Put 2-3 second timer so that the condition is not checked every millisecond.

Then change the condition from == to >= (otherwise if someone quickly builds 2 outpost you'll skip the equal part).

posted 01-20-06 04:40 AM EDT (US)     15 / 20  
Ok, I've solved it.

As I expected, it was not about timing - any PC with the necessary hardware to run AoE3 can deal with a handfull of looping triggers, even at priority 4.

The problem lies with the rmGetPlayerName() function which is buggy. Even if it's not used within another function like rmSetTriggerEffectParam() it causes the triggers to stop working if there are more than three players in the game. Too bad, this would have been a useful little function!

The good news is that it was easy to work around this problem, so I've been able to upload two King of the Hill style maps which should soon be available in the RMS section.


Quote:

Then change the condition from == to >= (otherwise if someone quickly builds 2 outpost you'll skip the equal part).

As you might notice I've done it this way for the second condition. For the first one the scenario you described is impossible, so I went with the '==' condition for reasons of code legibility.


Quote:

Why do you need something to fire constantly? Put 2-3 second timer so that the condition is not checked every millisecond.

Remember we're talking about player interaction here. Since the player can see the trading posts going up (or down) he'll expect the timer to start/stop immediately, and not after a few seconds. Just imagine the reaction of a player who thinks he has stopped the timer in typical James Bond fashion at 0:01, only to see it hit zero because the check is not due for another two seconds...


Thanks for the help people!

posted 01-20-06 07:26 PM EDT (US)     16 / 20  
That's odd - fort wars uses rmGetPlayerName constantly. Might want to further check out the problem as i doubt it's buggy.
posted 01-21-06 05:26 AM EDT (US)     17 / 20  
...and so the last piece of the puzzle falls into place...

Language-specific characters cause the problem. The code above works fine, as long as no one called "Gunnbjörn Ulfsson" or something like that joins the game.

I haven't checked Fort Wars, but I assume that the triggers would stop working there as well if someone with an "ö" (or probably any other non-standard english ascii character) in the name joined in.

posted 01-21-06 05:34 AM EDT (US)     18 / 20  
Aha! Good find.
posted 01-21-06 04:23 PM EDT (US)     19 / 20  
Yeah .. nice to see.
Assuming, such text evaluation routines are also used by other functions, one can be sure that non-ASCII chars make trouble also on other situations.
Evidence of incapacity for ES programmers .. meanwhile the existence of language special chars should be known.
posted 01-25-06 01:31 PM EDT (US)     20 / 20  

Quote:

Evidence of incapacity for ES programmers ..

Though I have a VERY clear opinion on this subject, let's remain fair - the rmGetPlayerName() function is not used anywhere in the "regular" map scripts, so it doesn't cause problems there.

Anyway: Does anyone know a way to access the player's names in a RMS without using this function? Here's the code for the AoM King of the Hill map:

//rmSetTriggerEffectParam("Message", rmGetPlayerName(i)+" has captured the Plenty Vault! Countdown begins!");
rmSetTriggerEffectParam("Message", "{PlayerNameString("+i+",22593)}");

The rmGetPlayerName() function has been replaced by the PlayerNameString construction below, but I haven't managed to use it in a similar way for AoE3. Any ideas?

Age of Empires III Heaven » Forums » Scenario Design » RMS Trigger Problem
Top
You must be logged in to post messages.
Please login or register
Hop to:    
Age of Empires III Heaven | HeavenGames