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

Notification

Icon
Error

2 Pages12>
Options
Go to last post Go to first unread
Offline Turret Wars Line  
#1 Posted : Sunday, August 16, 2009 3:38:46 AM(UTC)
Turret Wars Line
Major
C&C Labs Staff: Labs Staff Member
Joined: 11/3/2008(UTC)
Posts: 190
Location: KL, Malaysia

Hi, I'm trying to figure out how to add command buttons to units and buildings, for example like a booby trap button to the GLA unit Tunnel Defender, mainly I want to do these changes, like so:

USA Barracks
-Advanced Training upgrade in 9th slot
-Chemical Suit upgrade in 10th slot

USA Supply Center
-Supply Lines upgrade in 5th slot

USA Command Center
-Intelligence upgrade in 9th slot

I use the script: "Add command button to an object type" but in the map, nothing changes. Suggestions?

Any answers would be well appreciated

PS: This is my first real step in Scripting in World Builder

Edited by user Sunday, August 16, 2009 3:40:48 AM(UTC)  | Reason: PS line I forgot to write

UserPostedImage
Sponsor
Offline Annihilationzh  
#2 Posted : Sunday, August 16, 2009 3:50:26 AM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Booby trap & Intelligence require more than just a button to work. It would require a map.ini or a game mod. Adding upgrades to most buildings is possible though.

The ability to add command buttons has a bug. All entries in the drop down have an additional character (invisible in some PCs, a square in others) on the end that shouldn't be there. Remove this character & the code will work.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Offline Turret Wars Line  
#3 Posted : Sunday, August 16, 2009 3:54:42 AM(UTC)
Turret Wars Line
Major
C&C Labs Staff: Labs Staff Member
Joined: 11/3/2008(UTC)
Posts: 190
Location: KL, Malaysia

So you mean it requires an INI file in the map? right?
UserPostedImage
Offline Annihilationzh  
#4 Posted : Sunday, August 16, 2009 4:05:06 AM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Yes, but you won't be able to play it online if you do that.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Offline Art_in_MT  
#5 Posted : Monday, August 24, 2009 11:53:06 AM(UTC)
Art_in_MT
Private
Joined: 8/24/2009(UTC)
Posts: 2
Location: Montana, USA

My son and I have been struggling with this all day.
We have an example map (City in Terror) that adds a command button (boobytrap) but we cannot find any script that adds the command, and there is no additional ini file.

We tried adding another command button using the "delete last character" trick, but had no success.

I suspect we are missing the obvious here. For the benefit of a couple "noobs" could you explicitly define how a command button is added to a unit? We would GREATLY appreciate it! (We've read the tutorials, and searched the boards, but haven't found much discussion of this, so I'm betting we are missing something REALLY self evident....)

Thanks for any help you can give.



Offline Annihilationzh  
#6 Posted : Monday, August 24, 2009 12:52:00 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Quote:
We have an example map (City in Terror) that adds a command button (boobytrap) but we cannot find any script that adds the command, and there is no additional ini file.

That's a little odd, because booby trap requires a special ability to activate, the button won't do it by itself. To explain, the button doesn't even know that it's supposed to create a booby trap. It's the rebel that gives that data.

Which unit is the booby trap added to, and are you positive that there isn't a map.ini file in with the other map files?

Quote:
I suspect we are missing the obvious here. For the benefit of a couple "noobs" could you explicitly define how a command button is added to a unit?

I'll have to use an example.

Code:
*** IF ***
    True.
*** THEN ***
   Command button: 'AirF_Command_ConstructAmericaVehicleChinook' is added to all objects of type 'ChinaSupplyCenter' in slot number  3  (1-12).
   'AirF_AmericaVehicleChinook' becomes Buildable (Ignore_Prerequisites)


This script in the Civilian folder will add the combat chinook to the China supply center.

Edited by user Monday, August 24, 2009 12:59:33 PM(UTC)  | Reason: Not specified

If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Offline Art_in_MT  
#7 Posted : Thursday, August 27, 2009 3:43:27 AM(UTC)
Art_in_MT
Private
Joined: 8/24/2009(UTC)
Posts: 2
Location: Montana, USA

Annihilationzh:

THANK YOU for the reply! You got us "un-stuck!"
We've been working with the info you provided and are now starting to understand a little better how this all works.
Putting the script in the CIVILIAN folder was a key piece we were missing for several pieces we were trying to do. I can't say we understand the logic behind it being in the CIVILIAN folder, it works!

The map we referred to (City in Terror) didn't require an INI file because it turned on an ability that the unit already had - hence no need for the INI.

Your detailed script examples and the explanation was perfect!
Thanks again!

PS - is there an easy way to dump the full tree of possible script selections to a file for searching? We are never sure where to look, and being able to "grep" it would be really useful.

Edited by user Thursday, August 27, 2009 3:45:18 AM(UTC)  | Reason: Not specified

Offline Annihilationzh  
#8 Posted : Thursday, August 27, 2009 4:36:21 AM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
I don't think there is a list of all possible scripts - I had to learn the hard way.

If you get really stuck on something specific, we're here to help.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Offline Aafat  
#9 Posted : Thursday, January 14, 2010 1:28:23 AM(UTC)
Aafat
Private
Joined: 1/6/2010(UTC)
Posts: 48
Location: Pakistan

Annihilationzh I used your example but nothing happened, the command button didn't appeared in the desired factions.

Is there any other possibility except editing the ini files?

*** IF ***
True.
*** THEN ***
Command button: 'Command_ConstructChinaVehicleSupplyTruck
' is added to all objects of type 'Lazr_AmericaSupplyCenter' in slot number 2 (1-12).
Command button: 'Command_UpgradeAmericaMOAB
' is added to all objects of type 'Lazr_AmericaPowerPlant' in slot number 2 (1-12).
Command button: 'Command_UpgradeGLAArmTheMob
' is added to all objects of type 'Lazr_AmericaPowerPlant' in slot number 2 (1-12).
Offline Annihilationzh  
#10 Posted : Thursday, January 14, 2010 6:46:34 AM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Have you deleted the invisible character? See post #2, the second half.

Have you put it in the civilian folder?

Is your script active, deactivate upon sucess and not subroutine? (If you haven't changed these, ignore this question)

Also, make sure you don't put them in the same place on the same building.

Edited by user Thursday, January 14, 2010 6:54:57 AM(UTC)  | Reason: Not specified

If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Offline Aafat  
#11 Posted : Wednesday, January 27, 2010 12:34:41 PM(UTC)
Aafat
Private
Joined: 1/6/2010(UTC)
Posts: 48
Location: Pakistan

If your talking about the Scripting/Add a command button to an object type drop down list so I didn't saw any square character in it I've checked it from up to down but if it's invisible how would I locate & delete it?
Offline Annihilationzh  
#12 Posted : Wednesday, January 27, 2010 12:41:49 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Put your cursor at the end of the word and press backspace twice. Then replace any letters that you deleted.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Offline Aafat  
#13 Posted : Wednesday, January 27, 2010 12:50:08 PM(UTC)
Aafat
Private
Joined: 1/6/2010(UTC)
Posts: 48
Location: Pakistan

Sorry Sad again but could you please help me with a screen shot?
Offline Annihilationzh  
#14 Posted : Wednesday, January 27, 2010 1:40:10 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Not really, a screenshot looks no different from posting the code.

This is what it should look like:

[???] Command button: 'Command_ConstructChinaVehicleSupplyTruck' is added to all objects of type 'Lazr_AmericaSupplyCenter' in slot number 2 (1-12).
[???] Command button: 'Command_UpgradeAmericaMOAB' is added to all objects of type 'Lazr_AmericaPowerPlant' in slot number 2 (1-12).
[???] Command button: 'Command_UpgradeGLAArmTheMob' is added to all objects of type 'Lazr_AmericaPowerPlant' in slot number 3 (1-12).

NOT this:

Command button: 'Command_ConstructChinaVehicleSupplyTruck
' is added to all objects of type 'Lazr_AmericaSupplyCenter' in slot number 2 (1-12).
Command button: 'Command_UpgradeAmericaMOAB
' is added to all objects of type 'Lazr_AmericaPowerPlant' in slot number 2 (1-12).
Command button: 'Command_UpgradeGLAArmTheMob
' is added to all objects of type 'Lazr_AmericaPowerPlant' in slot number 3 (1-12).

Edited by user Wednesday, January 27, 2010 1:41:20 PM(UTC)  | Reason: Not specified

If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Offline Aafat  
#15 Posted : Wednesday, January 27, 2010 3:24:44 PM(UTC)
Aafat
Private
Joined: 1/6/2010(UTC)
Posts: 48
Location: Pakistan

Well I did what you said & the button also appeared but that was unbuildable, I want a Troop Crawler in Laser General's Warfactory. This is the command I used

[???] Command button: 'Infa_Command_ConstructChinaVehicleTroopCrawler' is added to all objects of type 'Lazr_AmericaWarFactory' in slot number 2 (1-12)
Offline Annihilationzh  
#16 Posted : Wednesday, January 27, 2010 3:28:00 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Map>Modify>Adjust the tech tree for a specific object type

'Infa_ChinaVehicleTroopCrawler' becomes Buildable (Ignore_Prerequisites)

I mentioned this script in post #6.

Edited by user Wednesday, January 27, 2010 3:29:50 PM(UTC)  | Reason: Forgot the Infa_

If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Offline Aafat  
#17 Posted : Wednesday, January 27, 2010 5:57:16 PM(UTC)
Aafat
Private
Joined: 1/6/2010(UTC)
Posts: 48
Location: Pakistan

Thanx Annihilationzh Thumb Up

WoW! That really works for me now
Offline Galacticruler  
#18 Posted : Thursday, August 5, 2010 8:39:41 AM(UTC)
Galacticruler
Private
Joined: 8/5/2010(UTC)
Posts: 5

can someone help me add the nuke generals nuke silo to the boss general dozer and removing the original?
also adding the nuke gens migs and removing the normal migs from the boss gens airfield,removing raptors and stealth fighters from sw gen,adding the crusader and paladin to sw gen war factory and lastly,removing the original power plant adding the nuke gens power plant to the boss gen dozer?,im trying to make a map and cant get this to work.
Offline Annihilationzh  
#19 Posted : Thursday, August 5, 2010 12:20:18 PM(UTC)
Annihilationzh
General
Joined: 8/2/2008(UTC)
Posts: 1,779
United Kingdom

Thanks: 26 times
Was thanked: 475 time(s) in 331 post(s)
Upload your map and we'll take a look at it.
If you need help, post in the forum. You'll get help a lot faster than if you send me a PM.

I reject all buddy requests. I don't think 'buddy' needs to be made official. It's not like you're marrying me.
Offline Galacticruler  
#20 Posted : Friday, August 6, 2010 4:34:47 PM(UTC)
Galacticruler
Private
Joined: 8/5/2010(UTC)
Posts: 5

here it is
File Attachment(s):
Valley River Compstomp 3v3.rar (103kb) downloaded 16 time(s).
Users browsing this topic
Guest
2 Pages12>
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.