Jump to content
Sign in to follow this  
eagledude4

User Actions and hidden selections

Recommended Posts

I made a sign with two hidden selections which would be triggered by the player.

class CfgVehicles {
class NonStrategic;	// External class reference

class TempLEDConstructionSignBase : NonStrategic {
	scope = public;
	vehicleClass = "MC_Objects";
	displayName = "Temporary Led Construction Sign";
	model = "mc_objects\signs\construction signs\temporary led sign\templedconstructionsign.p3d";
	armor = 9999;
	cost = 0;
	accuracy = 0.2;	// accuracy needed to recognize type of this target
	destrType = 0;
	mapSize = 0;
	class UserActions {
		class Left {
			showWindow = 0;
			hideOnUse = 1;
			displayName="Turn on left arrow";
			position="action";
			radius=0.10000;
			onlyForPlayer = 1;
			condition="(alive this)";
			statement="hiddenSelections[]={"Left"};";
		};
		class Right {
			showWindow = 0;
			hideOnUse = 1;
			displayName="Turn on Right arrow";
			position="action";
			radius=0.10000;
			onlyForPlayer = 1;
			condition="(alive this)";
			statement="hiddenSelections[]={"Right"};";
		};
	};		
	class eventhandlers {
		init = "_this allowDamage false;";
	};
};

class TempLedConstructionSignLeft : TempLEDConstructionSignBase {
	displayName = "Temporary Led Construction Sign (Left)";
	hiddenSelections[]={"Left"};
};

class TempLedConstructionSignRight : TempLEDConstructionSignBase {
	displayName = "Temporary Led Construction Sign (Right)";
	hiddenSelections[]={"Right"};
};
};

class TempLedConstructionSignLeft : TempLEDConstructionSignBase {
	displayName = "Temporary Led Construction Sign (Left)";
	hiddenSelections[]={"Left"};
};

class TempLedConstructionSignRight : TempLEDConstructionSignBase {
	displayName = "Temporary Led Construction Sign (Right)";
	hiddenSelections[]={"Right"};
};

What do I need to change to make this work?

Edited by eagledude4

Share this post


Link to post
Share on other sites

You are mixing static Config code with dynamic script code

statement="hiddenSelections[]={"Right"};";

Will never work.

Plus you seem to be working in an area thats half way between 2 lagitimate methods

The "hide a part of the model" animation method (ie hide 1 of 2 possible "faces" ),

and the "redefine faces with one of many custom textures"

Which one you aiming for?

Either way you still need a MODEL.CFG to go with your model too.

EDIT: you are in ArmA1 forum

Share this post


Link to post
Share on other sites

I knew that part was wrong, I just wanted to get my point across

I wish to go the "The "hide a part of the model" animation method".

I wanted to get an answer to this before I whiped up the model.cfg, but I guess I should do it now

I posted in this forum by mistake. I'll make a new thread in the right forum.

EDIT: Nvm, they locked the new thread >.>.

Edited by eagledude4

Share this post


Link to post
Share on other sites

Something like this. Untested

MODEL.CFG

class CfgSkeletons
{
   class Default;

class TAG_SignSkeleton: Default
{
	isDiscrete=1;
	skeletonInherit="";
	skeletonBones[]=
	{
		"NAMED-BIT-IN-MODEL",""
	};
};
};
class cfgModels
{
class Default
{
	sectionsInherit="";
	sections[]={""};
};

class My-Sign-p3d-filename : Default
{
	sectionsInherit="";
	skeletonName="TAG_SignSkeleton";
	sections[] = 		
	{
		"NAMED-BIT-IN-MODEL"
	};
	class Animations
	{
		class hideSignBit
		{
			type ="hide";
			source="UserHideBit";
			selection="NAMED-BIT-IN-MODEL";
			hideValue = 0.1;
		};
	};
};
};

CONFIG

class CfgVehicles {
class NonStrategic;	// External class reference
class TempLEDConstructionSignBase : NonStrategic {
	scope = public;
	vehicleClass = "MC_Objects";
	displayName = "Temporary Led Construction Sign";
	model = "mc_objects\signs\construction signs\temporary led sign\templedconstructionsign.p3d";
	armor = 9999;
	cost = 0;
	accuracy = 0.2;	// accuracy needed to recognize type of this target
	destrType = 0;
	mapSize = 0;
	class AnimationSources
	{
		class  UserHideBit
		{
			source = "user";
			initPhase=0;
			animPeriod = 0.0001;
		};
	};
	class UserActions {
		class Left {
			showWindow = 0;
			hideOnUse = 1;
			displayName="Turn on left arrow";
			position="action";
			radius=0.10000;
			onlyForPlayer = 1;
			condition="(alive this)";
			statement="this animate [""hideSignBit"", 1];";
		};
		class Right {
			showWindow = 0;
			hideOnUse = 1;
			displayName="Turn on Right arrow";
			position="action";
			radius=0.10000;
			onlyForPlayer = 1;
			condition="(alive this)";
			statement="this animate [""hideSignBit"", 0];";
		};
	};		
	class eventhandlers {
		init = "_this allowDamage false;";
	};
};
};

Share this post


Link to post
Share on other sites

Thanks Gnat, I think I got it now.

Edited by eagledude4

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  

×