OFPEC Forum

Editors Depot - Mission Editing and Scripting => ArmA - Editing/Scripting General => Topic started by: JasonO on 26 May 2007, 18:56:59

Title: Variable in AddAction Name
Post by: JasonO on 26 May 2007, 18:56:59
Hi

Simple question, but to a difficult answer..

How can I use a variable in the AddAction Name?

I tried:
Code: [Select]
value = "value variable"
this addaction ["format ["%1",value]",script1.sqs]

No luck.. Any idea guys?

Cheers.
Title: Re: Variable in AddAction Name
Post by: Mandoble on 26 May 2007, 19:16:41
Looking at your example:

Code: [Select]
value = "value variable"
_actionname = format ["%1",value]
this addaction [_actionname,"script1.sqs"]

Am I missing something  :blink:
Title: Re: Variable in AddAction Name
Post by: Cheetah on 26 May 2007, 21:31:15
Seems like JasonO forgot to remove the " ", right now there would be a double string ("" with a string inside).

If it still doesn't work, I am missing something too.
Title: Re: Variable in AddAction Name
Post by: JasonO on 27 May 2007, 05:09:21
lol just finished playing with PHP and i've been writing things like stuff = "this";
I didn't copy and paste the variable line, only the addaction line so I quickly wrote it in my post... woops  :-[

I'll try what you've said tomorrow when I have access to my computer again. Thanks guys.