Captain Joined: 5/11/2016(UTC) Posts: 85
Thanks: 5 times Was thanked: 4 time(s) in 4 post(s)
|
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.
|
|
|
|
General Joined: 3/8/2016(UTC) Posts: 1,156 Thanks: 312 times Was thanked: 185 time(s) in 149 post(s)
|
One question is this a mission map? |
|
|
|
|
Captain Joined: 5/11/2016(UTC) Posts: 85
Thanks: 5 times Was thanked: 4 time(s) in 4 post(s)
|
Originally Posted by: adrianemapmaker One question is this a mission map? Generals' Challenge
|
|
|
|
General Joined: 12/30/2011(UTC) Posts: 982
Thanks: 95 times Was thanked: 574 time(s) in 364 post(s)
|
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'.
Cheers Edited by user Saturday, August 26, 2017 8:07:00 PM(UTC)
| Reason: Secret |
Panem et kirkinses |
|
|
|
Captain Joined: 5/11/2016(UTC) Posts: 85
Thanks: 5 times Was thanked: 4 time(s) in 4 post(s)
|
Originally Posted by: acidbrain 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'.
Cheers That was the method I had attempted. The problem I'm encountering is that the command: Unit 'SupplyCenter' use Ability 'Command_ConstructAmericaVehicleChinook'....isn't doing anything. I know the code is being executed because I have a military briefing string being triggered at the same time.
|
|
|
|
Major Joined: 2/21/2015(UTC) Posts: 386 Thanks: 80 times Was thanked: 132 time(s) in 96 post(s)
|
Originally Posted by: Deinon 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 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. Originally Posted by: SkyMix_RMT 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. 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: After you do this the script should work normally and the AI will use the commandbutton. Edited by user Sunday, August 27, 2017 5:51:34 AM(UTC)
| Reason: Not specified |
|
|
|
|
Captain Joined: 5/11/2016(UTC) Posts: 85
Thanks: 5 times Was thanked: 4 time(s) in 4 post(s)
|
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: Never mind, I found the problem. I needed to run the script "Player 'player' is able to build units" Edited by user Monday, August 28, 2017 1:24:23 AM(UTC)
| Reason: Not specified
|
1 user thanked Deinon for this useful post.
|
|
|
Major Joined: 3/22/2017(UTC) Posts: 278 Location: Some where on Earth
Thanks: 123 times Was thanked: 69 time(s) in 59 post(s)
|
Thanks , I've forgotten this too |
Asking is Not a Problem , Problem is Not to Know Something .
Operation : Dark Angel Static : Launch Delayed Reason : Uncool Terrain - Old Logic in use - Lack of Performance Status : Applying new Terrain - Applying new Logic - Increasing Performance by 300% |
|
|
|
General Joined: 12/30/2011(UTC) Posts: 982
Thanks: 95 times Was thanked: 574 time(s) in 364 post(s)
|
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 Edited by user Wednesday, August 30, 2017 1:44:00 AM(UTC)
| Reason: Secret |
Panem et kirkinses |
|
|
|
Major Joined: 3/22/2017(UTC) Posts: 278 Location: Some where on Earth
Thanks: 123 times Was thanked: 69 time(s) in 59 post(s)
|
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 ? |
Asking is Not a Problem , Problem is Not to Know Something .
Operation : Dark Angel Static : Launch Delayed Reason : Uncool Terrain - Old Logic in use - Lack of Performance Status : Applying new Terrain - Applying new Logic - Increasing Performance by 300% |
|
|
|
General Joined: 3/8/2016(UTC) Posts: 1,156 Thanks: 312 times Was thanked: 185 time(s) in 149 post(s)
|
Unknown editor ... we have the same step |
|
|
|
|
Users browsing this topic |
Guest
|
Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.