Home   Help Search Login Register  

Author Topic: Do you have any clue how to use these commands?  (Read 571 times)

0 Members and 1 Guest are viewing this topic.

pino

  • Guest
Do you have any clue how to use these commands?
« on: 13 Feb 2003, 09:49:27 »
Could someone give me an explanation and maybe an example how commands buttonAction and/or buttonSetAction work. If you know only either one of the commands, please explain only that one then.  I cant make anything out from command reference guides. Most of the commands are simple enough for me but these are a bit confusing.

Thanks a lot.

thedragon

  • Guest
Re:Do you have any clue how to use these commands?
« Reply #1 on: 13 Feb 2003, 12:50:35 »
these are some example:

unitName switchMove "effectstandsitdown"

that code makes the unit sit down
you can also type

unitName playMove "effectstandsitdown"

thats is the same code, but different command (like switchmove and playmove). you can also look in da command reference on this site: http://www.ofpec.com/editors/comref.php to find commands and more.

I hope this will help a bit :)

/thedragon

Pope_Zog

  • Guest
Re:Do you have any clue how to use these commands?
« Reply #2 on: 13 Feb 2003, 13:48:21 »
You should read Vectorboson's Dialog Tutorial. Although it doesn't actually show you how to use the two functions you're asking about, it'll show you how to create dialogs with buttons.

You can then change the action you've given a button with buttonSetAction or extract the script to be run when a button is clicked.

Example: Let's say you've defined a button in your description.ext with idc 100 (idc = the id number of the button control, can be any number) and you want to change the action it performs. You'd do this by calling:

buttonSetAction[100, "hint ""This is the new action - a hint!"""];

or you can make it call a script:

buttonSetAction[100, "player exec ""do_fancy_stuff.sqs"""];

If you'd later want to know what action is performed by the button, you can extract it by calling buttonAction:

the_action = buttonAction 100

If this is run after the last buttonSetAction, the_action would be the string:

player exec "do_fancy_stuff.sqs"


Hope this helps,

Pope Zog