• 🏆 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!

[JASS] GroupPointOrder

Status
Not open for further replies.
Level 4
Joined
Jan 7, 2014
Messages
69
hi everyone!
mb this question already has here, but i didnt found. so question is:
should i destroygroup after using
Code:
call GroupPointOrder(....)
?
i dont want to create local group everytime for this, this is weird. but i dont know, should i destroy group after this like after ForGroup(...)? if not, then i can use one global group for that.
i need really answer from ppl who know this.
Ty.:vw_wtf::vw_wtf:
 
Level 4
Joined
Jan 7, 2014
Messages
69
GroupPointOrder() does take a group as argument, but does not create a new object. So nothing there can leak with it.
ty for answer.
so i can just create one global group and after use GroupPointOrder just clear the group without destroy? thats right? and another little question:
for mobs move system whats will faster? use event unit in range with marker units or use grouppointorder for units in rect to attack x.y every 2 seconfd for example? or it doesnt matter?
 
Level 4
Joined
Jan 7, 2014
Messages
69
Why you would clean it? If you will reset your global group, then you also need to destroy the group before.

Event "unit in range" also checks periodicly if units are in range.
If you have your own periodic event you have more control about it.

i mean example. in periodic event:
call Groupenumunitsinrect(thisgroup,rect....)
call grouppointorder(thisgroup,"attack",x,y)
call GroupClear(thisgroup)
i use clear group qoz sometimes group not crear in groupenum...should, but some kind of bug with it. like timers should be paused before destroy.
i maded one global group for mobs in game start, and used this all game without destroy. thats why i asking about this:)
 
Of course it does not clear the group. You never did anything with the content of the group after all.
Groups only "clear" automaticly after use if you use a FirstOfGroup (FoG) loop, as this is an (often unwanted) byproduct of this approach.

"GroupClear" will not destroy a group. "DestroyGroup" does.
So keep that in mind if you create new groups on the same variable.

Timers don't have to be paused before destroying them, unless you try to destroy them before they expire.
 
Level 4
Joined
Jan 7, 2014
Messages
69
Of course it does not clear the group. You never did anything with the content of the group after all.
Groups only "clear" automaticly after use if you use a FirstOfGroup (FoG) loop, as this is an (often unwanted) byproduct of this approach.

"GroupClear" will not destroy a group. "DestroyGroup" does.
So keep that in mind if you create new groups on the same variable.

Timers don't have to be paused before destroying them, unless you try to destroy them before they expire.

i didnt tell that cleargroup destroy the group...about timers, well, i stll think that best way its pause timer first before destroy him and nvm expired or not. ive got an expirience with wc3 modding and bugs by blizzards wich they still didnt fixed :).
GroupEnum... always clears the group beforehand. Would be great if it didn't and left that up to the user, but it's not. You may have noticed some unexpected behavior, but I would need to see some clean-environment tests before we make an announcement of a new bug.
well, sometimes its happens, i noticed this year or mb more ago, when i checked all my scripts with debug messages and i was wonder when this happened. so at that moment i always avoid this just with + one more function call "cleargroup".
 
Status
Not open for further replies.
Top