• 🏆 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] Help with my spell :)

Status
Not open for further replies.
Level 4
Joined
Sep 23, 2010
Messages
49
Guys can you help me?

first this is my triggers

[trigger=Cluster Rockets Cast]
Cluster Rockets Cast
Events
Unit - A unit Starts the effect of an ability
Conditions
(Ability being cast) Equal to Cluster Rockets
Actions
Set cr_point = (Position of (Triggering unit))
For each (Integer A) from 1 to cr_num[(Level of (Ability being cast) for (Triggering unit))], do (Actions)
Loop - Actions
Unit - Create 1 dummy-clusterrockets for (Owner of (Triggering unit)) at cr_point facing Default building facing degrees
Unit - Set level of Attack-clusterrockets for (Last created unit) to (Level of (Ability being cast) for (Triggering unit))
Unit Group - Add (Last created unit) to cr_rockets
Set cr_targets = (Units within 1000.00 of cr_point matching (((((Matching unit) is A structure) Not equal to True) and (((Matching unit) is alive) Equal to True)) and (((Matching unit) belongs to an enemy of (Owner of (Triggering unit))) Equal to True)))
Unit Group - Pick every unit in cr_rockets and do (Actions)
Loop - Actions
If (All Conditions are True) then do (Then Actions) else do (Else Actions)
If - Conditions
(cr_targets is empty) Equal to True
Then - Actions
Unit - Kill (Picked unit)
Else - Actions
Set cr_target = (Random unit from cr_targets)
Set cr_rocket = (Picked unit)
Unit Group - Remove cr_target from cr_targets
Unit Group - Remove cr_rocket from cr_rockets
Custom script: call IssueTargetOrderById(udg_cr_rocket,852095,udg_cr_target)
Custom script: call RemoveLocation(udg_cr_point)
Custom script: call DestroyGroup(udg_cr_targets)
Custom script: call DestroyGroup(udg_cr_rockets)
[/trigger]

[trigger=Cluster Rockets Kill]
Cluster Rockets Kill
Events
Unit - A unit Finishes casting an ability
Conditions
(Ability being cast) Equal to Attack-clusterrockets
Actions
Unit - Remove (Triggering unit) from the game
[/trigger]

so my problem is whenever I use call DestroyGroup with the first trigger it won't work anymore

Thank you so much :)
 
Level 4
Joined
Sep 23, 2010
Messages
49
Sorry I made a mistake.
It is CreateGroup() instead of CreateUnitGroup().
I forgot that a unit group is a group in jass.

Anyway I dont really understand what your new error is.

it now works thanks :)

No in GUI you do not need to call CreateGroup().

maybe because you did not defined cr_rockets in the variable editor.
I did not see you using it.

i used it on
  • Unit Group - Add (Last created unit) to cr_rockets
and

  • Unit Group - Pick every unit in cr_rockets and do (Actions)
    • Loop - Actions
      • If (All Conditions are True) then do (Then Actions) else do (Else Actions)
        • If - Conditions
          • (cr_targets is empty) Equal to True
        • Then - Actions
          • Unit - Kill (Picked unit)
        • Else - Actions
          • Set cr_target = (Random unit from cr_targets)
          • Set cr_rocket = (Picked unit)
          • Unit Group - Remove cr_target from cr_targets
          • Unit Group - Remove cr_rocket from cr_rockets
          • Custom script: call IssueTargetOrderById(udg_cr_rocket,852095,udg_cr_target)
I also clearly declared it cuz i was able to use it on some of my triggers :)
 
Last edited:
Status
Not open for further replies.
Top