• 🏆 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] Sunbeam

Status
Not open for further replies.
Level 2
Joined
May 31, 2008
Messages
8
Wanted to create an ability ability that works basically like shockwave, only it uses a unit with a -90 pitch angle for the animation. It works the first time, and then never works again. I was wondering if anyone knew why it stops working after running once.

  • Sun Beam
    • Events
      • Unit - A unit Starts the effect of an ability
    • Conditions
      • (Ability being cast) Equal to Sun Beam
    • Actions
      • Set Temp_Player = (Owner of (Casting unit))
      • Set Temp_Point = (Position of (Casting unit))
      • Set Temp_Unit2 = (Casting unit)
      • Set Temp_Real = (Facing of Temp_Unit2)
      • For each (Integer A) from 1 to 4, do (Actions)
        • Loop - Actions
          • Unit - Create 1 Sun Beam for Temp_Player at (Temp_Point offset by 50.00 towards Temp_Real degrees) facing Temp_Real degrees
          • Set Temp_Unit = (Last created unit)
          • Unit - Add a 3.00 second Generic expiration timer to Temp_Unit
          • Custom script: set udg_Temp_Unit = null
      • For each (Integer A) from 1 to 6, do (Actions)
        • Loop - Actions
          • Set Temp_Point = (Temp_Point offset by 150.00 towards Temp_Real degrees)
          • Custom script: set bj_wantDestroyGroup = true
          • Unit Group - Pick every unit in (Units within 150.00 of Temp_Point matching (((Owner of (Matching unit)) is an enemy of Temp_Player) Equal to True)) and do (Actions)
            • Loop - Actions
              • Set Temp_Unit = (Picked unit)
              • Unit Group - Add Temp_Unit to Temp_Group
              • Custom script: set udg_Temp_Unit = null
      • Custom script: set bj_wantDestroyGroup = true
      • Unit Group - Pick every unit in Temp_Group and do (Actions)
        • Loop - Actions
          • Set Temp_Unit = (Picked unit)
          • Unit - Cause Temp_Unit2 to damage Temp_Unit, dealing 700.00 damage of attack type Spells and damage type Magic
          • Unit Group - Remove Temp_Unit from Temp_Group
          • Custom script: set udg_Temp_Unit = null
      • Custom script: call RemoveLocation (udg_Temp_Point)
      • Custom script: set udg_Temp_Real = 0.00
      • Custom script: set udg_Temp_Unit2 = null
      • Custom script: set udg_Temp_Player = null
 
Level 22
Joined
Feb 26, 2008
Messages
891
When you destroy a Unit Group variable (Temp_Group), you cannot add units to it unless you create a new group to put in that variable. Try adding this as the last action in your trigger:

  • Custom script: set udg_Temp_Group = CreateGroup()
 
Level 2
Joined
May 31, 2008
Messages
8
Thank you very much, it works perfectly now.
 

Attachments

  • preview.gif
    preview.gif
    117.7 KB · Views: 166
Status
Not open for further replies.
Top