Jump to content
Sign in to follow this  
Miroslaw Kowalski

Need help with refining a Vehicle :)

Recommended Posts

Hello guys,

I'm working on a Dingo (I'm using the A2SampleModels) and now want to add some things that make it more beautiful. For example mirrors, collision lights and a camonet which can be hidden by the user.

So question/problem number one:

class RenderTargets
	{
		class LeftMirror
		{
			renderTarget = "rendertarget0";
			class CameraView1
			{
				pointPosition		= "PIP0_pos";
				pointDirection		= "PIP0_dir";
				renderQuality 		= 2;
				renderVisionMode 	= 4;
				fov 				= 0.7;
			}; 			
		};
};

I wrote this in my config and added the memoryPoints to the model but it looks like this: 201312230000qzpd2lse53.jpg

And number two:

How can I add collision lights to my vehicle?

And finally number three:

I wrote this in the model.cfg:

class camoNetHide
           {
               type = "hide";
               source = "user";
               selection = "camonet";
               hideValue = 1.0;
               unhideValue = 0.0;
               minValue = 0;   
               maxValue = 1;  
           };

and this in the config.cpp:

class UserActions : UserActions
	{
		class deploy_camo_net
		{
			userActionID = 80;
			displayName = "Deploy Camonet";
			displayNameDefault = "";
			position = "axis_speed";
			radius = 3.5;
			animPeriod = 2;
			onlyForPlayer = false;
			condition = "Alive (this)";
			condition = "this animationPhase ""camoNetHide"" > 0.5 AND Alive (this)";
			statement = "this animate [""camoNetHide"", 0];";
		};
		class undeploy_camo_net : deploy_camo_net
		{
			userActionID = 81;
			displayName = "Undeploy Camonet";
			condition = "Alive (this)";
			condition = "this animationPhase ""camoNetHide"" < 0.5 AND Alive (this)";
			statement = "this animate [""camoNetHide"", 1];";
		};
	};

but nothing happens...the action is there but I can't hide the net...

that's it....for now :D

Thanks in advance and Merry Christmas :)

Share this post


Link to post
Share on other sites

For the mirrors, have you UVMapped the surface into the UV Editor? It must be map. Imagine the texture you are using is the thing PiP camera is getting, so you can adjust the position of the mirror.

What do you mean with collision lights? Beacon lights? There is some info on the wiki about that If I don't remember bad.

And for the end, why do you have two conditions?

Share this post


Link to post
Share on other sites

Oh no forgot to do this will try it tomorrow :)

For the lights I mean the same as the planes and helicopters for example have...

And the two conditions...that's a mistake I made when pasting the code into my post...the second condition is the one I'm using :)

Thank you so far :D

Share this post


Link to post
Share on other sites

Buster, I'll take another look this afternoon. At the phone right now ;)

Share this post


Link to post
Share on other sites

Did you find something? If you hadn't enough time to look at it so far no problem ;) But I have another little problem :( (I think it's just one missing line in the config.cpp or model.cfg) I managed to add an MG to the car but the bullets are always being shot forward. So if i aim at the right the bullets will fly to the front... Here are the config.cpp and the model.cfg: config.cpp and the model.cfg

Thank you :)

Share this post


Link to post
Share on other sites

Sorry for the delay BusterBlader, already answered to your PM.

Taking a quick overview (as I'm on tapatalk with the phone) gonna try to give you some tips.

For the mirrors, I see your right side one is inverted. You have to go to the UV Editor, select the map for that mirror and flip it on the horizontal. Should be easy.

Then, taking a look at your configs for the hide/unhide, let's try those steps:

1.- Check selection name is "camonet" both in visual and in geometry LOD.

2.- Make sure axis_speed is set on your memory LOD.

3.- Try this config. I have remove some of the conditions, just for testing. I don't think you need the alive condition for that one.

class UserActions : UserActions 
       { 
           class deploy_camo_net 
           { 
               userActionID = 80; 
               displayName = "Deploy Camonet"; 
               displayNameDefault = ""; 
               position = "axis_speed"; 
               radius = 3.5; 
               animPeriod = 2; 
               onlyForPlayer = false; 
               condition = "8this animationPhase ""camoNetHide"") > 0.5"; 
               statement = "this animate [""camoNetHide"", 0];"; 
           }; 
           class undeploy_camo_net : deploy_camo_net 
           { 
               userActionID = 81; 
               displayName = "Undeploy Camonet"; 
               condition = "(this animationPhase ""camoNetHide"") < 0.5"; 
               statement = "this animate [""camoNetHide"", 1];"; 
           }; 
       };

But I think the actions are working for you... so the problem should be maybe on one of the two first steps or in the model.cfg. Cannot check it now, but make sure the camonet is under the SkeletonBones section and in the Sections part of the vehicle. Sorry but I cannot give more detail on that.

For the marker lights you were asking, you have the answer in the wiki:

Beacons consist of two parts on model side - emissive one and unlit one. The emissive one is hidden by default by an user controller and periodically hidden by time controller in model.cfg

Config contains only user actions to turn beacons off/on by hiding/unhiding them, this is inside class UserActions: UserActions

There should be two actions per beacons set - one to turn them off and other to turn them on, each as a subclass of UserActions


class UserActions: UserActions
		{
			class beacons_start
			{
				userActionID 			= 50;
				displayName 			= "Beacons start";
				displayNameDefault 		= "";
				position			= "mph_axis";
				radius				= 1.8;
				animPeriod			= 2;
				onlyForplayer			= false;
				condition			= "this animationPhase ""BeaconsStart"" < 0.5 AND Alive(this) AND driver this == player";
				statement			= "this animate [""BeaconsStart"",1];";
			};	
			class beacons_stop: beacons_start
			{
				userActionID 			= 51;
				displayName 			= "Beacons stop";
				condition			= "this animationPhase ""BeaconsStart"" > 0.5 AND Alive(this) AND driver this == player";
				statement			= "this animate [""BeaconsStart"",0];";
			};				
		};

You will need to create an emissive material for that part, shouldn't be so hard. I managed to make a full lightbar using hiddenselections and emissive materials so should't be hard to implement this for you.

About the MG, I haven't managed already to make any config for that kind of weapons, so I'm sorry I cannot help on that.

Share this post


Link to post
Share on other sites

Thank you :D I didn't even notice the mirror mistake :D The actions for hiding are working now but the camonet wont hide. I get an error saying something about a missing Animation Source. Maybe I have to add something in a AnimationSources class in the config?

How can I create an emissive Material?

For the MG I have an error in the .rpt. It says that it couldn't find the Body and the gun of the turret when initializing the model. I named them correctly.

Thanks again :)

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  

×