Jump to content
Vandeanson

addaction and passing on custom arguments

Recommended Posts

Hi all,

 

I am a bit lost here...

 

I am trying to pass on a custom argument (_actionIDx) from one addaction to the next:

However, the 2nd addaction returns a unknown variable _actionIDx and i can not find out what i am doing wrong.

 

Any ideas?

VD_Back should remove the action it was called from.

 

first addaction:

Spoiler

VD_Itembox addAction
[
    "Building Menue",
    {
        params ["_target", "_caller", "_actionId", "_arguments"];
        _actionIdx = _actionID;
        call VD_Back;
        [_caller] call VD_CraftingSUBMenue;

    //      _target removeaction _actionId

    },
    ["_actionIdx"],
    1.5,
    true,
    true,
    "",
    "true", // _target, _this, _originalTarget
    1,
    false,
    "",
    ""
];

 

the 2nd addaction 

 

Spoiler

  VD_Back = {

    _caller addAction
    [
        "Back",
        {
            params ["_target", "_caller", "_actionId", "_arguments"];
            _actionIdx = _this select 3 select 0;
          removeAllActions _caller;
        },
        [],
        1.5,
        true,
        true,
        "",
        "true", // _target, _this, _originalTarget
        1,
        false,
        "",
        ""
    ];};

 

 

Share this post


Link to post
Share on other sites

And put it in the arguments of the other action instead, the one in VD_Back that you call from the first.

  • Thanks 1

Share this post


Link to post
Share on other sites

thank you both, will implement accordingly!

will confirm once i was able to update the script

 

cheers

vd

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

×