Turret Wars Line
16 years ago
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
UserPostedImage
Sponsor
Annihilationzh
16 years ago
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.
Turret Wars Line
16 years ago
So you mean it requires an INI file in the map? right?
UserPostedImage
Annihilationzh
16 years ago
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.
Art_in_MT
16 years ago
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.



Annihilationzh
16 years ago

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?

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.

*** 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.
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.
Art_in_MT
16 years ago
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.
Annihilationzh
16 years ago
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.
Aafat
  • Aafat
  • 89% (Honored)
  • Private
16 years ago
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).
Annihilationzh
16 years ago
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.
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.
Aafat
  • Aafat
  • 89% (Honored)
  • Private
16 years ago
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?
Annihilationzh
16 years ago
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.
Aafat
  • Aafat
  • 89% (Honored)
  • Private
16 years ago
Sorry 😞 again but could you please help me with a screen shot?
Annihilationzh
16 years ago
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).
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.
Aafat
  • Aafat
  • 89% (Honored)
  • Private
16 years ago
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)
Annihilationzh
16 years ago
Map>Modify>Adjust the tech tree for a specific object type

'Infa_ChinaVehicleTroopCrawler' becomes Buildable (Ignore_Prerequisites)

I mentioned this script in post #6.
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.
Aafat
  • Aafat
  • 89% (Honored)
  • Private
16 years ago
Thanx Annihilationzh 👍

WoW! That really works for me now
Galacticruler
15 years ago
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.
Annihilationzh
15 years ago
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.
Galacticruler
15 years ago
here it is   Valley River Compstomp 3v3.rar (103kb) downloaded 25 time(s).