• 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.

Arrow Type spell... Hard T.T

Status
Not open for further replies.
Level 6
Joined
Oct 4, 2011
Messages
226
I tried for hours and idk how to do it. I cant fix my bug and i know my triggs are sketchy as is.. I want to make a Windrunner: powershot type ability idc about many details except i got the trigger at 1000 distance 155 aoe. a basic 50 damage but after the first time i cast the spell it does outrageuos damage. the first time it does a perfect 50 though.. weird.

  • Bow
    • Events
      • Unit - A unit Begins channeling an ability
    • Conditions
      • (Ability being cast) Equal to Bow
    • Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (Level of Bow for (Triggering unit)) Equal to 1
        • Then - Actions
          • Wait 0.40 game-time seconds
          • Set BowTicker_Integer = 0
          • Set BowCasting_Unit = (Triggering unit)
          • Set BowCast_Point = (Position of BowCasting_Unit)
          • Set BowCastingunitFacing_Real = (Facing of BowCasting_Unit)
          • Unit - Create 1 Peon for (Owner of BowCasting_Unit) at BowCast_Point facing BowCastingunitFacing_Real degrees
          • Set BowArrow_Unit = (Last created unit)
          • Unit Group - Pick every unit in BowTargetDamaged_UnitG and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Unit Group - Pick every unit in BowTarget_UnitG and do (Actions)
            • Loop - Actions
              • Unit - Remove (Picked unit) from the game
          • Trigger - Turn on Bow Damager <gen>
          • Trigger - Turn on Bow mover <gen>
          • Wait 3.00 game-time seconds
          • Unit - Cause BowCasting_Unit to damage BowCasting_Unit, dealing 50.00 damage of attack type Spells and damage type Normal
        • Else - Actions
  • Bow mover
    • 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
          • BowTicker_Integer Less than 10
        • Then - Actions
          • Unit - Move BowArrow_Unit instantly to ((Position of BowArrow_Unit) offset by 100.00 towards BowCastingunitFacing_Real degrees)
          • Set BowTicker_Integer = (BowTicker_Integer + 1)
        • Else - Actions
          • Unit - Remove BowArrow_Unit from the game
          • Custom script: call RemoveLocation(udg_BowCast_Point)
          • Custom script: call DestroyGroup(udg_BowTargetDamaged_UnitG)
          • Custom script: call DestroyGroup(udg_BowTarget_UnitG)
          • Trigger - Turn off (This trigger)
          • Trigger - Turn off Bow Damager <gen>
  • Bow Damager
    • Events
      • Time - Every 0.03 seconds of game time
    • Conditions
    • Actions
      • Unit Group - Pick every unit in (Units within 155.00 of (Position of BowArrow_Unit) matching ((((Matching unit) belongs to an enemy of (Owner of BowArrow_Unit)) Equal to True) and ((((Matching unit) is A structure) Equal to False) and ((((Matching unit) is Magic Immune) Equal to False) and and do (Actions)
        • Loop - Actions
          • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            • If - Conditions
              • ((Matching unit) is in BowTargetDamaged_UnitG) Equal to False
            • Then - Actions
              • Unit Group - Add (Picked unit) to BowTargetDamaged_UnitG
              • Unit - Cause BowArrow_Unit to damage (Picked unit), dealing 50.00 damage of attack type Spells and damage type Normal
              • Unit Group - Remove (Picked unit) from BowTarget_UnitG
            • Else - Actions
              • Unit Group - Remove (Picked unit) from BowTarget_UnitG
The wait i added in the start is because it has a .4 second channel time
 
Level 7
Joined
Apr 1, 2010
Messages
289
well, you need to clear the damaged group not destroy it as destroying it completely gets rid of the unit group making so that you can't add units too.
by the way you are leaking a unit group in the bow damager trigger, put this
  • Custom Script: set bj_wantDestroyGroup = true
in front of the pick every unit in
 
Level 6
Joined
Oct 4, 2011
Messages
226
well, you need to clear the damaged group not destroy it as destroying it completely gets rid of the unit group making so that you can't add units too.
by the way you are leaking a unit group in the bow damager trigger, put this
  • Custom Script: set bj_wantDestroyGroup = true
in front of the pick every unit in

Okay so do you know whats wrong with it then?? What you said doesnt compute to much for me.. First... I know nothing about custom script. so the set (bj_wantDestroyGroup = true) i just put into the custom script instead of destroying the damged group.. But still its bugged IDK what this even does!! You guys are just on some kinda super level ill never be at.. can't understand that i really suck and i need explanationl.
 
Level 6
Joined
Oct 4, 2011
Messages
226
Now the second time i cast it. it removes units from the game it looks like.. Wait. sometimes it does only 50 damage sometimes it removes units. maybe that will help find the root of the problem
 
Level 6
Joined
Oct 4, 2011
Messages
226
Fixed not fully sure what happened. i think adding in clear unit groups once the integer reached (x) to remove the Arrow dummy unit i cleared the groups.
 
Status
Not open for further replies.
Top