Help buggy trigger

Weyird

Member
Reaction score
5
Hi,
In this map I'm working on there's a mode in which, by successfully channeling an ability in the center of the map for 3min, you win.
The trigger works and everything, but there are warning messages that pop up when there are 2 minutes, 1 minute and 30 seconds remaining. The way the trigger is made if the Hero stops channeling but stays in the circle then the warnings will still pop up. It's just something that bugs me but doesn't affect the game. Can you tell me how to fix this so multiple warning messages won't show?

Trigger 1: In case they try cost in wrong spot
Trigger:
  • Failcast Victoreh
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Victoreh
      • (Circle of Power <gen> contains (Triggering unit)) Equal to False
    • Actions
      • Unit - Order (Triggering unit) to Stop


Trigger 2: Clearly the trigger that makes it bug-able. It even decrares a winner, but doesn't actually cause the player to be the winner.
Trigger:
  • Begin Channel
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Victoreh
      • (Circle of Power <gen> contains (Triggering unit)) Equal to True
    • Actions
      • Unit - Add Spell Immunity to (Triggering unit)
      • Sound - Play war3mapImported\hellmarch2.wav
      • Game - Display to (All players) for 20.00 seconds the text: ((Name of (Triggering player)) + |c00FF0000has started the countdown!|r)
      • Countdown Timer - Create a timer window for (Last started timer) with title Hold Center
      • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in 180.00 seconds
      • Countdown Timer - Show (Last created timer window)
      • Wait 60.00 seconds
      • If (((Circle of Power <gen> contains (Triggering unit)) Equal to False) or (((Triggering unit) is dead) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
      • Game - Display to (All players) for 10.00 seconds the text: |c00FF00002 minutes...
      • Wait 60.00 seconds
      • If (((Circle of Power <gen> contains (Triggering unit)) Equal to False) or (((Triggering unit) is dead) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
      • Game - Display to (All players) for 10.00 seconds the text: |c00FF00001 minute ...
      • Wait 30.00 seconds
      • If (((Circle of Power <gen> contains (Triggering unit)) Equal to False) or (((Triggering unit) is dead) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
      • Game - Display to (All players) for 10.00 seconds the text: |c00FF000030 second...
      • Wait 30.00 seconds
      • If (((Circle of Power <gen> contains (Triggering unit)) Equal to False) or (((Triggering unit) is dead) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
      • Game - Display to (All players) for 20.00 seconds the text: ((Name of (Triggering player)) + |c0096FF96is the winner!|r)


Trigger 3: The countdown timers and their windows probably leak somehow, but I'm not profficient with leaks. A better way?
Trigger:
  • Stop Channel
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Victoreh
      • (Circle of Power <gen> contains (Casting unit)) Equal to True
    • Actions
      • Unit - Remove Spell Immunity from (Triggering unit)
      • Game - Display to (All players) for 10.00 seconds the text: Casting time has be...
      • Countdown Timer - Destroy (Last created timer window)
      • Countdown Timer - Pause (Last started timer)


Trigger 4: The win-causing trigger
Trigger:
  • Finish Victoreh
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Victoreh
      • (Circle of Power <gen> contains (Triggering unit)) Equal to True
    • Actions
      • Game - Victory (Owner of (Triggering unit)) (Show dialogs, Show scores)
      • Player Group - Pick every player in (All allies of (Owner of (Triggering unit))) and do (Game - Victory (Picked player) (Show dialogs, Show scores))
      • Player Group - Pick every player in (All enemies of (Owner of (Triggering unit))) and do (Game - Defeat (Picked player) with the message: Defeat!)


Hope you can help, thanks.

Edit: Fixed tags on triggers
 

laxperson808

New Member
Reaction score
9
u have it set so as long as the caster is IN the region.. itl display the warnings.. check to make sure it actully is casting (if theres a condtion for that) or use a var. casting unit = caster
if caster stops casting then set caster = no unit
 

educator

New Member
Reaction score
9
i only read it roughly but i think u shouldn't use "wait" . don't know if you can but maybe try setting the countdown timer to a variable when it gets created and when it gets to 60/30 ect create warnings. the reason the warnings keep showing up is because u made it wait, then check if the unit is there and if it is it creates the warning
 

Weyird

Member
Reaction score
5
hmm my tags must be wrong to make it look right. What's the propper tags? (you can see i tried [war3])

I don't think there's a codition for "is busy casting"... and even if there is (or if you set them to a variable), if they cast it, stop it, cast it, stop it, cast it, stop it, etc, (some have done it just to hear the smusic that plays) then when they evetually keep casting it then warning messages will still come.

I am not aware of an event that detects a timer having a set amount of time left (and i think I looked). I think it can only detect when a timer finishes. I'll look again when I get home, but I doubt there is an event like that.

Any other ideas?
 

DuelPlayer

Member
Reaction score
21
Hi,
In this map I'm working on there's a mode in which, by successfully channeling an ability in the center of the map for 3min, you win.
The trigger works and everything, but there are warning messages that pop up when there are 2 minutes, 1 minute and 30 seconds remaining. The way the trigger is made if the Hero stops channeling but stays in the circle then the warnings will still pop up. It's just something that bugs me but doesn't affect the game. Can you tell me how to fix this so multiple warning messages won't show?

Trigger 1: In case they try cost in wrong spot
Trigger:
  • Failcast Victoreh
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Victoreh
      • (Circle of Power <gen> contains (Triggering unit)) Equal to False
    • Actions
      • Unit - Order (Triggering unit) to Stop


Trigger 2: Clearly the trigger that makes it bug-able. It even decrares a winner, but doesn't actually cause the player to be the winner.
Trigger:
  • Begin Channel
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Victoreh
      • (Circle of Power <gen> contains (Triggering unit)) Equal to True
    • Actions
      • Unit - Add Spell Immunity to (Triggering unit)
      • Sound - Play war3mapImported\hellmarch2.wav
      • Game - Display to (All players) for 20.00 seconds the text: ((Name of (Triggering player)) + |c00FF0000has started the countdown!|r)
      • Countdown Timer - Create a timer window for (Last started timer) with title Hold Center
      • Countdown Timer - Start (Last started timer) as a One-shot timer that will expire in 180.00 seconds
      • Countdown Timer - Show (Last created timer window)
      • Wait 60.00 seconds
      • If (((Circle of Power <gen> contains (Triggering unit)) Equal to False) or (((Triggering unit) is dead) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
      • Game - Display to (All players) for 10.00 seconds the text: |c00FF00002 minutes...
      • Wait 60.00 seconds
      • If (((Circle of Power <gen> contains (Triggering unit)) Equal to False) or (((Triggering unit) is dead) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
      • Game - Display to (All players) for 10.00 seconds the text: |c00FF00001 minute ...
      • Wait 30.00 seconds
      • If (((Circle of Power <gen> contains (Triggering unit)) Equal to False) or (((Triggering unit) is dead) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
      • Game - Display to (All players) for 10.00 seconds the text: |c00FF000030 second...
      • Wait 30.00 seconds
      • If (((Circle of Power <gen> contains (Triggering unit)) Equal to False) or (((Triggering unit) is dead) Equal to True)) then do (Skip remaining actions) else do (Do nothing)
      • Game - Display to (All players) for 20.00 seconds the text: ((Name of (Triggering player)) + |c0096FF96is the winner!|r)


Trigger 3: The countdown timers and their windows probably leak somehow, but I'm not profficient with leaks. A better way?
Trigger:
  • Stop Channel
    • Events
      • Unit - A unit Stops casting an ability
    • Conditions
      • (Ability being cast) Equal to Victoreh
      • (Circle of Power <gen> contains (Casting unit)) Equal to True
    • Actions
      • Unit - Remove Spell Immunity from (Triggering unit)
      • Game - Display to (All players) for 10.00 seconds the text: Casting time has be...
      • Countdown Timer - Destroy (Last created timer window)
      • Countdown Timer - Pause (Last started timer)


Trigger 4: The win-causing trigger
Trigger:
  • Finish Victoreh
    • Events
      • Unit - A unit Finishes casting an ability
    • Conditions
      • (Ability being cast) Equal to Victoreh
      • (Circle of Power <gen> contains (Triggering unit)) Equal to True
    • Actions
      • Game - Victory (Owner of (Triggering unit)) (Show dialogs, Show scores)
      • Player Group - Pick every player in (All allies of (Owner of (Triggering unit))) and do (Game - Victory (Picked player) (Show dialogs, Show scores))
      • Player Group - Pick every player in (All enemies of (Owner of (Triggering unit))) and do (Game - Defeat (Picked player) with the message: Defeat!)


Hope you can help, thanks.

It is WC3 instead of war3
 

Weyird

Member
Reaction score
5
OK i fixed it by creating a "per second" trigger, and when someone starts the count-down then an intiger variable gets set to 180 and the per second variable is turned on (which, every second, reduces the intiger by 1. If it is equal to 120, 60 or 30 then it sends a warning message)
When cast time interrupted the per second trigger is switched off.

Thanks guys
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top