| 09-20-2003, 09:54 PM | #1 |
Hello there, As I am working on an AoS Map for some time now, I tried many ways to order the computer controlled units to move around. So far, I always come up with problems in the late game, because units spawn too fast the for my script to order them around. I will sketch some of the approaches I already tried: 1. Using a Trigger that picks every unit owned by the computer player and orders it to attack move towards the enemy base every few seconds. I got the weird effect of the units stopping every few steps and moving very slowly. Later on it seemed that the orders were given too slow to compensate for the continual stream of newly created units. 2. Creating the units and immedeately using "Order <last created unit group>" to attack-move them towards the enemy base. Unfortunately, there is a limit of 12 Units per unit group, wich can be exceeded by my unit creation trigger. Other than that, units that return to their base or stop halfway for some reason (Not having found anything to attack, being taunted, being ressurected) simply get stuck there. 3. Using a trigger that picks every unit in the spawn area immedately after the spawn and orders it to move towards the enemy base. This is my current approach, it works fine early on, but in the late game sometimes the orders just don't seem to be issued fast enough, so troops start massing in the base then and you get lots of lag. I would be grateful for any comments on these approaches, and delighted if someone has any other - hopefully better working - solutions for this problem than mine. Greetings, Malleus |
| 09-21-2003, 03:26 AM | #2 |
Alright there are many ways to go about solving this problem but I am going to outline the one that I have used in my TD and AoS style maps. I recomend the region guide path for your problem. As an esay example lets say we have 4 regions in this equation Region 1 - 00UnitStartPoint Region 2 - 01MovePoint Region 2 - 02MovePoint Region 3 - 03UnitEndPoint Create these regions on your map (names are not really that impotrant). 00UnitStartPoint should be located where you want your units to spawn and obivously 03UnitEndPoint where you want the units to end. One you have made a start, finish and all inbetween, set up a varible of type region and make it an array with length (in this case) of 4. I am going to call the varible UnitMoveArry[] (you can call it what ever you like, just be consistant) Put those 4 regions into the UnitMoveArry[] in order 1 to 4. When your units spawn in region 00UnitStartPoint ether in the trigger that spawns them, or a trigger that fires when they enter the region set thier custom unit value to 2. Now here is the pay off for the work. Make a new trigger that fires ever (I recomend 2 seconds, but to cut lag down you can do longer intervualds) that does the following: Events --Time - Every 2 seconds of game time Conditions Actions --Unit group - Pick every unit in (units owned by player 1 (Red)) and do (Actions) --->If - Conditions ------>(UnitMoveArry[(Custom value of (Picked Unit))] contains (Picked unit)) Equal to True ---->Then - Actions ------>Unit - Set the custom value of (Picked Unit) to ((Custom Value of (Picked Unit) + 1) ------>Unit - Order (Picked unit) to Attack-Move To (Center of UnitMoveArry[(Custom value of (Picked unit))]) ---->Else - Actions Summry of that. Every 2 secounds run this trigger. If a unit is in one of the regions matching its set of preprogramed regions then it increases its region list by 1 and moves to the next thing on the list. If its not in a region then the unit does what ever it was doing last, and doesnt lag down the game by issueing orders that units are already following. That may be a bit long winded but thats what I did, and it works about 99% of the time Hope that helps Neo_Genesis |
| 10-16-2003, 06:48 PM | #3 |
Sorry I know this is an old thread but I am having a lot of problems in this area. There are two things I dont understand about NeoGenesis' instructions: "Put those 4 regions into the UnitMoveArry[] in order 1 to 4." How the hell do I do that? Also how do I set their custom value to 2? Other than that I understand how these two things would work if completed, just not how to accomplish them. If any one could help me here it would be greatly appreciated. Even better NeoGenesis, is there any way you could host this trigger by itself in a map so I could look at it? I have been struggling with this for some time :( |
| 10-16-2003, 09:23 PM | #4 |
Hi, To "put the regions into the UnitMoveArry[]" use the following trigger: Set Variable UnitMoveArry[1]=00UnitStartPoint Set Variable UnitMoveArry[2]=01UnitMovePoint Set Variable UnitMoveArry[3]=02UnitMovePoint Set Variable UnitMoveArry[4]=03UnitEndPoint to "set their custom value to 2" use a trigger like: spawn units Events Conditions Actions Unit - Create 1 Captain for Player 10 (Light Blue) at (Center of spawn_region) facing Default building facing degrees Unit Group - Pick every unit in (Last created unit group) and do (Actions) Loop - Actions Unit - Set the custom value of (Picked unit) to 2 Unit - Create 4 Footman for Player 10 (Light Blue) at (Center of spawn_region) facing Default building facing degrees Unit Group - Pick every unit in (Last created unit group) and do (Actions) Loop - Actions Unit - Set the custom value of (Picked unit) to 2 Hope this helps, bobthemage |
| 10-16-2003, 11:04 PM | #5 |
callys here you go your own extreamly simple map path to play with. =) Hope that helps Neo_Genesis |
