Removing Array Unit Groups

avalya

New Member
Reaction score
37
Okey, facing another problem here; how do I remove Unit Group Arrays? I noticed I can't specify Integer A, or a variable such as PlayerNumber, what do I do to destroy the correct unit group?
 

werasd

New Member
Reaction score
14
call DestroyGroup(udg_variable[array])

i think that's not what you're looking for... so if it's not please explain better. There can be much possibilities to guess. Maybe post the trigger?
 

avalya

New Member
Reaction score
37
I've tried this;

Trigger:
  • call DestroyGroup (udg_IceLance_Group[PlayerNumber])

and

Trigger:
  • call DestroyGroup (udg_IceLance_Group[Integer A])

and

Trigger:
  • call DestroyGroup (udg_IceLance_Group[Integer_A])

I can't use numbers such as 1, 2 or 3, because I need to make sure the correct group is removed.
 

Laiev

Hey Listen!!
Reaction score
188
try this:
player number of owner of triggering unit
Trigger:
  • custom script: call DestroyGroup( udg_group[GetConvertedPlayerId(GetTriggerPlayer())] )


integer A
Trigger:
  • custom script: call DestroyGroup( udg_group[GetForLoopIndexA()] )
 

avalya

New Member
Reaction score
37
I'll try that Laiev, I however got a variable already named PlayerNumber that assigns the player number in the start of the trigger. Would it look the same?
 

avalya

New Member
Reaction score
37
Hmm, yeah but would I be able to use a variable in the array?
Trigger:
  • call DestroyGroup (udg_IceLance_Group[PlayerNumber])
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
Hmm, yeah but would I be able to use a variable in the array?

This:

Trigger:
  • custom script: call DestroyGroup( udg_group[GetConvertedPlayerId(GetTriggerPlayer())] )

or this: [ljass]call DestroyGroup(udg_group[GetPlayerId(GetTriggerPlayer()) + 1])[/ljass]
 

avalya

New Member
Reaction score
37
Oh, I see, would your solution also work, Sickle? Gotta try it out whenever I have an available WE nearby.
 

Komaqtion

You can change this now in User CP.
Reaction score
469
Well, is PlayerNumber also an array ?
If so, and they have the array of their player (E.g array [1] is for Player 1 (Red)) then you'd still have to do this:
JASS:
call DestroyGroup ( udg_IceLance_Group[ udg_PlayerNumber[ GetConvertedPlayerId( GetTriggerPlayer() ) ] ] )


Or if you use it in a loop:
JASS:
call DestroyGroup ( udg_IceLance_Group[ udg_PlayerNumber[ bj_forLoopAIndex ] ] )


Otherwise his should work (Though I doubt it as an array is needed for different values for ach player...)
 

avalya

New Member
Reaction score
37
Nope, it's not an array and it's working fine with the previously mentioned solutions.
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Staff online

      • Ghan
        Administrator - Servers are fun

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top