Jump to content
Sign in to follow this  
NeoArmageddon

SetVariable in addaction-condition

Recommended Posts

Heyho,

I am trying to get a action working, with a getvariable-check in the conditionfield, but its seems that the condition is always "false" (or "AND Nil").

_veh setvariable["ATS_HasSatchel",true,true];
_veh addAction ["Deactivatel", "\scripts\detach.sqf", true, 9, 
 false, true, "", "(this getvariable 'ATS_HasSatchel')"];

I also tried _this instead of this and ""ATS_HasSatchel"" instead of 'ATS_HasSatchel'

I cant find anything about this in BIKI or forums.

Share this post


Link to post
Share on other sites

_target getVariable "ATS_HasSatchel"

From BIKI (addAction):

"condition: String - (optional, Arma 2 only, default:true) Code that must return true for action to be shown. Special variables "_target" (unit to which action is attached to) and "_this" (caller/executing unit) can be used in the evaluation."

Xeno

Share this post


Link to post
Share on other sites

Sry for hijacking your thread m8, but my question refers to your topic...

I can hardly remind, it was possible to set the distance to an object inside the addaction call.

Atm the addaction pops already 5m infront of the object.

I would like to change it to 1m only.

So wasnt there a condition to be set inside the addaction call?

I dont want to use a trigger with a "player distance object > n" condition.

Share this post


Link to post
Share on other sites

act = object addaction ["Teleport","teleport.sqf","",1,false,true,"","player distance object <=1"]

that worked for me last time I tried it.

Share this post


Link to post
Share on other sites

Cheerz buddy, gonna check it!

Thought there were a direct call.

But an array for condition do the job aswell.

Share this post


Link to post
Share on other sites

act = object addaction ["Teleport","teleport.sqf","",1,false,true,"","_this distance _target<=1"]

This would be much better, because it worked for every unit, not just object and player.

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
Sign in to follow this  

×