Any Unit Select Fires for every unit Selected In A group Except for the Unit actually double clicked.
Im finded that the "Any Unit Clicked" event isnt doing anything.
Basically Ive writen a custom Range check. So that when you select a unit It draws the range around the unit.( the range showing isnt the problem)
I basically do this
Event- Any Unit Selected by Any Player
Condition - Owner of (triggering unit) = triggering player
Acation - Function(show range for triggering unit)
This all works except the unit being double clicked does not fire this event. So One of my Units always ends up with out showing the range selection.
I have modified this so it only works when selecting one unit at a time.
Mainly looking for any work arounds people may have come up with or am is there something im missing.
I have even set up a loop so that when this event fires it would out put the indexed postion of the trigging unit in the Selected Units Group.
For example if we have 3 units and I double click them the indexs that are picked up are
1,3
2,3
1,2
So far from what i can tell it fires the units in order as in 1,2,3,4,5 , but it leaves out the unit that was double clicked. I believe this is due to the unit alredy being selected. and there for not fireing the trigger because it was already selected.
Note: This event can cause massive lag when selecting alot of units at once. Coding anything based on this event requires some thought due to the implications of how many times it runs when you select 50 units at once. Since it runs for every unit selected not the unit group.
Event unit is clicked is different than unit is selected. Your unit has to have flag unclickable unchecked. And also mouseclick up and down both fire that events, most likely unit selection is a better choice.
Depends on the mechanic of double click selection work, the selected unit may not be included (like your example). However at anytime you can refer to function Selected units for player to get the group of unit he is currently selected. Might be looping through them and show range.
Not sure what u want to do with the range since its not easy do move it along side unit. If you want the range like siege tank, you can use data editor, 500% easier :)
Well I have a bit of code that sorts through The units weapons and abilities. And the Displays the range value from each weapon and ability. This is all dynamically done. I just pass it the unit and it handles the rest.
I did try looping through the selected Units and this works pretty well except for the part where based on the Selected Units Trigger. I need a way to determine when to
Clear the current Ranges
Then show the select Units ranges
Since the first unit that triggers this is either 1 or 2 .... I need better time to do the resetting since ....
Say i do
Unit Index = 1 ... 1 is the base for unit groups then I clear the shown ranges This works fine but say ... Im actually double clicking unit 1 ... so then unit 1 in the unit group never triggers this so it never hides the current ranges.
I think I might need to use
Triggering Unit = Selected Units[1 or 2] then Hide shown ranges
Triggering Unit = Selected Units[Num of Selected Units] if I do this then I can fire off a loop that loops through all the select units and then shows thier ranges. (Note: this may not always catch the last unit in the group if that was the double clicked unit)
Still not understand what's your problem. Never use triggering unit, just use event fire when unit is selected or deselected (use both). Loop throuhg all unit in the entire map, remove range. Loop through all unit in selected units for player, show range.
In the data editor, range can be shown dynamically only when unit is selected, there's event for that, check the siege tank range actor
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
Any Unit Select Fires for every unit Selected In A group Except for the Unit actually double clicked.
Im finded that the "Any Unit Clicked" event isnt doing anything.
Basically Ive writen a custom Range check. So that when you select a unit It draws the range around the unit.( the range showing isnt the problem)
I basically do this
Event- Any Unit Selected by Any Player
Condition - Owner of (triggering unit) = triggering player
Acation - Function(show range for triggering unit)
This all works except the unit being double clicked does not fire this event. So One of my Units always ends up with out showing the range selection. I have modified this so it only works when selecting one unit at a time.
Mainly looking for any work arounds people may have come up with or am is there something im missing.
I have even set up a loop so that when this event fires it would out put the indexed postion of the trigging unit in the Selected Units Group.
For example if we have 3 units and I double click them the indexs that are picked up are
So far from what i can tell it fires the units in order as in 1,2,3,4,5 , but it leaves out the unit that was double clicked. I believe this is due to the unit alredy being selected. and there for not fireing the trigger because it was already selected.
Note: This event can cause massive lag when selecting alot of units at once. Coding anything based on this event requires some thought due to the implications of how many times it runs when you select 50 units at once. Since it runs for every unit selected not the unit group.
Any thoughts would be appreciated.
Event unit is clicked is different than unit is selected. Your unit has to have flag unclickable unchecked. And also mouseclick up and down both fire that events, most likely unit selection is a better choice.
Depends on the mechanic of double click selection work, the selected unit may not be included (like your example). However at anytime you can refer to function Selected units for player to get the group of unit he is currently selected. Might be looping through them and show range.
Not sure what u want to do with the range since its not easy do move it along side unit. If you want the range like siege tank, you can use data editor, 500% easier :)
@progammer: Go
Well I have a bit of code that sorts through The units weapons and abilities. And the Displays the range value from each weapon and ability. This is all dynamically done. I just pass it the unit and it handles the rest.
I did try looping through the selected Units and this works pretty well except for the part where based on the Selected Units Trigger. I need a way to determine when to
Since the first unit that triggers this is either 1 or 2 .... I need better time to do the resetting since ....
Say i do
Unit Index = 1 ... 1 is the base for unit groups then I clear the shown ranges This works fine but say ... Im actually double clicking unit 1 ... so then unit 1 in the unit group never triggers this so it never hides the current ranges.
I think I might need to use
then Hide shown ranges
if I do this then I can fire off a loop that loops through all the select units and then shows thier ranges.
(Note: this may not always catch the last unit in the group if that was the double clicked unit)
Still not understand what's your problem. Never use triggering unit, just use event fire when unit is selected or deselected (use both). Loop throuhg all unit in the entire map, remove range. Loop through all unit in selected units for player, show range.
In the data editor, range can be shown dynamically only when unit is selected, there's event for that, check the siege tank range actor