Jump to content
tom.machu

How to pass _caller (addAction) into a string in setWaypointStatements ??

Recommended Posts

Hi,

is there a way around it??

waitUntil { player inArea "evac" };
	player addAction 
	[
	"set up a radio",
		{
			params ["_target", "_caller", "_id", "_args"];
			[_target, _id] remoteExec ["removeAction"];
			_target = _this select 0;
			_caller = _this select 1;

    		private _trg3 = createTrigger ["EmptyDetector", (getPos _caller)];
			_trg3 setTriggerArea [25, 25, 0, false];
			_trg3 setTriggerActivation ["ALPHA", "NOT PRESENT", false];
			_trg3 setTriggerStatements ["this", "_caller sideChat 'we are ready'", ""];
			1 setRadioMsg "Call helicopter"; 
		}, 
		nil, 
		1, 
		true,
		true,
		"", 
		"true",
		5, 
		false,
		"", 
		""];

 

 

Share this post


Link to post
Share on other sites

one way could be first use setVariable

 

_trg3 setVariable ["caller",_caller];

 

then in statement:

 

thisTrigger getVariable "caller"

 

assuming you are using triggers and not waypoints

 

 

And assuming triggers can hold variables through setVariables. If not have to think something else

 

Edited by gc8

Share this post


Link to post
Share on other sites

Also because addAction runs on client you could just use the player variable

Share this post


Link to post
Share on other sites

An area, an addAction, a trigger, setWaypointStatements...

It seems to me overcomplicated.

Your addAction just need a condition like _this inArea yourArea or something about a waypoint completion (idk what you're doing with waypoints)

The addAction is already a menu. You don't need to add a radio trigger.

Share this post


Link to post
Share on other sites
On 10/1/2020 at 5:14 PM, gc8 said:

one way could be first use setVariable

 


_trg3 setVariable ["caller",_caller];

 

then in statement:

 


thisTrigger getVariable "caller"

 

assuming you are using triggers and not waypoints

 

 

And assuming triggers can hold variables through setVariables. If not have to think something else

 

Works just fine. Thank you!

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

×