Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
NightIntruder

Action accesible by pilot only, how to

Recommended Posts

Hi there,

I would like to create an action responsible for deploying/retracting landing lights in chopper. I need to limit accessibility of that action only to pilot. I wrote simple UserAction in config.cpp but it does not work (pilot does not see the action). Without the part of the code in red, the action is accessible but being outside the chopper only. Memory point "switch" is near the chopper's wolant in front of pilot so it shouldn't be a problem. Could anyone help me with this please?

class landing_lights_off
           {    
               displayName = "Retract landing lights";
               position = "switch";
               radius = 5;
               condition = "(this animationPhase ""landing_lights"" > 0.9)[color="#FF0000"] && (player == (driver this)) && (alive this)[/color]";
               statement = "this animate [""landing_lights"", 0];";
               onlyforplayer = 0;
               priority = 5;
               showWindow = 0;
           };
           class landing_lights_on
           {    
               displayName = "Deploy landing lights";
               position = "switch";
               radius = 5;
               condition = "(this animationPhase ""landing_lights"" < 0.5)[color="#FF0000"] && (player == (driver this)) && (alive this)[/color]";
               statement = "this animate [""landing_lights"", 1];";
               onlyforplayer = 0;
               priority = 5;
               showWindow = 0;
           };

EDIT:

I've solved the issue. Correct solution looks like below, and it seems that as you use condition "(player == driver this)" you do not need a memory point anymore (the one named "landlights" doesn't exist in my model btw, I just checked it to confirm that). Obviously, to have it working you need more staff like animated selection, reflectors linked with the selection etc.

                       class landing_lights_off
		{	
			displayName = "Retract landing lights";
			position = "landlights";
			radius = 8;
			condition = "(this animationPhase ""landing_lights"" > 0.5) AND (player == driver this)";
			statement = "this animate [""landing_lights"", 0]";
			onlyforplayer = 0;
			priority = 9;
			showWindow = 0;
		};
		class landing_lights_on
		{	
			displayName = "Deploy landing lights";
			shortcut = "";
			position = "landlights";
			radius = 8;
			condition = "(this animationPhase ""landing_lights"" < 0.5) AND (player == driver this)";
			statement = "this animate [""landing_lights"", 1]";
			onlyforplayer = 0;
			priority = 10;
			showWindow = 0;
		};

Intruder

Edited by NightIntruder
Solved

Share this post


Link to post
Share on other sites
Sign in to follow this  

×