Home   Help Search Login Register  

Author Topic: addaction arguments  (Read 701 times)

0 Members and 1 Guest are viewing this topic.

Leech

  • Guest
addaction arguments
« on: 06 Sep 2004, 05:19:52 »
Ok normally you call a script [arguments] exec "script.sqs"
When using addaction command you use:
actionid=unit addaction["actiontext","actionscript"]
But theres no place to pass the arguments to the script.  I guess i could do it with 2 scripts but is it possible to pass them through the editor??

Offline dmakatra

  • Members
  • *
  • Better known as Armsty
Re:addaction arguments
« Reply #1 on: 06 Sep 2004, 07:34:03 »
Hmmm... Try the format command.

:beat: *Gets Shot* :beat:

Korax

  • Guest
Re:addaction arguments
« Reply #2 on: 06 Sep 2004, 08:41:25 »
You cant pass arguments via addaction, but 3 arguments are already passed automatically.
(_this select 0) - the unit with the action
(_this select 1) - the unit that pressed the action
(_this select 2) - the action index #

RonMcAsskick

  • Guest
Re:addaction arguments
« Reply #3 on: 19 Oct 2004, 13:48:52 »
best way is if the action script just makes a variable true and the script that adds the action checks whether the action is/should be present and awaits the truth of the variable to goto a function which is what you want the action to do, that way you can define any variables locally in the script.  I will release an example as soon as my rappel script is allowed to be made public by the guy who commisioned it

if you need any help give me a msg : Feliix1956@hotmail.com

Ron

Offline Triggerhappy

  • Contributing Member
  • **
  • Llama, it's what's for dinner.
Re:addaction arguments
« Reply #4 on: 29 Oct 2004, 04:58:03 »
i am tired right now so i'm not sure if this is what ron said but just make a seperate script for the "actionscript" that calls the script that needs arguments, of couse, this can be confusing for others if you are planning on releasing the action (not with a mission) but if its going to be used just in your mission it will work fine

ex.:
actionid=unit addaction["actiontext","redirect.sqs"]

Redirect.sqs
Code: [Select]
[arguments] exec "actionscript.sqs"
« Last Edit: 29 Oct 2004, 05:03:05 by Triggerhappy »