• 🏆 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!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!

"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