You can still make a distance calculation for each unit of your group, in a trigger on a timed event every 0.0 seconds.
Another solution, is to perform this test only when a unit moves.
But that is not a good solution if you have a lot of units to test as it will slow your map.
Yes, you can "store" an integer (actually a float) in a unit. Use the UnitSetCustomValue(unit, index, value) function, where:
- unit is the unit in which you want to store your value
- index is the index of your value (consider this as if your unit were an array and this is the index where you want to put your value)
- value is... the value !
You can then access your value with UnitGetCustomValue(unit, index).
I am currently making a map with keyboard controlled units.
As some of you may know, the event "Any player presses Any Key Down etc.." make the map very laggy when published to battlenet.
I am trying to find a good workaround, but nothing until now.
I can detect the keydown event, by using shortcut abilities, but my problem is how to detect the keyup event.
Does anyone know a way to detect a keyup event without using the "Any player presses Any Key Up etc.." event ?
0
You can still make a distance calculation for each unit of your group, in a trigger on a timed event every 0.0 seconds. Another solution, is to perform this test only when a unit moves.
But that is not a good solution if you have a lot of units to test as it will slow your map.
0
@ILikeKillAndYou: Go
Yes, you can "store" an integer (actually a float) in a unit. Use the UnitSetCustomValue(unit, index, value) function, where: - unit is the unit in which you want to store your value - index is the index of your value (consider this as if your unit were an array and this is the index where you want to put your value) - value is... the value !
You can then access your value with UnitGetCustomValue(unit, index).
0
Hi everyone,
I am currently making a map with keyboard controlled units. As some of you may know, the event "Any player presses Any Key Down etc.." make the map very laggy when published to battlenet. I am trying to find a good workaround, but nothing until now.
I can detect the keydown event, by using shortcut abilities, but my problem is how to detect the keyup event.
Does anyone know a way to detect a keyup event without using the "Any player presses Any Key Up etc.." event ?
Thank you all,
Aylatan
0
@seanybabyx2: Go
You should duplicate the actor part as well as the unit, that should fix your first problem.