Jump to content
vapour

Passing variables from Radio Trigger - issue

Recommended Posts

Hi fellow scripters

 

In a MP mission, I have a radio trigger placed down that runs a script to shift a respawn_west marker to the location of the unit that activated the radio trigger.

Normally, with an area trigger you would pass the 'unit' variable to the script by putting:

 

nul = [thisList select 0] execVM "scriptname.sqf"

 

in the 'ON ACTIVATION' box of the trigger, and then in the sqf file having something like:

 

_unit = (_this select 0);

 

What is occurring though with the radio trigger, is that it is obviously not receiving the unit's variable in the script. I get 'ERROR - UNDEFINED VARIABLE' when activating the trigger in mission.

 

Are radio triggers a little different from area triggers in this respect?

I'm assuming they either expect just one activator as opposed to many, thus may not use 'thisList', or are perhaps not recording any activator at all.

I have tried nul = [this select 0] execVM "scriptname.sqf" and nul = [this] execVM "scriptname.sqf", but to no avail. Still the same error.

 

Does any one have some bright ideas about where I may be going wrong?

Any help is much appreciated.

Share this post


Link to post
Share on other sites

whats your execVM'd script like? Yes radio trigger probably doesnt have thislist as its triggered by command and not by units.

 

sorry I cant help you no more but I cant recall what radio trigger passes in this variable. But if you put this on the onactivation line you will know:

diag_log format["OnActivation %1",this];

the string will be in your arma .rpt file.

Share this post


Link to post
Share on other sites

Thanks for the reply GC8!

That's a handy script snippet to have around.

 

The RPT file says: "OnActivation any" when a radio trigger is activated, so I'm guessing that means no variables being recorded by it.

 

 

Share this post


Link to post
Share on other sites

Thanks for the reply GC8!

That's a handy script snippet to have around.

 

The RPT file says: "OnActivation any" when a radio trigger is activated, so I'm guessing that means no variables being recorded by it.

 

then that means this variable is not available. and thislist is just empty array.

 

you can just use:

"respawn_west" setmarkerpos (getpos player);

to set the marker pos when trigger is activated, because player is always the activator.

 

Of course in MP the player would change, but if you just run this on client then it works..

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

×