• 🏆 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!

[Solved] Spell Problems :S

Status
Not open for further replies.
Level 8
Joined
Mar 3, 2009
Messages
327
Im trying to trigger a breath of fire. I havn't added the SFX yet. Heres the trigger:

  • Breath of Fire
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • Or - Any (Conditions) are true
        • Conditions
          • (Ability being cast) Equal to Breath of Fire Q
          • (Ability being cast) Equal to Breath of Fire W
          • (Ability being cast) Equal to Breath of Fire E
          • (Ability being cast) Equal to Breath of Fire R
    • Actions
      • -------- Base damage --------
      • Set Tempreal2 = 0.00
      • -------- Int multiplier --------
      • Set Tempreal = 2.00
      • -------- ---------------- --------
      • Set Temppoint[0] = (Position of (Triggering unit))
      • Set Temppoint[1] = (Temppoint[0] offset by 200.00 towards (Facing of (Triggering unit)) degrees)
      • Set Temppoint[2] = (Temppoint[0] offset by 400.00 towards (Facing of (Triggering unit)) degrees)
      • Unit Group - Add all units of (Units within 150.00 of Temppoint[1] matching (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False)) to tempgroup
      • Unit Group - Add all units of (Units within 250.00 of Temppoint[2] matching (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False)) to tempgroup
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in tempgroup and do (Actions)
        • Loop - Actions
          • Unit - Cause (Triggering unit) to damage (Picked unit), dealing (((Real((Intelligence of (Triggering unit) (Include bonuses)))) x Tempreal) + Tempreal2) damage of attack type Spells and damage type Normal
      • Custom script: call RemoveLocation(udg_Temppoint[0])
      • Custom script: call RemoveLocation(udg_Temppoint[1])
      • Custom script: call RemoveLocation(udg_Temppoint[2])
Now, the problem is, nothing in tempgroup gets picked (I found that out with debug messages). So any help is greatly appreciated. Also, i dont use unit groups that often so please tell me if the other ones leak.

PS. Disabling the bj_wantdestroygroup thing does nothing
 
It "should" work, at least once. My best guess is that tempgroup is initially null so you are adding groups to a null group.

This should be how your groups look like, untested though:
  • Actions
    • Set tempgroup1 = Units within 150.00 of Temppoint[1] matching (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False)
    • Set tempgroup2 = Units within 250.00 of Temppoint[2] matching (((Matching unit) belongs to an ally of (Owner of (Triggering unit))) Equal to False)
    • Unit Group - Add all units of tempgroup1 to tempgroup2
    • Custom script: call DestroyGroup(udg_tempgroup1)
    • Custom script: set bj_wantDestroyGroup = true
    • Unit Group - Pick every unit in tempgroup2 and do (Actions)
      • Loop - Actions
Then just add whatever actions you need. Hopefully that should work. :ogre_haosis:

I could be wrong, but I don't think you can use 0 as the index of an array

0 is usable for arrays. ;D But for structs, 0 refers to a null instance.
 
Status
Not open for further replies.
Top