|
|
#1 |
|
User
|
Is there a way to make units players send start at random regions?
And whats the best way to script units to keep attack a unit (thats allrdy in a unit group) |
|
|
|
| Sponsored Links - Login to hide this ad! |
|
|
|
|
#2 |
|
†6†
Join Date: Oct 2008
Posts: 841
![]()
|
1) don't understand what you want...sry
__________________2) periodically loop through the group and issue "attack"-order OR register all order-events (ISSUE_ORDER, ISSUE_POINT_ORDER, ISSUE_TARGET_ORDER) and check if the ordered unit is within your group, if it is and the order is different from "attack" then disable the order-trigger, pause the unit, issue "stop", unpause it, issue "attack", enable the order-trigger. this method requires to issue "attack" when an unit is added to the group. i thing second way is more efficient, but also more difficult to code... |
|
|
|
|
|
#3 |
|
User
|
Cool thanks that helped alot!!
Ok what i meant by the first one is, i have a region, where the units enter (like creep sends), then i want those units that enter the region to spawn in random other regions? |
|
|
|
|
|
#4 |
|
†6†
Join Date: Oct 2008
Posts: 841
![]()
|
use unit enters region event and an array with all possible random locations/regions
__________________everytime an units enter the region, move it instantly to the location/region at a random place in the array. use a random integer form <index of first location/region> to <index of last location/region> as index to determine the location/region where you wanna move your unit |
|
|
|
|
|
#5 |
|
User
|
How do i add regions to the array?
|
|
|
|
|
|
#6 | |
|
Procrastination Incarnate
Development Director
|
Quote:
|
|
|
|
|
|
|
#7 |
|
User
|
Will this work on multipale regions?
|
|
|
|
|
|
#8 |
|
†6†
Join Date: Oct 2008
Posts: 841
![]()
|
yes, you need a region-array and an integer to count how many regions you have.
__________________then simply populate the array and set the count-integer to the maximal used index of your array. |
|
|
|
![]() |
| Thread Tools | Search this Thread |
|
|
|
Donate |