Posted by: accomplice - Wednesday, June 17, 2009 4:06:49 AM
I've looked into the last china mission of ZH, I can see that there are 2 dozers assigned to 2 different teams, let's say "INTRO_Dozer_1" and "INTRO_Dozer_2" (Teams, not named units!).
Then, the scripts go
Team "INTRO_Dozer_1" use ability "Command_ChinaConstructGattlingCannon" at Waypoint "Gattling1" etc.
For some reason, I am not able to reproduce that with any other dozers/workers though.
I can't get an USAF Dozer to build an USAF Airfield at an assigned waypoint, despite using the exact same method...
Sorry for bothering you guys again [skull]
Posted by: Drummin - Wednesday, June 17, 2009 8:42:49 AM
In missions you use the "Build list Tool" to place buildings on the map. After placing the buildings you get the option to make the building already built on not. If you have buildings "Un-built" the worker/dozer will build each building starting at the top of the list working down to the end of the list. No scripting is needed for this to happen. I'll look into your particular scripting problem and see what I can do.
Posted by: accomplice - Wednesday, June 17, 2009 10:42:42 AM
Yes, I know of the building tool, but it seems only to work for AI players. If you want to script that a human player's dozer/worker builds something without the player's command, or a cinematic sequence (like in ZH china mission 5, where the two start dozer start building gatts), you probably have to stick to scripts. I'll go to have a closer look at that particular mish in the worldbuilder tool again :)
Posted by: Drummin - Wednesday, June 17, 2009 5:44:18 PM
Getting the dozer to build one gattling cannon wasn't that hard. In the mission, the dozer "build-scripts" were in the neutral player folder so that's where I put them and it worked.
Note: You do need prerequisite buildings (Power and Supply) for this to work, so add them to the map or add a condition to the first script to check for a supply building.
I then tried to make the dozer build more buildings and had a hard time because there is no way to detect if the building has been completed. I ended up using timers to activate the next build script. Because there is no way of knowing how long it takes the dozer to get to the build location, I made separate scripts to detect the dozer's location and start the timers. On this test map, the dozer builds three gattling cannons and one war factory.
Note to folks interested in using these script... they should work for mission and multi-player only maps. Possibly for AI players with some extra scripting, but that's untested. [ATTACH]369[/Attach]
Posted by: accomplice - Thursday, June 18, 2009 12:29:29 AM