• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

[Trigger] Trigger problem...

Status
Not open for further replies.
Level 10
Joined
Aug 15, 2008
Messages
720
So I just wanted to make a simple triggered moving firebolt to it's target through hashtables. The thing is, that my supposed projectile unit isn't even getting till 0.03 sec loop (Basically it doesn't want to be added in loop group). I can't really find the problem in firebolt launch trigger... I am bit confused, so little help would be appreciated ^^

Oh, tell me if there are some leaks.

As Projectile I am using Dragonhawk Rider unit, with firebolt model. Abilities: Invulnerable, Locust. Other: No shadow image, no mini-map support and etc.

Loop Trigger
  • Projectile movement
    • Events
      • Time - Elapsed game time is 0.03 seconds
    • Conditions
    • Actions
      • Unit Group - Pick every unit in UGroup_Projectiles and do (Actions)
        • Loop - Actions
          • Set Real_ProjectileDistance = (Load (Key proj_dist) of (Key (Picked unit)) from ProjectileSystem)
          • Set Real_ProjectileSpeed = (Load (Key proj_speed) of (Key (Picked unit)) from ProjectileSystem)
          • Set Unit_ProjectileTarget = (Load (Key proj_target) of (Key (Picked unit)) in ProjectileSystem)
          • -------- - --------
          • Set temploc[0] = (Position of (Picked unit))
          • Set temploc[2] = (Position of Unit_ProjectileTarget)
          • -------- - --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Unit_ProjectileTarget Not equal to No unit
            • Then - Actions
              • Unit - Make (Picked unit) face Unit_ProjectileTarget over 0.00 seconds
            • Else - Actions
          • Set temploc[3] = (temploc[0] offset by Real_ProjectileSpeed towards (Facing of (Picked unit)) degrees)
          • Unit - Move (Picked unit) instantly to temploc[3]
          • Set temprect[0] = (Region centered at temploc[0] with size (50.00, 50.00))
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • Real_ProjectileDistance Greater than 0.00
            • Then - Actions
              • Set Tempgroup = (Units in temprect[0] matching ((((Matching unit) is dead) Not equal to True) and ((((Matching unit) is Magic Immune) Not equal to True) and (((Matching unit) belongs to an enemy of (Owner of HERO_Wizard)) Equal to True))))
              • Unit Group - Pick every unit in Tempgroup and do (Actions)
                • Loop - Actions
                  • Set tempboolean[0] = True
            • Else - Actions
              • Set tempboolean[0] = True
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • tempboolean[0] Equal to True
            • Then - Actions
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in (Last created hashtable)
              • Unit - Kill (Picked unit)
              • Hashtable - Clear all child hashtables of child (Key (Picked unit)) in ProjectileSystem
              • Unit Group - Remove (Picked unit) from UGroup_Projectiles
              • Set tempboolean[0] = False
              • Set tempboolean[1] = True
            • Else - Actions
          • -------- - --------
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • tempboolean[1] Equal to False
            • Then - Actions
              • Hashtable - Save (Real_ProjectileDistance - Real_ProjectileSpeed) as (Key proj_dist) of (Key (Picked unit)) in ProjectileSystem
              • Hashtable - Save Real_ProjectileSpeed as (Key proj_speed) of (Key (Picked unit)) in ProjectileSystem
              • Hashtable - Save Handle OfUnit_ProjectileTarget as (Key proj_target) of (Key (Picked unit)) in ProjectileSystem
            • Else - Actions
              • Set tempboolean[1] = False
          • Custom script: call RemoveLocation(udg_temploc[0])
          • Custom script: call RemoveLocation(udg_temploc[2])
          • Custom script: call RemoveLocation(udg_temploc[3])
          • Custom script: call RemoveRect(udg_temprect[0])
          • Custom script: call DestroyGroup(udg_Tempgroup)
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • (UGroup_Projectiles is empty) Equal to True
            • Then - Actions
              • Trigger - Turn off (This trigger)
            • Else - Actions

Firebolt launch trigger
  • Firebolt start
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Firebolt (Starman)
    • Actions
      • Set temploc[0] = (Position of (Triggering unit))
      • Set temploc[1] = (Position of (Target unit of ability being cast))
      • -------- - --------
      • Unit - Create 1 Projectile - Firebolt (Starman) for (Owner of HERO_Wizard) at temploc[0] facing (Angle from temploc[0] to temploc[1]) degrees
      • Set tempunit[0] = (Last created unit)
      • Set Unit_ProjectileTarget = (Target unit of ability being cast)
      • Set Real_ProjectileDistance = 1200.00
      • Set Real_ProjectileSpeed = 15.00
      • Hashtable - Save Real_ProjectileDistance as (Key proj_dist) of (Key (Last created unit)) in ProjectileSystem
      • Hashtable - Save Real_ProjectileSpeed as (Key proj_speed) of (Key (Last created unit)) in ProjectileSystem
      • Hashtable - Save Handle OfUnit_ProjectileTarget as (Key proj_target) of (Key (Last created unit)) in ProjectileSystem
      • Unit Group - Add tempunit[0] to UGroup_Projectiles
      • -------- - --------
      • Trigger - Turn on Projectile movement <gen>
 
Status
Not open for further replies.
Top