Destroying a unit group

Saiza

New Member
Reaction score
10
yo.

I got a problem, when I pee it realy hurts and I get dizzy

lol :)

nah, this is the problem; I got this action
Set GroupvarUnits = (Units within 400.00 of (Position of (Dying unit)))
And then some long unit group action, but then when I want to remove it by a custom script I do ''Custom script: call DestroyGroup(udg_GroupvarUnits)
'' but I get error *ARGH* :) how do I remove a unit group variable? >=o
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
What error did you get?

You custom script seems to be correct though..
 

Saiza

New Member
Reaction score
10
It says that something is wrong with my custom script blabla Helping me will be rewarded with REP =D

Bjerrum, dont wory... at the moment I feel a little anger aginst you but with time it will hopefully fade away :)

ehhh now it says that my playergroup is fucked up to :eek: Custom script: call DestroyGroup(udg_Groupvar)
(A playergroup variable it is)
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
Let me guess, you inserted "Custom script:" to the function call, too?

So, it looks like "Custom script: Custom script: call DestroyGroup(GroupvarUnits)" when directly copy&pasted from the editor?


You know, that's bad...
 

Sooda

Diversity enchants
Reaction score
318
> something is wrong with my custom script blabla

We could solve your problem if you would type out error message. Wild guess, you don' t have variable named "udg_GroupvarUnits" ?
 

Arkan

Nobody rides for free
Reaction score
92
make 2 variables:
Unit-Group variable called TempG
Point variable called TempP

then

Code:
set TempP = Position of Triggering Unit
set TempG = Units within 400.00 of TempP
loop
....
endloop
custom script: call RemoveLocation(udg_TempP)
custom script: call DestroyGroup(udg_TempG)
 

~GaLs~

† Ғσſ ŧħə ѕαĸε Φƒ ~Ğ䣚~ †
Reaction score
180
So i asked, what error did the WorldEditor gave you?
 

Leazy

You can change this now in User CP.
Reaction score
50
The wild guess is correct. :>

My variable name is GroupvarUnits, but I heard that you should have _udg before : o

Aight, this is what the error says;
Line 90: Invalid argument type (force)
Line 93: Expected a code statement (force)

call DestroyGroup(udg_Groupvar) is marked
 

Andrewgosu

The Silent Pandaren Helper
Reaction score
716
"DestroyForce" is for destroying forces aka player groups, "DestroyGroup" is for destroying groups aka unit groups!
 

Sooda

Diversity enchants
Reaction score
318
> My variable name is GroupvarUnits

> call DestroyGroup(udg_Groupvar) is marked

Well conclusion:
Code:
custom script: call DestroyGroup(udg_Groupvar[b]Units[/B])
If you are using default Blizzard World Editor then errors showed could be one or some lines before/ after actual line displayed with presumable error.
Are you just trying to add custom script to your GUI trigger or are you working with JASS trigger ? So far messages show that it wants variable what is meant for player group. Somewhere you want to destroy player group with unit group destroying function or unit group with player group destroying function.
 

Leazy

You can change this now in User CP.
Reaction score
50
Thanks!

Thanks, Andrew. That cleared up my Playergroup problem, but the unitgroup problem remains. Here is my trigger:

Code:
Execute
    Events
        Unit - A unit Is attacked
    Conditions
        (Unit-type of (Attacking unit)) Equal to Assasin
        ((Attacking unit) has buff Execute) Equal to True
        (Integer((Percentage life of (Attacked unit)))) Less than or equal to 15
    Actions
        Set INTEGER = (Random integer number between 1 and 5)        If (All Conditions are True) then do (Then Actions) else do (Else Actions)
            If - Conditions
                (Random integer number between 1 and 5) Equal to 3
            Then - Actions
                Unit - Pause (Attacked unit)
                Unit - Pause (Attacking unit)
                Set Groupvar = (Player group((Owner of (Attacking unit))))
                Cinematic - Disable user control for Groupvar
                Animation - Play (Attacking unit)'s slam animation
                Unit - Cause (Attacking unit) to damage (Attacked unit), dealing (Life of (Attacked unit)) damage of attack type Chaos and damage type Force
                Wait 0.40 seconds
                Unit - Unpause (Attacking unit)
                Set Groupvar = (Player group((Owner of (Attacking unit))))
                Cinematic - Enable user control for Groupvar
                Custom script:   call DestroyGroup(udg_Groupvar)
            Else - Actions
                Do nothing

Is it maybe so that when I use
Code:
Set Groupvar = (Player group((Owner of (Attacking unit))))
the second time it messes up evverything? Well, I need some kind of solution like that, becouse there is more triggers that uses that variable and with the wait of 0.40 seconds maybe another of those triggers occurs wich would fuck up the whole thing, becouse it could be removed before it should since it's removed after 0.40 seconds in this trigger :eek: If this is the thing that fucks up, could anyone help me with another solution, like a if/then/else variable that checks if that variable is being used in another trigger or something?

Edit

> Andrewgosu, +rep is added

> Well, when I already started a tread I could aswell just ask another question to eas my mind, I got a spell where if a unit with that spell is in 400 range of the dying unit he'll get the Fan of Knives ability and he uses it, but then, if he have a spellbook open, would it cancel the spellbook? If so, is there a way to cast spellbook with GUI or Jass, either way that works would be great :D A custom lines that orders casting unit to cast spellbook, + rep if you know how to =D
 

Leazy

You can change this now in User CP.
Reaction score
50
Aha! Sweet, Aceheart you always got the answear :>

So, would my trigger be leak free now?

Edit: Rep added, Ace :D
 

AceHart

Your Friendly Neighborhood Admin
Reaction score
1,495
You set Groupvar twice, but remove it only once.
I'm not sure "Attacking unit" makes it past a wait.
This trigger can not run more than once.

"Do nothing" isn't needed, it isn't doing anything anyway.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top