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

Notification

Icon
Error

Options
Go to last post Go to first unread
Offline joey55  
#1 Posted : Sunday, December 20, 2009 10:09:06 AM(UTC)
joey55
Major
Joined: 10/14/2009(UTC)
Posts: 173
Location: netherlands

Thanks: 1 times
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]UserPostedImage[\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 itWink
File Attachment(s):
command button tut.rar (11kb) downloaded 29 time(s).
you have to be a happy man, to be a happy man :)
Sponsor
Offline GeneralManF  
#2 Posted : Tuesday, April 13, 2010 10:26:59 AM(UTC)
GeneralManF
Captain
Joined: 2/11/2010(UTC)
Posts: 91
Canada

Thanks: 2 times
Was thanked: 1 time(s) in 1 post(s)
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.
File Attachment(s):
a general & his army (211111111111112).zip (70kb) downloaded 9 time(s).
Offline joey55  
#3 Posted : Wednesday, April 14, 2010 7:09:29 AM(UTC)
joey55
Major
Joined: 10/14/2009(UTC)
Posts: 173
Location: netherlands

Thanks: 1 times
GeneralManF wrote:
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.

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)

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

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 youSmile Smile
you have to be a happy man, to be a happy man :)
Offline Annihilationzh  
#4 Posted : Wednesday, April 14, 2010 8:51:56 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)
Quote:
in this code you are trying to add command buttons to a specific building,this requieres an ini

No it doesn't, see this thread:
http://www.cnclabs.com/f....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).


NOT this:

Code:
   Command button: 'AirF_Command_ConstructAmericaVehicleChinook
' is added to all objects of type 'ChinaSupplyCenter' in slot number  3  (1-12).)


This is extremely hard to explain, but I'm hoping everyone can understand.

Edited by user Wednesday, April 14, 2010 12:41:07 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.
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.