Posted by: Deinon - Friday, August 25, 2017 9:46:26 PM
All I want is to make a supply center in a certain part of the map construct more gatherers if the area containing both it and the supply dock it collects from doesn't contain any gatherers. I've tried using the CommandButton in scripting, but while it does show the briefing string I included as a test, it doesn't build a new supply truck when that particular script is run. This supply center is isolated from the rest of the enemy base (it's at the shipyards with a few guard towers for protection), so I don't want the enemy base to just pump out another gatherer from its own supply center.

Posted by: AdrianeMapMaker - Saturday, August 26, 2017 4:25:01 AM
One question is this a mission map?

Posted by: Deinon - Saturday, August 26, 2017 1:08:45 PM
[quote=adrianemapmaker;146106]One question is this a mission map?[/quote] Generals' Challenge

Posted by: acidbrain - Saturday, August 26, 2017 9:04:05 PM
What about this... Lets say that the player is USA and the AI is China. There is an area called 'Supply Area' with a USA SupplyCenter named 'SupplyCenter' and a supplydock in it. Here are some scripts... [code] // Method 1_Use an object list // Scripts location: // -Player/Area/Player has (comparison) unit type in an area. // -Unit/CommandButton/Use commandbutton ability. [ns A D][E N H]Build Supply Gatherer in area *** IF *** Player 'China' has Less Than or Equal 0 unit or structure of type 'Supply Gatherers' in the area 'Supply Area' *** THEN *** Unit 'SupplyCenter' use Ability 'Command_ConstructAmericaVehicleChinook'. // Object list // Script location: // -Scripting/ObjectTypeList/Add Object Type [ns A D][E N H]Object List_Supply Gatherers *** IF *** True. *** THEN *** 'Supply Gatherers' : add 'AmericaVehicleChinook' 'Supply Gatherers' : add 'ChinaVehicleSupplyTruck' // Method 2_Use a kindof // Script location: // -Player/Owns/Player has (comparison) kind of unit or structure in an area. // -Unit/CommandButton/Use commandbutton ability. *** IF *** Player 'China' has Less Than or Equal 0 unit or structure with Kind is 'HARVESTER' in the area 'Supply Area' *** THEN *** Unit 'SupplyCenter' use Ability 'Command_ConstructAmericaVehicleChinook'. [/code] Cheers

Posted by: Deinon - Sunday, August 27, 2017 1:51:01 AM
[quote=acidbrain;146111]What about this... Lets say that the player is USA and the AI is China. There is an area called 'Supply Area' with a USA SupplyCenter named 'SupplyCenter' and a supplydock in it. Here are some scripts... [code] // Method 1_Use an object list // Scripts location: // -Player/Area/Player has (comparison) unit type in an area. // -Unit/CommandButton/Use commandbutton ability. [ns A D][E N H]Build Supply Gatherer in area *** IF *** Player 'China' has Less Than or Equal 0 unit or structure of type 'Supply Gatherers' in the area 'Supply Area' *** THEN *** Unit 'SupplyCenter' use Ability 'Command_ConstructAmericaVehicleChinook'. // Object list // Script location: // -Scripting/ObjectTypeList/Add Object Type [ns A D][E N H]Object List_Supply Gatherers *** IF *** True. *** THEN *** 'Supply Gatherers' : add 'AmericaVehicleChinook' 'Supply Gatherers' : add 'ChinaVehicleSupplyTruck' // Method 2_Use a kindof // Script location: // -Player/Owns/Player has (comparison) kind of unit or structure in an area. // -Unit/CommandButton/Use commandbutton ability. *** IF *** Player 'China' has Less Than or Equal 0 unit or structure with Kind is 'HARVESTER' in the area 'Supply Area' *** THEN *** Unit 'SupplyCenter' use Ability 'Command_ConstructAmericaVehicleChinook'. [/code] Cheers[/quote] That was the method I had attempted. The problem I'm encountering is that the command: [b] Unit 'SupplyCenter' use Ability 'Command_ConstructAmericaVehicleChinook'.[/b] ...isn't doing anything. I know the code is being executed because I have a military briefing string being triggered at the same time.

Posted by: SkyMix_RMT - Sunday, August 27, 2017 6:50:43 AM
[quote=Deinon;146104]All I want is to make a supply center in a certain part of the map construct more gatherers if the area containing both it and the supply dock it collects from doesn't contain any gatherers. I've tried using the CommandButton in scripting, but while it does show the briefing string I included as a test, it doesn't build a new supply truck when that particular script is run. [/quote] This problably happens because of an invisible character that is in front of the commandbutton name, check this post I did a few weeks ago when a guy asked how to remove a commandbutton, it should work for you but instead of removing you make the AI use it. [quote=SkyMix_RMT;145865] Script: Scripting > Remove a command button from an object type. Script should look like: True. *** THEN *** [???] Command button: 'Command_UpgradeGLAScorpionRocket' is removed from all objects of type 'GLAArmsDealer'. !IMPORTANT! After selecting the command button you want to remove, YOU MUST delete an invisible character that's at the end of the command button. To verify that this character is removed, please check if the world builder recognizes the command button. [img]http://imgur.com/5zLc9Xw.png[/img] If it recognizes the command button exists, then the character is still there, select the end of the text and press backspace. This is how it should look like after you deleted the invisible character: [img]http://imgur.com/KHSLhLY.png[/img] [/quote] After you do this the script should work normally and the AI will use the commandbutton.

Posted by: Deinon - Sunday, August 27, 2017 11:27:53 PM
Doesn't look like there's a spacing issue. I've tried doing this with multiple structures now - airfield, supply depot, it looks like CommandButton simply can't be used to make a structure build a unit. It can be used to build upgrades, but it won't put anything in a build queue and construct it. Either there's a step missing here or it's disabled by design. Hope there's some other way of doing this, otherwise I'm not sure how to get an AI team to replace destroyed supply gatherers - I don't see anything in the teams so far for other Generals Challenges for resource gatherers. EDIT: [b]Never mind, I found the problem.[/b] I needed to run the script "Player 'player' is able to build units"

Posted by: Unknown Editor - Monday, August 28, 2017 1:27:51 AM
Thanks , I've forgotten this too [grin]

Posted by: acidbrain - Tuesday, August 29, 2017 3:06:48 AM
Lol, had this too in the past and thats why it is the second sriptfolder i make when i start a new map... 1st_Vision, unshroud the map for the player 2nd_Enable build, able to build buildings and units Cheers

Posted by: Unknown Editor - Tuesday, August 29, 2017 4:09:05 AM
Mine : 1st = unshroud the whole map (Just the Intro Parts if there are many particles in the whole map) 2nd = Intro 3rd = Others 4th = Anything instead of Build Availability 5th = Wondering why Structures won't Build Units ?

Posted by: AdrianeMapMaker - Wednesday, August 30, 2017 1:41:32 AM
Unknown editor ... we have the same step