• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

[Trigger] HEY GUESS WHAT!!! more trigger troubles

Status
Not open for further replies.
Level 3
Joined
Jun 23, 2008
Messages
22
This spell will only cast the first time and i can't find any bugs. the idea of this spell is to create a trail of flame behind a unit then stop the trail then wait 5 seconds then destroy the trail. the first time works perfectly. plz help[RAINBOW]:cry:[/RAINBOW]

  • Cast Blaze
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Triggering unit) Equal to (Random unit from (Units owned by Player 1 (Red) matching ((Ability being cast) Equal to Blaze )))
    • Actions
      • Set Blazeunit[1] = (Triggering unit)
      • Trigger - Turn on Blaze <gen>
  • Blaze
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Peasant for Player 1 (Red) at ((Position of Mountain King 0000 <gen>) offset by -100.00 towards (Facing of Mountain King 0000 <gen>) degrees) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to FireUnitGroup
      • Set StopBlaze = (StopBlaze + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StopBlaze Equal to 55
        • Then - Actions
          • Trigger - Turn off Blaze <gen>
          • Set StopBlaze = 0
          • Wait 5.00 seconds
          • Unit Group - Pick every unit in FireUnitGroup and do (Unit - Kill (Picked unit))
          • Trigger - Turn off (This trigger)
        • Else - Actions
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
I believe the wait is the problem. You set StopBlaze to 0 before the trigger is turned off so it continues setting StopBlaze to StopBlaze + 1. Furthermore you shut down your trigger in five seconds, which gives enough time to set StopBlaze to 50, and that's a problem. What you should do is add another Set StopBlaze = 0 line after you turn off the trigger, or just set the condition StopBlaze equal to or greater then 55 and move the Set StopBlaze = 0 line below the trigger turn off.

P.S. what's the point in setting a variable for the unit if you don't use it?
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
Ah, this trigger isn't good.
But CMarket why don't you look in the trigger one more time - he turns the trigger off before setting StopBlaze to 0. Infact he turns it off 2 times.
 
Level 3
Joined
Jun 23, 2008
Messages
22
But the events still happen after the first one and if i get rid of the first turn off he continues to blaze because while he is blazing the variable is set to 0

This is what i have now and i still have the same problem. it works perfectly the first time but not any others, it won't do anytrhing but the cast animation.

  • Cast Blaze
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • (Triggering unit) Equal to (Random unit from (Units owned by Player 1 (Red) matching ((Ability being cast) Equal to Blaze )))
    • Actions
      • Set Blazeunit[1] = (Triggering unit)
      • Trigger - Turn on Blaze <gen>
  • Blaze
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Unit - Create 1 Peasant for Player 1 (Red) at ((Position of Blazeunit[1]) offset by -100.00 towards (Facing of Blazeunit[1]) degrees) facing Default building facing degrees
      • Unit Group - Add (Last created unit) to FireUnitGroup
      • Set StopBlaze = (StopBlaze + 1)
  • Blaze Stop
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StopBlaze Equal to 55
        • Then - Actions
          • Trigger - Turn off Blaze <gen>
          • Wait 5.00 seconds
          • Unit Group - Pick every unit in FireUnitGroup and do (Unit - Kill (Picked unit))
          • Set StopBlaze = 0
        • Else - Actions
 
Level 14
Joined
Apr 21, 2007
Messages
1,465
First of all, Blaze Stop is never activated. Secondly why do you need an if/then/else in the Blaze Stop trigger when you only have an If and then? Do you even know what that is for?
Remove the if/then/else, change the variable stopblaze into a Real and set the event so that it is triggered when StopBlaze reaches 55.
 
Level 12
Joined
Apr 27, 2008
Messages
1,228
  • (Triggering unit) Equal to (Random unit from (Units owned by Player 1 (Red) matching ((Ability being cast) Equal to Blaze )))
This is a problem.
Change it all to:
((Ability being cast) Equal to Blaze )
This trigger:
  • Blaze Stop
  • Events
  • Time - Every 0.10 seconds of game time
  • Conditions
  • Actions
  • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
  • If - Conditions
  • StopBlaze Equal to 55
  • Then - Actions
  • Trigger - Turn off Blaze <gen>
  • Wait 5.00 seconds
  • Unit Group - Pick every unit in FireUnitGroup and do (Unit - Kill (Picked unit))
  • Set StopBlaze = 0
  • Else - Actions
Far better would be to:

  • Blaze Stop
  • Events
  • Time - Every 0.10 seconds of game time
  • Conditions
  • StopBlaze Equal to 105
  • Actions
  • Trigger - Turn off Blaze <gen>
  • Unit Group - Pick every unit in FireUnitGroup and do (Unit - Kill (Picked unit))
  • Set StopBlaze = 0
But there is an event for a variable changing, so you'd better use that instead of this.
And this is not MUI or MPI
 
Level 3
Joined
Jun 23, 2008
Messages
22
if i change it to "ability being cast" the spell will only be able to be cast once at a time two people will not be able to cast it at the same time. thats why i arrayed the unit, so i could set it to 12 or more different ones depending on the player casting. plus if i don't have the "wait" the fire will be gone instantly. i want him to stop making fire then wait 5 seconds then destroy it... get it?

btw i do know what if/then/else is for i just copied off of another trigger with a different condition.
 
Level 9
Joined
Feb 19, 2006
Messages
115
  • Cast Blaze
    • Events
      • Unit - A unit Begins casting an ability
    • Conditions
      • ((Ability being cast) Equal to Blaze )
    • Actions
      • Set Blazeunit[1] = (Triggering unit)
      • Trigger - Turn on Blaze <gen>
  • Blaze
    • Events
      • Time - Every 0.10 seconds of game time
    • Conditions
    • Actions
      • Set TempPoint1 = position of (Blazeunit[1])
      • Unit - Create 1 Peasant for Player 1 (Red) at (TempPoint1)
      • Custom Script - call RemoveLocation(udg_TempPoint1)
      • Set StopBlaze = (StopBlaze + 1)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • StopBlaze Equal to 55
        • Then - Actions
          • Trigger - Turn off Blaze <gen>
          • Set StopBlaze = 0
          • Wait 5.00 seconds
        • Else - Actions
To make the "peasant" disappear in 5 seconds, set his HP regeneration rate to -2, and give him 10 HP (set neg numbers by shift-clicking on the field).
This should work now, not sure, since I'm too lazy to test it ^_^.
 
Status
Not open for further replies.
Top