Armor general in single player editing
The Shell 26 Apr 2008
I am working on a single player map. I have General Ironside as one of the players but I have come across a few problems.
Thanks for any help you can offer.
Edited by hl_world, 26 April 2008 - 15:20.
- When getting him to build vaporiser cannons, it seems only possible to do this by having module bunkers in his build list, name them and for them to trigger a [S A nD] script:
*** IF *** True. *** THEN *** Unit '<This Object>' use Ability 'Armor_Command_ConstructAmericaVulcanTurret_Dummy'.
but doing this seems to make the AI build several module bunkers > vaporiser turrets in the same place, sometimes overlapping, as the ones on the build list thus hogging all of his power output. How do I make him stick only to the build list? - He doesn't rebuild his command center despite setting rebuilds to unlimited. What's up with that?
- I have him build 2 supply trucks in a team so they can get replaced if they get destroyed but the 2nd truck that comes out doesn't bother to gather from the supply dock a very short distance away. This is the [S A nD] script I use (called Armor Team Conditions) for all of his teams (including attacking inf, vehicles, dozers and the trucks):
*** IF *** True. *** THEN *** Null operation. (Does nothing.)
and the team settings (values differing from default):
Team name: Armor trucks
Owner: PlyAmericaArmorGeneral
Condition: Armor Team Conditions
Priority: 2000
Min:2 Max:2 Unit Type: Armor_AmericaVehicleSupplyTruck
Flag(s): Automatically reinforce wherever possible.
So I have no idea.
Thanks for any help you can offer.
Edited by hl_world, 26 April 2008 - 15:20.
Dauth 26 Apr 2008
This belongs in the MG help/SHW section, I hope they can help you out. I'll move to the help and the guild council can decide from there.
Lord Atlantis 26 Apr 2008
Well, for the building of the vaporizer turret module, you need to set the script to one once then deactivate. THen when it needs to be replaced, create an activation script to reactivate the upgrade Concrete Slab script.
nip 26 Apr 2008
Are you using the Build List tool in WB for your vaporizer thingy? You can't reference faction structures placed through the Build List tool in scripts. And the subroutine script you're using to build is looping, a subroutine script cannot be disabled thus is building multiple times.
I'm using two scripts for Chinese supply truck rebuild in my latest mission.
SupplyTruck_Enable
SupplyTruck_Build
The action 'Unit 'Structure_ChinaSupplyCenter' use Ability 'Command_ConstructChinaVehicleSupplyTruck'.' can be used multiple times in a script and the structure then build the number of supply trucks. Note the AI needs money to build, and you should use the actions 'Set a player to be able to build buildings' and 'Set a player to be able to build units'.
I'm using two scripts for Chinese supply truck rebuild in my latest mission.
SupplyTruck_Enable
*** IF *** Timer 'SupplyTruck_BUILD' has expired. *** THEN *** Enable Script 'SupplyTruck_Build'. (by default this script is disabled, uncheck 'Script is active')
SupplyTruck_Build
*** IF *** Player 'China' has lost an object of type 'ChinaVehicleSupplyTruck' (can be an object type list). *** THEN *** Unit 'Structure_ChinaSupplyCenter' use Ability 'Command_ConstructChinaVehicleSupplyTruck'. Set timer 'SupplyTruck_BUILD' to expire in 5.00 seconds. Enable Script 'SupplyTruck_Enable'.
The action 'Unit 'Structure_ChinaSupplyCenter' use Ability 'Command_ConstructChinaVehicleSupplyTruck'.' can be used multiple times in a script and the structure then build the number of supply trucks. Note the AI needs money to build, and you should use the actions 'Set a player to be able to build buildings' and 'Set a player to be able to build units'.
The Shell 26 Apr 2008
Thanks but for each of your scripts, Lord Atlantis and nipthecat, what are the [S A D] flags?
I used the build list tool and put down a couple of concrete slabs. Do they have to have their own scripts each?
I used the build list tool and put down a couple of concrete slabs. Do they have to have their own scripts each?
Pav:3d 26 Apr 2008
-Xv- 27 Apr 2008
The Shell 27 Apr 2008
I think I know why the AI keeps building concrete slabs around their originals, correct me if I'm wrong here:
How would I get the AI to only replace vaporiser turret with concrete slab if it gets destroyed?
Edited by hl_world, 27 April 2008 - 19:11.
- The first slab gets built under build list
- 1st slab follows [S A nD] script "<This object> uses command ability [build vaporiser turret]"
- 1st slab turns into vaporiser turret making the AI player 'lose' the concrete slab. Side note: concrete slab loses its name in build list settings
- AI thinks 1st slab has been destroyed and so builds another on build list settings "rebuilds: unlimited"
- 2nd slab gets built and process loops.
How would I get the AI to only replace vaporiser turret with concrete slab if it gets destroyed?
Edited by hl_world, 27 April 2008 - 19:11.
Lord Atlantis 27 Apr 2008
Have it get a name (VaproizerTurret1) so that it can only be rebuilt when the concerte slab is destroyed and "VaproizerTurret1" does not exist.
The Shell 27 Apr 2008
I gave it the concrete slab "vaporiser South" in build list but like I said with that side note in step 3 it loses it's name when it tranforms into a vaporiser turret. Without a name it can't be referenced.
Also, how would I get the AI to build a particular building in a particular location in scripting?
Is there a script action available to give a unit/building a name while the game is running?
Also, how would I get the AI to build a particular building in a particular location in scripting?
Is there a script action available to give a unit/building a name while the game is running?
JJ 12 May 2008
Add this map.ini to your map so you can make the AI build the separate defenses without building the Concrete Slab first, so you don't have to script the AI to upgrade the Slabs. Just ask the AI to construct Armor_AmericaVulcanTurret, Armor_AmericaGuardianDefenceTurret or Armor_AmericaGazerTurret directly.