| 06-30-2010, 11:42 AM | #1 |
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) |
| 07-02-2010, 05:43 AM | #2 |
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... |
| 07-02-2010, 07:56 AM | #3 |
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? |
| 07-02-2010, 08:12 AM | #4 |
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 |
| 07-05-2010, 09:05 AM | #5 |
How do i add regions to the array? |
| 07-05-2010, 10:33 AM | #6 | |
Quote:
|
| 07-05-2010, 12:13 PM | #7 |
Will this work on multipale regions? |
| 07-05-2010, 01:13 PM | #8 |
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. |
