HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Heavy Trigger Problem!

02-27-2005, 07:21 PM#1
Kalvorod
OK, here are my triggers. What happends is, there is a timer for each trigger. After the timer runs out, it starts the next set of triggers. BUT the player can also manually start the next set of triggers using an ability. All the "Next Triggers" abilities are based off of the same spell. I hope that's not the problem, but it's important to throw that out there.

The problem is that after they use a "Skip phase (#)" ability once, the rest of the "Skip Phase" abilities don't set off the triggers.

BTW: I removed anything that has nothing to do with the trigger not firing(IE: Creating units, etc)

Code:
Trade In Cards Phase
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Action
        Unit - Add Type 8 End Card Phase to (Random unit from (Units owned by PlayerTurn[CurrentTurn] of type Player))
        Unit Group - Pick every unit in (Units of type Player) and do (Actions)
            Loop - Actions
                Selection - Select (Picked unit) for (Owner of (Picked unit))
        Trigger - Turn off (This trigger)
        Trigger - Turn on Timer <gen>
        Trigger - Turn on Phase 1 End <gen>
        Countdown Timer - Start Timer as a One-shot timer that will expire in 30.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title Trade in your Card ...


Code:
Phase 1 End
    Events
        Unit - A unit Begins casting an ability
    Conditions
        (Ability being cast) Equal to Type 8 End Card Phase
        (Unit-type of (Casting unit)) Equal to Player
    Actions
        Countdown Timer - Destroy (Last created timer window)
        Trigger - Turn off Timer <gen>
        Trigger - Turn off Phase 1 End <gen>
        Unit - Remove Type 8 End Card Phase from (Random unit from (Units owned by PlayerTurn[CurrentTurn] of type Player))
        Trigger - Turn on Buy Units Phase Start <gen>

Code:
Timer
    Events
        Time - Timer expires
    Conditions
    Actions
        Trigger - Run Phase 1 End <gen> (ignoring conditions)

Code:
Buy Units Phase Start
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Actions
        Unit - Add Type 8 End Place Unit Phase to (Random unit from (Units owned by PlayerTurn[CurrentTurn] of type Player))
        Trigger - Turn off (This trigger)
        Countdown Timer - Start Timer as a One-shot timer that will expire in 45.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title Place Your Armies
        Trigger - Turn on Timer 2 <gen>
        Trigger - Turn on Phase 2 End <gen>




OK, so that's how each one of them go basically. Time runs out, it turns off the phase 1 triggers, turns on the phase 2 triggers. Time runs out, turns off the phase 2 triggers, turns on the phase 3 triggers.

The only problem is with skipping the timer. I have a feeling that it's going to be because all of the "SKip" spells are based off of the same base, so I'll go ahead and try to fix that, but I really ask that someone read these and make sure they work right.
02-27-2005, 08:05 PM#2
Kamux
I dont understand why you use a periodic event for: Trade In Cards Phase and Buy Units Phase Start. Every 0.1 seconds timer is set again to 30 seconds, so it will never expire...
02-27-2005, 09:24 PM#3
Raptor--
well at a quick glance i don't see any immediate problems with the triggers

although, i don't see why you're using a periodic event for the 2 phase triggers
it would be easier just to "Run Trigger (whatever) (Checking Conditions)" then you don't have to worry about turning them on and off either
02-27-2005, 10:15 PM#4
Kalvorod
Quote:
Originally Posted by Raptor--
well at a quick glance i don't see any immediate problems with the triggers

although, i don't see why you're using a periodic event for the 2 phase triggers
it would be easier just to "Run Trigger (whatever) (Checking Conditions)" then you don't have to worry about turning them on and off either

I had actually thought about that earlier in the week, but I already have this much done.

I solved the problem people! HURRAY!

I got the idea from a post here about how to turn off Wind Walk. Of course, you just turn on the switch in the game settings menu. But he said something about trying to take away windwalk, and give an ability to turn it off. When ever he took the windwalk away, the unit couldn't move.

Mine had the same problem when I did it.


What I did was changed "When a unit begins casting an ability" to "When a unit finishes casting an ability"

VIOLA!
02-28-2005, 01:38 AM#5
thedevil
Quote:
Originally Posted by Kalvorod
OK, here are my triggers. What happends is, there is a timer for each trigger. After the timer runs out, it starts the next set of triggers. BUT the player can also manually start the next set of triggers using an ability. All the "Next Triggers" abilities are based off of the same spell. I hope that's not the problem, but it's important to throw that out there.

The problem is that after they use a "Skip phase (#)" ability once, the rest of the "Skip Phase" abilities don't set off the triggers.

BTW: I removed anything that has nothing to do with the trigger not firing(IE: Creating units, etc)

Code:
Trade In Cards Phase
    Events
        Time - Every 0.10 seconds of game time
    Conditions
    Action
        Unit - Add Type 8 End Card Phase to (Random unit from (Units owned by PlayerTurn[CurrentTurn] of type Player))
        Unit Group - Pick every unit in (Units of type Player) and do (Actions)
            Loop - Actions
                Selection - Select (Picked unit) for (Owner of (Picked unit))
        Trigger - Turn off (This trigger)
        Trigger - Turn on Timer <gen>
        Trigger - Turn on Phase 1 End <gen>
        Countdown Timer - Start Timer as a One-shot timer that will expire in 30.00 seconds
        Countdown Timer - Create a timer window for (Last started timer) with title Trade in your Card ...


OK, so that's how each one of them go basically. Time runs out, it turns off the phase 1 triggers, turns on the phase 2 triggers. Time runs out, turns off the phase 2 triggers, turns on the phase 3 triggers.

The only problem is with skipping the timer. I have a feeling that it's going to be because all of the "SKip" spells are based off of the same base, so I'll go ahead and try to fix that, but I really ask that someone read these and make sure they work right.
In ur ''trade in card phase'' trigger u must leave action turn off this trigger at the end or it's will skip all action remain so that these action like turn on timer and turn on phase1 end got skip,try arrange ur action and see ^_^
02-28-2005, 06:58 AM#6
Raptor--
Quote:
Originally Posted by thedevil
In ur ''trade in card phase'' trigger u must leave action turn off this trigger at the end or it's will skip all action remain so that these action like turn on timer and turn on phase1 end got skip,try arrange ur action and see ^_^

actually that is not true

(turn off - this trigger) will turn off a trigger from ever responding to events again, but that does nothing to the current instance of the trigger

you can turn a trigger off in the very first action with a series of text statements after it and they will all run, the trigger just won't respond to whatever events have been given to it again until it is turned back on

the action 'skip remaining actions' is the one that stops the trigger in its tracks