Jump to content
Sign in to follow this  
drunken officer

360° turn

Recommended Posts

hi everybody.

I've a small problem. I create a object, where you can get in as gunner. In my buldozer i can turn arround 360°.

On map there is problem.

3rd person = Person (proxy) & Object turning together 360°. Thats what i want!

1st person = the person move is wrong and the eyes looks everytime in the same direction! Just the model is turning, but it looks like a wrong axis.

What i did:

model.cfg = turning selection called LTI

Oxygen:

Resolution LOD:

the object named "LTI"

proxy named "LTI"

Memory LOD:

axis definied

pos & pos dir named together "LTI"

creating a point called "eye" and "LTI"

GunnerView LOD

copy the body & proxy from resolution LOD.

Normlay all important things are called "LTI" to turn arround.

Share this post


Link to post
Share on other sites

Example in config.cpp

	class Turrets {
		class otocvez1 : NewTurret {
			animationSourceBody = "otocvez1";
			animationSourceGun = "otochlaven1";
			animationSourceHatch = "hatchGunner";
			body = "OtocVez1";
			canHideGunner = 1;
			castGunnerShadow = 1;
			commanding = -1;
			ejectDeadGunner = 0;
			forceHideGunner = 0;
			forceNVG = 0;
			gun = "OtocHlaven1";
			gunBeg = "usti hlavne1";
			gunEnd = "konec hlavne1";
			gunnerAction = "HMMWV_Gunner04";
			gunnerCompartments = "Compartment1";
			gunnerFireAlsoInInternalCamera = 1;
			gunnerForceOptics = 0;
			gunnerGetInAction = "GetInLow";
			gunnerGetOutAction = "GetOutLow";
			gunnerInAction = "MH60_Gunner";
			gunnerName = "Top gunner";
			gunnerOpticsColor[] = {0,0,0,1};
			gunnerOpticsEffect[] = {};
			gunnerOpticsModel = "\ca\Weapons\optika_empty";
			gunnerOpticsShowCursor = 0;
			gunnerOutFireAlsoInInternalCamera = 1;
			gunnerOutForceOptics = 0;
			gunnerOutOpticsColor[] = {0,0,0,1};
			gunnerOutOpticsEffect[] = {};
			gunnerOutOpticsModel = "";
			gunnerOutOpticsShowCursor = 0;
			gunnerUsesPilotView = 0;
			hasGunner = 1;
			hideWeaponsGunner = 1;
			inGunnerMayFire = 1;
			lockWhenDriverOut = 0;
			lockWhenVehicleSpeed = -1;
			LODTurnedIn = 1000;
			LODTurnedOut = 1000;
			weapons[]={"I44_MG15_mounted"};
			magazines[] = {"I44_75rd_792x57_Mix_MG15_aircraft","I44_75rd_792x57_Mix_MG15_aircraft","I44_75rd_792x57_Mix_MG15_aircraft","I44_75rd_792x57_Mix_MG15_aircraft","I44_75rd_792x57_Mix_MG15_aircraft","I44_75rd_792x57_Mix_MG15_aircraft","I44_75rd_792x57_Mix_MG15_aircraft"};
			maxHorizontalRotSpeed = 1.2;
			maxVerticalRotSpeed = 1.2;
			memoryPointGun = "usti hlavne1";
			memoryPointGunnerOptics = "gunnerview1";
			memoryPointGunnerOutOptics = "";
			memoryPointsGetInGunner = "pos_cargo";
			memoryPointsGetInGunnerDir = "pos_cargo_dir";
			initElev = 0;
			initTurn = 0;
			minElev = -20;
			maxElev = 70;
			minTurn = -180;
			maxTurn = 180;
			missileBeg = "spice rakety";
			missileEnd = "konec rakety";
			outGunnerMayFire = 1;
//				primary = 1;
			primaryGunner = 1;
			primaryObserver = 0;
			proxyIndex = 1;
			proxyType = "CPGunner";
			selectionFireAnim = "zasleh1";
			soundServo[] = {"",0.00316228,1};
			stabilizedInAxes = "StabilizedInAxesNone";
			startEngine = 0;
			turrentInfoType = "";
			viewGunnerInExternal = 1;
			viewGunnerShadow = 1;
			viewGunnerShadowAmb = 1;
			viewGunnerShadowDiff = 1;
//				class Turrets;				

			class ViewOptics {
				initAngleX = 0;
				minAngleX = -30;
				maxAngleX = 30;
				initAngleY = 0;
				minAngleY = -100;
				maxAngleY = 100;
				initFov = 0.6;
				minFov = 0.3;
				maxFov = 1.1;
			};
			class ViewGunner
			{
				initAngleX = 5;
				minAngleX = -85;
				maxAngleX = 85;
				initAngleY = 0;
				minAngleY = -150;
				maxAngleY = 150;
				initFov = 0.7;
				minFov = 0.42;
				maxFov = 0.85;
			};

		};
	};

Share this post


Link to post
Share on other sites

Thx Gnat.

I tried it with the class ViewGunner. Nothing! In first person, the model + body (gunner) is turning but not the eyes. I checked the sample files >> searchlight. My class is calling from searchlight class. The same problem.

In my memoryLOD there are

- 2 axis points

- gunner pos (and LTI-selection to turn around)

- pos dir (and LTI-selection to turn around)

- gunnerview (and LTI-selection to turn around)

- eye

It's doesnt matter if i delete "eye" or not, all time the same. I copy the whole config parts from the sample file and changed only the path to model, SAME problem, my eyes dont turn around.

Here my config

class CfgVehicles
{
class All;
class Strategic;
class Land;
class LandVehicle: Land
{
	class ViewPilot;
	class NewTurret;
};
class StaticWeapon: LandVehicle
{
	vehicleClass = "Static";
	//driverOpticsModel = "\ca\weapons\optika_empty";

	selectionClan = "clan";
	//selectionDashboard = "podsvit pristroju";
	//selectionShowDamage = "poskozeni";

	//selectionBackLights = "light_back";
	bounding = "usti hlavne";

	alphaTracks = 0.7;
	textureTrackWheel = 0;
	selectionLeftOffset = "";
	selectionRightOffset = "";
	memoryPointTrack1L = "";
	memoryPointTrack1R = "";
	memoryPointTrack2L = "";
	memoryPointTrack2R = "";

	selectionFireAnim = "zasleh";
	fireDustEffect = "FDustEffects";

	class DestructionEffects {};

	memoryPointMissile[] = {"spice rakety", "usti hlavne"};
	memoryPointMissileDir[] = {"konec rakety", "konec hlavne"};
	memoryPointCargoLight = "cargo light";
	gunnerCanSee = CanSeeEye+CanSeeEar+CanSeePeripheral;
	gunnerHasFlares = false;
	class Turrets
	{
		class MainTurret: NewTurret
		{
			memoryPointsGetInGunner= "pos_gunner";
			memoryPointsGetInGunnerDir= "pos_gunner_dir";
			memoryPointGunnerOptics= "gunnerview";
			memoryPointGun= "usti hlavne";
			outGunnerMayFire = 1;
			gunnerOpticsModel = \ca\Weapons\optika_empty;
			minTurn=-180; maxTurn=+180; initTurn=0;
			minElev=-7; maxElev=+70; initElev=0;
			castGunnerShadow = 1;
			ejectDeadGunner = 1;
			class ViewOptics
			{
				initAngleX=0; minAngleX=-30; maxAngleX=+30;
				initAngleY=0; minAngleY=-100; maxAngleY=+100;
				initFov=0.42; minFov=0.22; maxFov=0.64;
			};
		};
	};

	damperSize = 1.4;
	damperForce = .8;
	gearBox[]={-1,0,+1};

	soundEnviron[] = {"", db0, 0.7};
	soundEngine[] = {"", db20, 1};
	soundCrash[] = {"", db-5, 1};
	soundGear[] = {"", db-70, 1};
	soundDammage[] = {"", db-40, 1};
	getInAction=GetInMedium;
	getOutAction = GetOutMedium;

	class Wounds
	{
		tex[]={};
		mat[]={};
	};
	icon = iconTank;
	mapSize = 5;

	displayName=$STR_DN_TANK;
	nameSound="tank";
	accuracy=0.12;

	getInRadius = 3.5;

	fuelCapacity=0;

	irScanRangeMin=500;
	irScanRangeMax=4000;
	irScanToEyeFactor=1;

	armor=20;
	armorStructural=2.0;

	class HitEngine {armor=0.8;material=60;name=motor;passThrough=1;};
	class HitHull {armor=1;material=50;name=telo;passThrough=1;};
	class HitTurret {armor=0.8;material=51;name=vez;passThrough=1;};
	class HitGun {armor=0.6;material=52;name=zbran;passThrough=1;};
	class HitLTrack {armor=0.6;material=53;name=pas_L;passThrough=1;};
	class HitRTrack {armor=0.6;material=54;name=pas_P;passThrough=1;};


	extCameraPosition[]={0,1.5,-9};

	class ViewPilot: ViewPilot
	{
		initAngleX=7; minAngleX=-15; maxAngleX=+25;
		initAngleY=0; minAngleY=-90; maxAngleY=+90;
	};
	cost=1000000;

	steerAheadSimul=0.4;
	steerAheadPlan=0.6;

	predictTurnSimul=1.2;
	predictTurnPlan=1.8;

	hasGunner=1;
	hasCommander=0;
	ejectDeadDriver = 1;
	ejectDeadCargo = 1;
	hasDriver = 0;
	nightVision=0;

	driverAction = ManActCargo;
	driverInAction = ManActCargo;
	simulation=tank;

	// static weapons usually have no occlusion
	occludeSoundsWhenIn = db-0;
	obstructSoundsWhenIn = db-0;

	formationX=10;
	formationZ=10;
	precision=1;
	brakeDistance=0;

	maxSpeed=0;
	canFloat=0;
	weapons[]={FakeWeapon};
	magazines[]={FakeWeapon};
	type=1;
	threat[]={0.7, 1, 0.3};

	camouflage = 1;
	audible = 1;

	hideProxyInCombat = 0;

	driverOpticsColor[] = {0, 0, 0, 1};

	class CargoLight
	{
		color[] = {0, 0, 0, 0};
		ambient[] = {0.6, 0, 0.15, 1};
		brightness = 0.007;
	};
	transportMaxMagazines = 0;
	transportMaxWeapons = 0;
	class Reflectors {};
	secondaryExplosion=0;

};
//class SearchLight : staticWeapon {};
class LTI: staticWeapon
{
 		//vehicleClass = "Police_Items_VehicleClass";	
	scope = 2;
	side = 1;
	mapSize = 1;		
	icon = "iconStaticObject";
	model="\speedcamera2\LTI.p3d";
	picture="\speedcamera2\picture_icon_ca.paa";
	displayName = "modern Laserspeedgun";
	hiddenSelections[] = {"feld1","feld2","feld3"};				  
	   class EventHandlers
         {
              init = "_this execVM 'speedcamera2\scripts\speedgun.sqf'";
         };
	typicalCargo[]={SoldierWB};
	gunnerHasFlares = false;
	gunnerOpticsModel="\ca\Weapons\optika_Aimpoint";
	class Library {libTextDesc = "A speed check unique, based on laser technologie" };
	class Reflectors {};

	class Turrets : Turrets
	{
		class MainTurret : MainTurret
		{

			//weapons[]={LTI};
			minElev=-10;
			minTurn=-180; maxTurn=+180; initTurn=0;
			gunnerAction = "searchlight_Gunner";				

			class ViewGunner
               {
                   initAngleX = 0;
                   minAngleX =-360;
                   maxAngleX = 360;
                   initAngleY = 0;
                   minAngleY = 0;
                   maxAngleY = 0;
                   initFov = 0.7;
                   minFov = 0.42;
                   maxFov = 0.85;
               };
		};
	};

	};

};

Share this post


Link to post
Share on other sites

All the code before "class LTI: staticWeapon" is bad practice, you should not be "redefining" classes that already exist, just inheriting.

Your code should be more like this;

class CfgVehicles
{

class LandVehicle;
class StaticWeapon: LandVehicle
{
	class ViewGunner;
	class NewTurret;
};
class LTI: staticWeapon
{
 		//vehicleClass = "Police_Items_VehicleClass";	
	scope = 2;
	side = 1;
	mapSize = 1;		
	icon = "iconStaticObject";
	model="\speedcamera2\LTI.p3d";
	picture="\speedcamera2\picture_icon_ca.paa";
	displayName = "modern Laserspeedgun";
	hiddenSelections[] = {"feld1","feld2","feld3"};				  
	   class EventHandlers
         {
              init = "_this execVM 'speedcamera2\scripts\speedgun.sqf'";
         };
	typicalCargo[]={SoldierWB};
	gunnerHasFlares = false;
	gunnerOpticsModel="\ca\Weapons\optika_Aimpoint";
	class Library {libTextDesc = "A speed check unique, based on laser technologie" };
	class Reflectors {};
	class Turrets {
		class MainTurret : NewTurret
		{
			//weapons[]={LTI};
			minElev=-10;
			minTurn=-180; maxTurn=+180; initTurn=0;
			gunnerAction = "searchlight_Gunner";				

			class ViewGunner
               {
                   initAngleX = 0;
                   minAngleX =-360;
                   maxAngleX = 360;
                   initAngleY = 0;
                   minAngleY = 0;
                   maxAngleY = 0;
                   initFov = 0.7;
                   minFov = 0.42;
                   maxFov = 0.85;
               };
		};
	};

	};

};

Untested

As for the "eye" view ......

Only "gunnerview" is used as the eye's looking point.

But that point needs to have 2 other names also defined on it so it moves with the turret as one.

If you are using default definitions then I believe the point also needs to be named both "main1gun" and "main1turret".

Share this post


Link to post
Share on other sites

Been looking for something like this.

Great help.

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  

×