Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline Deinon  
#1 Posted : Friday, August 25, 2017 8:46:26 PM(UTC)
Deinon
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.
Sponsor
Offline AdrianeMapMaker  
#2 Posted : Saturday, August 26, 2017 3:25:01 AM(UTC)
AdrianeMapMaker
General
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 3/8/2016(UTC)
Posts: 1,156
Philippines

Thanks: 312 times
Was thanked: 185 time(s) in 149 post(s)
One question is this a mission map?
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb

UserPostedImage





Offline Deinon  
#3 Posted : Saturday, August 26, 2017 12:08:45 PM(UTC)
Deinon
Captain
Joined: 5/11/2016(UTC)
Posts: 85

Thanks: 5 times
Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: adrianemapmaker Go to Quoted Post
One question is this a mission map?


Generals' Challenge
Offline acidbrain  
#4 Posted : Saturday, August 26, 2017 8:04:05 PM(UTC)
acidbrain
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
Offline Deinon  
#5 Posted : Sunday, August 27, 2017 12:51:01 AM(UTC)
Deinon
Captain
Joined: 5/11/2016(UTC)
Posts: 85

Thanks: 5 times
Was thanked: 4 time(s) in 4 post(s)
Originally Posted by: acidbrain Go to Quoted Post
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.
Offline SkyMix_RMT  
#6 Posted : Sunday, August 27, 2017 5:50:43 AM(UTC)
SkyMix_RMT
Major
Joined: 2/21/2015(UTC)
Posts: 386
Portugal

Thanks: 80 times
Was thanked: 132 time(s) in 96 post(s)
Originally Posted by: Deinon Go to Quoted Post
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 Go to Quoted Post

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.
UserPostedImage
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:
UserPostedImage


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

Check out:

My Music (Techno/House/Experimental)

My Website (GeneralsCentral)

My Youtube Channel (Inactive)

World Builder Community Discord
Offline Deinon  
#7 Posted : Sunday, August 27, 2017 10:27:53 PM(UTC)
Deinon
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

thanks 1 user thanked Deinon for this useful post.
Unknown Editor on 8/28/2017(UTC)
Offline Unknown Editor  
#8 Posted : Monday, August 28, 2017 12:27:51 AM(UTC)
Unknown Editor
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 Big Smile
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%
Offline acidbrain  
#9 Posted : Tuesday, August 29, 2017 2:06:48 AM(UTC)
acidbrain
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
Offline Unknown Editor  
#10 Posted : Tuesday, August 29, 2017 3:09:05 AM(UTC)
Unknown Editor
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%
Offline AdrianeMapMaker  
#11 Posted : Wednesday, August 30, 2017 12:41:32 AM(UTC)
AdrianeMapMaker
General
C&C Labs Staff: Labs Staff MemberMaps Staff: Maps Staff Member
Joined: 3/8/2016(UTC)
Posts: 1,156
Philippines

Thanks: 312 times
Was thanked: 185 time(s) in 149 post(s)
Unknown editor ... we have the same step
A part of ZH worldbuilders map making community
https://discord.gg/tJ6zyGb

UserPostedImage





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.