this tutorial will explain how to script command buttons(=CB).
step1(quick way,go to step 2 for more detailed):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]
[\img]
=======
step2A: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'.
step2b: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'.
step2c: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'.
NOTE: the script condition(if(true))can be changed to anything.
======
step3safe 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