Jump to content
Sign in to follow this  
tachi

Can't add user action to turret

Recommended Posts

So i have this config:

class CfgVehicles
{
class Air;
class Helicopter: Air
{
	class Turrets;
	class HitPoints;
};
class Helicopter_Base_F: Helicopter
{
	class Turrets: Turrets
	{
		class MainTurret;
	};
	class HitPoints: HitPoints
	{
		class HitHRotor;
		class HitHull;
	};
	class AnimationSources;
	class Eventhandlers;
	class ViewOptics;
	class ViewPilot;
};
class UAV_01_base_F: Helicopter_Base_F
{
class Turrets: Turrets
{
		class MainTurret: MainTurret
		{
			class UserActions
			{
			        class utg_dlink_mark
				{
					displayName = "TEST";
					displayNameDefault = "TEST";
					priority = 3;
					radius = 20;
					position = "camera";
					showWindow = 0;
					onlyForPlayer = 1;
					condition = "alive this";
					statement = "test";
				 };
				 class utg_dlink_delete
				 {
					displayName = "TEST";
					displayNameDefault = "TEST";
					priority = 3;
					radius = 20;
					position = "camera";
					showWindow = 0;
					onlyForPlayer = 1;
					condition = "alive this";
					statement = "test";
				 };
			};
		};
	};
};
};

So what i want is i wanna add some actions attached to the turret of the UAV, so basically when player is gunner in the turret of UAV(taking control of the turret) it adds some actions to the action menu. In theory code above should be working, but it doesnt'

Share this post


Link to post
Share on other sites

Useractions are added at the vehicle class level; not the turret level. If you want it to be specific to a certain seat(turret) of the vehicle then you use a correct condition statement. Try this and let me know if it works:

class CfgVehicles
{
class Air;
class Helicopter: Air
{
	class Turrets;
	class HitPoints;
};
class Helicopter_Base_F: Helicopter
{
	class Turrets: Turrets
	{
		class MainTurret;
	};
	class HitPoints: HitPoints
	{
		class HitHRotor;
		class HitHull;
	};
	class AnimationSources;
	class Eventhandlers;
	class ViewOptics;
	class ViewPilot;
};
class UAV_01_base_F: Helicopter_Base_F
{
	class UserActions
	{
		class utg_dlink_mark
		{
		displayName = "TEST";
		displayNameDefault = "TEST";
		priority = 3;
		radius = 20;
		position = "camera";
		showWindow = 0;
		onlyForPlayer = 1;
		condition = "player == gunner this && alive this";
		statement = "test";
		};
		class utg_dlink_delete
		{
		displayName = "TEST";
		displayNameDefault = "TEST";
		priority = 3;
		radius = 20;
		position = "camera";
		showWindow = 0;
		onlyForPlayer = 1;
		condition = "player == gunner this && alive this";
		statement = "test";
		 };
	};
        class Turrets: Turrets
        {
		class MainTurret: MainTurret
		{

		};
	};
};
};

Share this post


Link to post
Share on other sites

Maybe players are considered drivers, try player == driver this. Or try removing that condition.

Share this post


Link to post
Share on other sites

This works:

class CfgVehicles
{
class Air;
class Helicopter: Air
{
	class Turrets;
	class HitPoints;
};
class Helicopter_Base_F: Helicopter
{
	class Turrets: Turrets
	{
		class MainTurret;
	};
	class HitPoints: HitPoints
	{
		class HitHRotor;
		class HitHull;
	};
	class AnimationSources;
	class Eventhandlers;
	class ViewOptics;
	class ViewPilot;
};
class UAV_01_base_F: Helicopter_Base_F
{
	class UserActions
	{
		class utg_dlink_mark
		{
			displayName = "Place Marker";
			displayNameDefault = "";
			priority = 3;
			radius = 1;
			position = "camera";
			showWindow = 0;
			onlyForPlayer = 1;
			condition = "true";
			statement = "[] execVM ""utg_dlink\mark.sqf"";";
		};
		class utg_dlink_delete
		{
			displayName = "Remove Marker";
			displayNameDefault = "";
			priority = 3;
			radius = 1;
			position = "camera";
			showWindow = 0;
			onlyForPlayer = 1;
			condition = "true";
			statement = "[] execVM ""utg_dlink\removemark.sqf"";";
		};
	};
    class Turrets: Turrets
    {
		class MainTurret: MainTurret{};
	};
};

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  

×