• 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.

How do I destroy units that where previously locally moved for each player?

Status
Not open for further replies.
Level 14
Joined
Apr 20, 2009
Messages
1,543
What the titel says:

I created a bunch of units and moved them locally for each player.
Now when I try to pick all the units within a region (both the regions they where created in and the region they where moved to locally for each player) I am unabled to remove them.

Should I move them all back locally to the same position they where created in or...?

How would I remove them?


This is my only drawback in creating a fixed dynamic talent tree.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Remember that locust units are ignored in area searches.

Removing the unit synchronously should be all that is required. Keep track of the unit handle reference and use that.

Thank you I just realised I had to refference the handles before seeing your post. But am still very gratefull that you told me about locust units being ignored in area searches. This was new for me.
Refferencing the handles indeed seems to be the best approach.

what do you mean locally? You use the Getlocalplayer() function to move units? If you did it will desync you game....

Where did you hear this rumor?
I've tested this thoroughly on battle.net and it in fact does not. Just make sure they are only used for visual aspects (use locust)!
If multiple players can select them, then indeed they do desynch.
 
Level 14
Joined
Apr 20, 2009
Messages
1,543
Xtrheo said:
Oh sweet I didn't know that, thanks for the tip!

No problem ;)

Hmm okay, so I've tryed adding the units to a group and then doing an enum to get all the units and then remove them.

I can clearly see their handle ID's when doing:
JASS:
call BJDebugMsg(I2S(GetHandleId(GetEnumUnit())))

But when I remove the units, they are still displayed on my screen?? :/
Also, when displaying the handle id's after I used call RemoveUnit(GetEnumUnit()) I still see the same handle ID???

This starts to become stranger every minute.

EDIT: Oh lol it seems that I'm retarded. I was reffering to different unit handles :D
 
Status
Not open for further replies.
Top