turret style gun ignores maxyawoffset.

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
unmonitrd
Lance Corporal
Posts: 14
Joined: Fri Dec 26, 2003 5:47 pm

turret style gun ignores maxyawoffset.

Post by unmonitrd »

Hi all,

This is probably a mere question of syntax but after LOTS of trial & error I am stumped. The background is I am spawning an MG42 into a stock map. The positioning is fine, the gun operates ok, but I am unable to limit it's movement & range of fire. Look below the code for the different permutations I've tried.

Code: Select all

spawn "models/statweapons/mg42_bipod.tik" targetname "mg42_bipod" origin "544 2191 290" angles "0 -116 0"
	spawn "models/statweapons/mg42_gun.tik" targetname "mg42" origin "544 2191 290" angles "0 -116 0"

	local.neworigin = $mg42.origin + (0 0 15)
	$mg42_bipod.origin = local.neworigin
	$mg42.origin = local.neworigin

	$mg42.setplayerusable=1
	$mg42.pitchcaps ( -30 30 0 )
	$mg42.yawcenter= -116
	$mg42.maxyawoffset=49
I've tried:
spawning mg42_bipod_nonstatic instead
not setting the yawcenter and maxyawoffset to allow it to use the default value
using a positive value for yawcenter
entering pitchcaps, yawcenter, & offset in each combination of single variables & vectors
several different syntactical changes

and I suspect this will be a simple syntax mistake...but I figured I was just wasting time at this point, I better ask.

Thanks,
-unmonitrd
jv_map
Site Admin
Posts: 6521
Joined: Tue Sep 03, 2002 2:53 pm
Location: The Netherlands
Contact:

Post by jv_map »

$mg42.maxyawoffset=49

should be

$mg42 maxyawoffset 49
Image
unmonitrd
Lance Corporal
Posts: 14
Joined: Fri Dec 26, 2003 5:47 pm

Post by unmonitrd »

That got it. I knew it was me & my stoopid syntax.

Thanks (and you got back to me SOOOO fast!) :D
-unm
Post Reply