I want to make the workers start harvesting automatically at the start of a melee game. Preferably not bunching up either, but picking one mineral patch each. How can i do this?
Well if you order workers to all gather the same patch, they automatically spread out to nearby patches. I'd add this to map init trigger.
pick each unit in unit group ( units in region (entire map) with filters: worker [required] ) and do actions:
-issue order to unit (picked unit). <<<<< Set the order to harvest and set the target to 'nearest unit in unit group". Set the unit in that unit group to minerals.
If you need me to be more detailed or show you an example trigger, send me a PM. :D
Rollback Post to RevisionRollBack
Feel free to Send me a PM if you have any questions/concerns!
Well, if its only for the game initialization triggers are probably the best choice.
On Event - Map Initialization you wanna pick each player. Now pick every unit of every player you just picked. Order the picked unit to issue oder move (I guess smartclick works...but might be wrong) on a random mineral patch in a certain radius around the unit.
It works, and i noticed the best range for finding a mineral patch is 4, that way they dont cross paths. Thanks alot, now im gonna try and make the cc/nexus/hatchery to start building a worker at the start aswell.
Triggering is an amusing profession. Literally every time I consider a trigger, or everytime someone asks about them, my first reaction is "oh, that'd be really easy to do". Then as I start thinking it into triggers, a whole batch of problems pop up. In this case; "you can't just send SCV A to mineral patch A, SCV B to patch B, etc - you need to find a way for it to work regardless of spawning location. Which means you need a way to track the mineral patches. And you need a way to track the workers. And you need to not have your workers travel across map to mine from some other patch". Suddenly, the whole thing became increasingly difficult. Damn you, triggering!
I actually got it to work now. I had to set a very short "wait" delay before triggering the select larva and morph to drone. Dont know why, but i guess larvas arent created instantly by the melee triggers.
Sometimes I think people just love over-complicating things.
Use the action "Order workers to gather nearby resources" at 0.0 seconds into the game. Doing so at map initialization may not work (It might still work at map initialization, but I haven't tested it).
Rollback Post to RevisionRollBack
To post a comment, please login or register a new account.
I want to make the workers start harvesting automatically at the start of a melee game. Preferably not bunching up either, but picking one mineral patch each. How can i do this?
Well if you order workers to all gather the same patch, they automatically spread out to nearby patches. I'd add this to map init trigger.
pick each unit in unit group ( units in region (entire map) with filters: worker [required] ) and do actions:
-issue order to unit (picked unit). <<<<< Set the order to harvest and set the target to 'nearest unit in unit group". Set the unit in that unit group to minerals.
If you need me to be more detailed or show you an example trigger, send me a PM. :D
Well, if its only for the game initialization triggers are probably the best choice.
On Event - Map Initialization you wanna pick each player. Now pick every unit of every player you just picked. Order the picked unit to issue oder move (I guess smartclick works...but might be wrong) on a random mineral patch in a certain radius around the unit.
Edit: Making a map that demonstrates it.
Edit 2: Yay, worked on first try! :-D
Thanks for the quick replies, i'm trying to make it work now this is like my second time on the trigger editor :)
Cant fail with these good explanations, cheers.
If it doesnt work just download the map I attached. Right click save as target though, else it wont work. ;-)
Good Luck
It works, and i noticed the best range for finding a mineral patch is 4, that way they dont cross paths. Thanks alot, now im gonna try and make the cc/nexus/hatchery to start building a worker at the start aswell.
I've made the the command center and the nexus to start building a worker at the start, but i cant make it work for zerg.
I'm using the exact same trigger but the target is Larva and the order is "Larva - morph to drone", and it doesnt work... Oh the frustration.
Triggering is an amusing profession. Literally every time I consider a trigger, or everytime someone asks about them, my first reaction is "oh, that'd be really easy to do". Then as I start thinking it into triggers, a whole batch of problems pop up. In this case; "you can't just send SCV A to mineral patch A, SCV B to patch B, etc - you need to find a way for it to work regardless of spawning location. Which means you need a way to track the mineral patches. And you need a way to track the workers. And you need to not have your workers travel across map to mine from some other patch". Suddenly, the whole thing became increasingly difficult. Damn you, triggering!
I actually got it to work now. I had to set a very short "wait" delay before triggering the select larva and morph to drone. Dont know why, but i guess larvas arent created instantly by the melee triggers.
Sometimes I think people just love over-complicating things.
Use the action "Order workers to gather nearby resources" at 0.0 seconds into the game. Doing so at map initialization may not work (It might still work at map initialization, but I haven't tested it).