Posted by: joey55 - Sunday, December 20, 2009 10:09:06 AM
this tutorial will explain how to script command buttons(=CB).
[b]step1(quick way,go to step 2 for more detailed):[/b]open WB-->open a map-->place some units/buildings/waypoints-->give them a name
go to:edit script-->new script-->action if true-->edit-->unit-->command button-->choose 1 from the list-->fill it in-->safe and play.
[img][url=http://www.plaatjesupload.nl/bekijken/2201376.html][img]http://www.plaatjesupload.nl/bekijk/2009/12/20/1261332859-370.jpg[/img][/url][\img]
=======
[b]step2A:[/b]how to script a CB for aplying it on the unit/structure self,like selling a structure or the rocket pods upgrade on the airfield?
*place a structure for example the war factory name it and go to:edit script-->new script-->action if true-->edit-->unit-->command button-->pick:use commandbutton abilety-->fill in
[code]*** IF ***
True.
*** THEN ***
Unit 'war factory' use Ability 'Command_Sell'.[/code]
[b]step2b:[/b]how to use a CB on a unit/structure,like coll burtons knife abilety on a pilot?
*place 2 units for example coll burton and a pilot and name them and go to:edit script-->new script-->action if true-->edit-->unit-->command button-->pick:use commandbutton abilety on an object-->fill in
[code]*** IF ***
True.
*** THEN ***
Unit 'col burton' use Ability 'Command_ColonelBurtonKnifeAttack' on Unit 'pilot'.[/code]
[b]step2c:[/b]how to use a CB on a waypoint,like a command centers a10 strike on waypoint command abbilety?
*place a structure/unit and a wapoint on the map and name them and go to:edit script-->new script-->action if true-->edit-->unit-->command button-->pick:use commandbutton abilety on a waypoint-->fill in
[code]*** IF ***
True.
*** THEN ***
Unit 'command center' use Ability 'Command_A10ThunderboltMissileStrike' at Waypoint 'command abbilety'.[/code]
NOTE: the script condition(if(true))can be changed to anything.
======
[b]step3[/b]safe your map,if you have followed these steps it should work.
i have also attached a file(map)that you can play to see how it (should) work(s),on the grassy side of the road i coppied the buildings so you can practice by yourself in WB.
good luck and i hope this was usefull,if you have any questions let me know it[wink] [ATTACH]513[/Attach]
Posted by: GeneralManF - Tuesday, April 13, 2010 11:26:59 AM
Hi Joey! This is the file i was talking about with you. I started it off with everything I wanted changed in 1 script per faction. Then (I only got to USA) separated it into individual scripts. The file contains the USA full script if needed. And to test the map (BTW it's an AoD), set a computer player to GLA. [ATTACH]606[/Attach]
Posted by: joey55 - Wednesday, April 14, 2010 8:09:29 AM
[quote=GeneralManF]Hi Joey! This is the file i was talking about with you. I started it off with everything I wanted changed in 1 script per faction. Then (I only got to USA) separated it into individual scripts. The file contains the USA full script if needed. And to test the map (BTW it's an AoD), set a computer player to GLA.[/quote]
hmmm well how should i say..
the first code i saw was:
[code]command button: 'AirF_Command_ConstructAmericaDozer
' is added to all objects of type 'AmericaCommandCenter' in slot number 1 (1-12)[/code]
in this code you are trying to add command buttons to a specific building,this requieres an ini
or simply said some modding.
if you want this to work you should create a ini file and put something like this in it
[code]CommandSet AmericaCommandCenterCommandSet
1 = AirF_Command_ConstructAmericaDozer
2 = x
3 = x
4 = x
5 = x
6 = x
7 = x
8 = x
9 = x
10 = x
13 = x
14 = x
End[/code]
where in x you can contnue to add your own buttons(codes)
for more help with modding/ini files you should try asking a modder(just start a topic in the modding section) and im sure they will try to help you[smile] [smile]
Posted by: Annihilationzh - Wednesday, April 14, 2010 9:51:56 AM
[quote]in this code you are trying to add command buttons to a specific building,this requieres an ini[/quote]
No it doesn't, see this thread:
http://www.cnclabs.com/forums/default.aspx?g=posts&t=8971
EDIT Summary:
The ability to add command buttons has a bug. All entries in the drop down have an additional character (invisible in most PCs, a square in others) that are on the end and shouldn't be there. Remove this character & the code will work. To delete this character, put your cursor at the end of the word and press backspace. Then replace any letters that you deleted.
When you're done, in the Edit Action window, it should look something like this:
[code] Command button: 'AirF_Command_ConstructAmericaVehicleChinook' is added to all
objects of type 'ChinaSupplyCenter' in slot number 3 (1-12).[/code]
NOT this:
[code] Command button: 'AirF_Command_ConstructAmericaVehicleChinook
' is added to all objects of type 'ChinaSupplyCenter' in slot number 3 (1-12).)[/code]
This is extremely hard to explain, but I'm hoping everyone can understand.