• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • ✅ The POLL for Hive's Texturing Contest #33 is OPEN! Vote for the TOP 3 SKINS! 🔗Click here to cast your vote!

[Trigger] Triggers running completely but not working properly

Status
Not open for further replies.
Level 6
Joined
Jan 8, 2009
Messages
140
These triggers are for 'fishing'. The unit casts the ability, gets paused and a unit is created in the water. A timer (timer[1]) then starts with a random time. when timer1 expires a special effect is created on the unit and a second timer (timer[2]) then starts with 4 seconds. if the unit is selected after timer1 expires but before 2 then an item is created, the unit is removed and the caster is unpaused. if timer 2 expire the same happens but no item is created; the same goes if it is selected before timer1 expires.

the problem is the unit is never removed and the caster is never unpaused however if it is selected at the right time the item spawns.
  • Fish
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Fish
    • Actions
      • Set f_Units[1] = (Triggering unit)
      • Set tmpPoint = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at tmpPoint of type Floatability is off) Equal to False
        • Then - Actions
          • Animation - Play (Triggering unit)'s attack animation
          • Unit - Pause f_Units[1]
          • Unit - Create 1 Bobber for Player 1 (Red) at tmpPoint facing (Random angle) degrees
          • Set f_Units[2] = (Last created unit)
          • Countdown Timer - Start f_Timer[1] as a One-shot timer that will expire in (Random real number between 3.00 and 11.00) seconds
          • Set f_Timer[1] = (Last started timer)
        • Else - Actions
          • Floating Text - Create floating text that reads Incorrect target! above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 10.00%, 10.00%), and 0.00% transparency
          • Set tmpFloat = (Last created floating text)
          • Floating Text - Set the velocity of tmpFloat to 120.00 towards 270.00 degrees
          • Floating Text - Change tmpFloat: Disable permanence
          • Floating Text - Change the lifespan of tmpFloat to 2.00 seconds
          • Floating Text - Change the fading age of tmpFloat to 0.00 seconds
      • Custom script: call RemoveLocation(udg_tmpPoint)
  • Bobber
    • Events
      • Time - f_Timer[1] expires
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Bobber 1
      • Set tmpPoint = (Position of f_Units[2])
      • Set f_Boolean = True
      • Trigger - Turn on Expire <gen>
      • Special Effect - Create a special effect at tmpPoint using Abilities\Spells\Other\CrushingWave\CrushingWaveDamage.mdl
      • Countdown Timer - Start f_Timer[2] as a One-shot timer that will expire in 4.00 seconds
      • Set f_Timer[2] = (Last started timer)
      • Custom script: call RemoveLocation(udg_tmpPoint)
      • Game - Display to (All players) the text: Bobber 2
  • Expire
    • Events
      • Time - f_Timer[2] expires
    • Conditions
    • Actions
      • Game - Display to (All players) the text: Expire 1
      • Unit - Remove f_Units[2] from the game
      • Unit - Unpause f_Units[1]
      • Set f_Boolean = False
      • Trigger - Turn off (This trigger)
      • Game - Display to (All players) the text: Expire 2
  • Catch
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Triggering unit) Equal to f_Units[2]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • f_Boolean Equal to True
        • Then - Actions
          • Game - Display to (All players) the text: Catch1
          • Unit - Remove f_Units[2] from the game
          • Set tmpPoint = (Position of f_Units[1])
          • Item - Create Tome of Experience at tmpPoint
          • Unit - Unpause f_Units[1]
          • Set f_Boolean = False
          • Trigger - Turn off Expire <gen>
          • Custom script: call RemoveLocation(udg_tmpPoint)
          • Game - Display to (All players) the text: Catch2
        • Else - Actions
          • Unit - Remove f_Units[2] from the game
          • Unit - Unpause f_Units[1]
          • Trigger - Turn off Expire <gen>
 
Level 6
Joined
Jan 8, 2009
Messages
140
The timer[2] is not created most likely. Set the initial size of the array to 2.

no change unfortunately, I also tried making two separate timer variables to no avail.

aside from it not working, does it look like it should work to you? nothing sticks out as problematic?
 
Level 6
Joined
Jan 8, 2009
Messages
140
There seems to be an issue with the pause/unpause action. removing the timers and pauses made it work. i then added in a pause/unpause action and it's stuck being paused.

  • Fish Point
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Fish
    • Actions
      • Set f_Units[1] = (Triggering unit)
      • Set tmpPoint = (Target point of ability being cast)
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Terrain pathing at tmpPoint of type Floatability is off) Equal to False
        • Then - Actions
          • Unit - Pause f_Units[1]
          • Unit - Create 1 Bobber for Player 1 (Red) at tmpPoint facing (Random angle) degrees
          • Set f_Units[2] = (Last created unit)
          • Set f_Boolean = True
        • Else - Actions
          • Floating Text - Create floating text that reads Incorrect target! above (Triggering unit) with Z offset 0.00, using font size 10.00, color (100.00%, 10.00%, 10.00%), and 0.00% transparency
          • Set tmpFloat = (Last created floating text)
          • Floating Text - Set the velocity of tmpFloat to 120.00 towards 270.00 degrees
          • Floating Text - Change tmpFloat: Disable permanence
          • Floating Text - Change the lifespan of tmpFloat to 2.00 seconds
          • Floating Text - Change the fading age of tmpFloat to 0.00 seconds
      • Custom script: call RemoveLocation(udg_tmpPoint)
  • Catch
    • Events
      • Player - Player 1 (Red) Selects a unit
    • Conditions
      • (Triggering unit) Equal to f_Units[2]
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • f_Boolean Equal to True
        • Then - Actions
          • Unit - Unpause f_Units[1]
          • Unit - Remove f_Units[2] from the game
          • Selection - Clear selection for Player 1 (Red)
          • Selection - Select f_Units[1] for Player 1 (Red)
          • Set tmpPoint = (Position of f_Units[1])
          • Set tmpReal = (((Real(f_FishCount)) / (Real(MaxSkill))) x ((Real(SkillLevels[11])) + (Real(SkillBonus[11]))))
          • Set centre = (Integer(tmpReal))
          • Game - Display to (All players) the text: (String(centre))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • centre Equal to 0
            • Then - Actions
              • Set centre = 1
            • Else - Actions
          • Custom script: set udg_result = GetNormalRandomInt(1, udg_f_FishCount, udg_centre, 5)
          • Game - Display to (All players) the text: ((String(centre)) + (: + (String(result))))
          • Item - Create f_Fish[result] at tmpPoint
          • Set SkillLevels[11] = (SkillLevels[11] + 1)
          • Set tmpPoint = (Position of f_Units[1])
          • Floating Text - Create floating text that reads (Fishing: + (String(SkillLevels[11]))) at tmpPoint with Z offset 0.00, using font size 10.00, color (10.00%, 10.00%, 100.00%), and 0.00% transparency
          • Set tmpFloat = (Last created floating text)
          • Floating Text - Set the velocity of tmpFloat to 120.00 towards 270.00 degrees
          • Floating Text - Change tmpFloat: Disable permanence
          • Floating Text - Change the lifespan of tmpFloat to 3.00 seconds
          • Floating Text - Change the fading age of tmpFloat to 0.00 seconds
          • Floating Text - Create floating text that reads (Name of (Last created item)) at (tmpPoint offset by (-200.00, 0.00)) with Z offset 0.00, using font size 10.00, color (10.00%, 100.00%, 10.00%), and 0.00% transparency
          • Set tmpFloat = (Last created floating text)
          • Floating Text - Set the velocity of tmpFloat to 120.00 towards 270.00 degrees
          • Floating Text - Change tmpFloat: Disable permanence
          • Floating Text - Change the lifespan of tmpFloat to 3.00 seconds
          • Floating Text - Change the fading age of tmpFloat to 0.00 seconds
          • Set f_Boolean = False
          • Custom script: call RemoveLocation(udg_tmpPoint)
        • Else - Actions
          • Unit - Remove f_Units[2] from the game
 
Status
Not open for further replies.
Top