Scripted weapons not turning correctly

Topics regarding Scripting with Reality Factory
Post Reply
User avatar
darksmaster923
Posts: 1857
Joined: Wed Jan 03, 2007 10:32 pm
Location: Huntington Beach, California, USA
Contact:

Scripted weapons not turning correctly

Post by darksmaster923 » Sat Sep 27, 2008 5:58 am

I dunno why this happens, it worked previously before, unless there is something new in 76 that I have to change to get it to work. Basically, the arms do not rotate its yaw at all.

Code: Select all

{
	offsetX			[-2]
	offsetY			[-5]
	offsetZ			[10]
	offsettemp		[0]
	camerapitch		[0]
	camerapitchtemp		[0]
	reloaded		[false]
	bullets			[0]

	DAMAGEATTRIBUTE		[hp]
	CURRENTWEAPON		[0]
	WEAPONTOCHANGE		[null]

	dryfire			[weapon\dry.wav]
	fired			[false]




	Spawn[ ()
	{
		Console(true);
		Gravity(false);
		SetNoCollision();
		LowLevel("setup");
	} ]


	setup[ ()	//main func
	{
		self.yaw_speed = 1000;
		self.pitch_speed = 1000;
		pos();
		setkeys();

	} ]

	setkeys[ ()	//clears var
	{
		if(self.lbutton_pressed = false and (IsKeyDown(17) = false))
		{
			fired = false;
			reloaded = false;
		}
	} ]

	pos[ ()		//setup position for gun
	{
		camerapitchtemp = self.camera_pitch*10;
		camerapitch = self.camera_pitch*11;	//for Z
		if(GetEventState("crouch") = false)
		{
			PositionToPawn("player",offsetX,71+offsetY+camerapitchtemp,offsetZ+camerapitch,true,false);	// setup angles and pos
		}
		else
		{
			PositionToPawn("player",offsetX,36+offsetY+camerapitchtemp,offsetZ+camerapitch,true,false);	// setup angles and pos
		}
		self.ideal_yaw = self.player_yaw;
		ChangeYaw(); 

		self.ideal_pitch = self.camera_pitch;	
		ChangePitch();
	} ]


}
Herp derp.

Post Reply