< < < How to use it: Playtest the scenario and you'll see a message box that displays your global variable and increments it each time it is displayed. Sweet. Now let's add a user condition using our new global: 9) Add a third trigger to your scenario, loop it and put it on a 2 second timer. Playtest the scenario and you'll see a message box that displays your global variable and increments it each time it is displayed. But now, every other time the message box displays, you will get Now to get to the nitty gritty and how it works behind the scenes. If you set up the triggers as I have indicated you will generate the following code in the trigtemp.xs file: Neat Stuff! I hope I explained it well, if not ask questions. It's definately advanced stuff and you can easily break your triggers with no easy way to debug them, but for the skilled user this is a major advancement and worth looking into. [This message has been edited by TwentyOneScore (edited 03-18-2003 @ 11:31 PM).]
<
<
<
<
<
<
<
<
<
<
<
<
<
<
<
1) Create a new scenario and place some units for players 1 & 2 so the game don't end quickly.
2) Add a trigger, make it inactive and leave the default settings for Conditions.
3) Go to the trigger effects and change the first effect to
4) Insert a second effect and set it to
5) Insert a third effect and set it to
6) Create a second trigger, loop it, and put it on a 2 second timer.
7) Add a Message effect for the new trigger with the text equal
8) Add a second effect and set it to
10) Add a condition and set it to
11) Add an effect and set it to
01 void main(void)
02 {
03 }
04
05 rule _Trigger_0
06 minInterval 4
07 inactive
08 {
09 bool bVar0 = (true);
10 if (bVar0)
11 {
12 }
13 }
14 /**/ int MyGlobal=1;
15 rule _DeclareGlobalsEnd
16 inactive
17 {
18 if (1==1) {
19 xsDisableRule("_Trigger_0");
20 trEcho("Trigger disabling rule Trigger_0");
21 }
22 }
23
24 rule _Trigger_1
25 minInterval 4
26 active
27 {
28 bool bVar0 = ((trTime()-cActivationTime) >
29 if (bVar0)
30 {
31 trMessageSetText("MyGlobal is now = "+MyGlobal+"!!", 3000);
32 /**/ MyGlobal++;
33 xsDisableRule("_Trigger_1");
34 trEcho("Trigger disabling rule Trigger_1");
35 trDelayedRuleActivation("_Trigger_1");
36 }
37 }
38
39 rule _Trigger_2
40 minInterval 4
41 active
42 {
43 bool bVar0 = (((MyGlobal%2)==0));
44 bool bVar1 = ((trTime()-cActivationTime) >
45 if (bVar0 && bVar1)
46 {
47 trPlayerGrantResources(1, "Food", MyGlobal);
48 xsDisableRule("_Trigger_2");
49 trEcho("Trigger disabling rule Trigger_2");
50 trDelayedRuleActivation("_Trigger_2");
51 }
52 }
The
"Just invite him over for dinner. Turn him from an enemy into a friend. Then when he's least expecting, BAM! The old fork in the eye!" - M.S.
--
Member °ƒ Tsunami Studios <<< Play TOS Maps - 9 Maps - Avg Rating: 4.67! >>>