• Listen to a special audio message from Bill Roper to the Hive Workshop community (Bill is a former Vice President of Blizzard Entertainment, Producer, Designer, Musician, Voice Actor) 🔗Click here to hear his message!
  • Read Evilhog's interview with Gregory Alper, the original composer of the music for WarCraft: Orcs & Humans 🔗Click here to read the full interview.

"BJ_wantdestroygroup = true" questions

Status
Not open for further replies.
Level 4
Joined
Aug 12, 2004
Messages
76
If I use

JASS:
bj_wantdestroygroup = true
call CreateNUnitsAtLoc( 10, 'efon', Player(8), point, bj_UNIT_FACING )
set group2 = GetLastCreatedUnitGroup()

will that destroy only the first group or will it also destroy group2 as well?
 
Level 4
Joined
Aug 12, 2004
Messages
76
Hmm does that mean that I need to put that in front of every creation right? And I won't have to worry about others below it getting destroyed?
 
Level 4
Joined
Aug 12, 2004
Messages
76
It's set to false every time it's used.

Also, you should have it as set bj_wantDestroyGroup = true.

Just getting one final yes, so as not to screw up anything.

So I would put this in front of every creation triggers to avoid leaks right?
Like

JASS:
set bj_wantDestroyGroup = true
call CreateNUnitsAtLoc( 1, 'efon', Player(8), point2, bj_UNIT_FACING )
set group1=GetLastCreatedUnitGroup()
set bj_wantDestroyGroup = true
call CreateNUnitsAtLoc( 3, 'efon', Player(8), point2, bj_UNIT_FACING )
set group2=GetLastCreatedUnitGroup()
set bj_wantDestroyGroup = true
call CreateNUnitsAtLoc( 5= 'efon', Player(8), point2, bj_UNIT_FACING )
set group3=GetLastCreatedUnitGroup()
The initial groups will be destroyed but group1,2,3 will be still there though right?

Lol... I am just worried that I might make this horribly wrong.
 
Level 4
Joined
Aug 12, 2004
Messages
76
While I am on this subject, can I ask one more thing?

JASS:
call creatunits(1, unit, somewhere)
set point1 = Location of last created unit
call removelocation(point1)
set point1 = null

Well this isn't really a correct code but will this remove the leak or do I have to set t he point first and create the unit on the point. I am asking because I have this old map in which I created these units at random points and I was wondering if I can short cut, get their position and remove their location.
 
Status
Not open for further replies.
Top