| 02-09-2004, 12:25 AM | #1 |
Ok, I have just had a long break from WC3 and have just decided to begin making a new campaign. I'm a little rusty on some of the things I used to think were easy, so I have a pretty noobish question about harvesting: I have created a team which only has 4 peasants, a town hall and a lumbermill. I want the peasants to simply cut the trees nearby and gather wood. Whats the easiest way to do this? I didnt want to use unit order because I think that will make them target only one tree for the whole game, normal AI scripts would make them build, attack etc and I didnt want to make a huge mass of triggers. In the end I made a new AI using the AI editor and removed all of the build orders and attack squads, simply leaving the harvest - 10 peasants command. Unfortunately when I set them to use this AI nothing happens when I play the game and the peasants dont move. Sorry if this has been asked before but I've been away a long time, and couldn't find an answer by searching. Cheers, SheepOfDoom |
| 02-09-2004, 12:49 AM | #2 |
the best way i can think of is ordering the unit to target a random doodad. |
| 02-09-2004, 01:02 AM | #3 |
First, Im assuming the peasents are controled by a computer player (what with the AI script) and not a human. I would do it as 2 triggers. Trigger 1. Get the peasents started Event Game Time = X (whenever they should start) COndition None Action Pick all Peasent owned by X and Do Order Picked Unit to attack Random Unit from Unit Group matching matching unit is in region (The Forest) and Unit-classifaction is equal to Doodad Next trigger uses basically the same action, but has a different event and condition. Events Unit leaves region (Region around the Lumber Mill) Unit leaves region (Region around the Town Hall) Condition Unit-type of (Leaving unit ) is equal to Peasent Owner of (leaving unit) is equal to Player X Action Order Leaving to to blah blah blah. A trigger to stop the lumbering action when the trees run out would be a good idea to, but given how peasents normally act when out of trees its not a huge deal. |
| 02-09-2004, 01:23 AM | #4 |
Thanks alot guys, Will give it a try tonight and see how it goes :) Cheers, SheepOfDoom |
| 02-09-2004, 01:33 AM | #5 |
errrr....AI Editor ?:))) minimum working peasants - wood 4 if (number of (peasants harvesting wood) is less than 4) then send all peasants to gather wood etc..... |
