Home   Help Search Login Register  

Author Topic: Basic addAction question  (Read 447 times)

0 Members and 1 Guest are viewing this topic.

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Basic addAction question
« on: 16 Oct 2004, 22:16:58 »
I am sure this is pretty basic but I can't find the answer.

When the action happens I want a script to run that has input arguments.  I have tried putting the following in the init field of the relevant unit:

this addaction["action name",{[arg1,arg2] exec "scriptname.sqs"}]

but it just tells me that:
script [arg1,arg2] exec "scriptname.sqs" does not exist.  I have tried different combinations of {} and " with similar results.  

All the example of addaction I can find are of the type:

this addactino["action name","scriptname.sqs"]

Is what I am trying to do possible?

Offline h-

  • OFPEC Site
  • Administrator
  • *****
  • Formerly HateR_Kint
    • OFPEC
Re:Basic addAction question
« Reply #1 on: 16 Oct 2004, 22:51:54 »
Quote
Is what I am trying to do possible?
yes...

You just need to execute a script with the addAction like in the example this addaction["action name","scriptname.sqs"], and that script then executes the 'real' script with the arguments...

afaik you can not pass arguments with addAction in any other way...
« Last Edit: 16 Oct 2004, 22:53:07 by HateR_Kint »
Project MCAR   ---   Northern Fronts   ---   Emitter 3Ditor
INFORMATIVE THREAD TITLES PLEASE. "PLEASE HELP" IS NOT ONE..
Chuck Norris can divide by zero.

Offline macguba

  • Former Staff
  • ****
    • macguba's operation flashpoint page
Re:Basic addAction question
« Reply #2 on: 16 Oct 2004, 23:39:11 »
For the avoidance of doubt, the addAction command passes the obvious arguments automatically.   I think the online comref has them.
Plenty of reviewed ArmA missions for you to play

Offline THobson

  • OFPEC Patron
  • Former Staff
  • ****
Re:Basic addAction question
« Reply #3 on: 17 Oct 2004, 10:01:33 »
Thanks.  I was using the method suggested by HateR_Kint .  I just hoped there was a more general way.

Thanks again