MG42 to Sniper

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

MG42 to Sniper

Post by SilentAngel »

Is possible to change the mg42 to a sniper rifle?
I've been trying for a while but without good results...
I mean:
- add the scope
- ammo damage as a S.rifle
- a pause after every shoot af a second as the sniper do

for the first I tryied this: zoom 20 but don't work
for the second: dm bulletdamage 100 (I don't remember if it worked)
for the last point: I have no idea...lol
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post by Aprop »

Cant ya simple replace tikis?
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

what you mean with replace tik?
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Post by HeavenBound »

like in pak6 models/statweapons/mg42_gun.tik

:wink:
HeavenBound

I'm new at this :)
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

but then I'll have a sniper rifle instead of a mg42, what I trying to make is a mg42 with a zoom and a shoot time delay as a sinperrifle..
it would be a beautiful MG42_SniperRifle! lol
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Post by HeavenBound »

Just edit the settings in the tik lol. Give it a scope and set the delayed shots and the dmdammage or w/e it is
HeavenBound

I'm new at this :)
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

I tried to set zoom and delay but nothing changed!
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Post by HeavenBound »

Just Ask Sor, He knows everything. =\


:lol:
Last edited by HeavenBound on Mon Apr 27, 2009 7:00 pm, edited 4 times in total.
HeavenBound

I'm new at this :)
Aprop
Major
Posts: 291
Joined: Mon Nov 17, 2008 3:40 pm

Post by Aprop »

let class turretgun and anims stay, change rest...


Heaven, he should edit dmfiredelay....
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

for the first I tryied this: zoom 20 but don't work
for the second: dm bulletdamage 100 (I don't remember if it worked)
for the last point: I have no idea...lol
that's what I did but without good results!
however I'll try again..maybe I've made some errors when writing
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Perhaps try:
1)

Code: Select all

zoom 20
zoomspreadmult 0.055
crosshair 1
dmcrosshair 1
dmzoomspreadmult 0.055
2)

Code: Select all

bulletdamage 100
dmbulletdamage 106
3)

Code: Select all

firedelay 1.74
dmfiredelay 2.0
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

I tried this:

Code: Select all

TIKI
setup
{
	//scale 0.52			// Set default scale to 16/30.5 since world
						// is in 16 units per foot and model is in cm's
	scale 0.52
	path models/statweapons/mg42
	skelmodel mg42.skd
	surface mg421 shader mg42
	surface mg422 shader mg42

}

init
{
	server
	{
		classname		TurretGun
		weapontype		mg
		name			"MG42"

		// turret settings
		idleCheckOffset	"-56 0 0"
//		viewOffset		"-32 0 8"
		viewOffset		"-42 0 10"
		viewjitter		0.75

		// Primary fire type info
		firetype		bullet
//		ammotype		"MG"
		meansofdeath	bullet
		bulletcount		1
//		clipsize		20
//		startammo		20
//		ammorequired	1
//		ammorequired	0
		usenoammo		1
		firedelay		0.06
                                      zoom 20 
		zoomspreadmult 0.055 
		crosshair 1 
		dmcrosshair 1 
		dmzoomspreadmult 0.055 
		bulletrange		4000
		bulletdamage 100 
		dmbulletdamage 106
		bulletspread	40 40
//		tracerfrequency 5
		tracerfrequency 3 // to compensate for the slower fire rate

		// AI animation group info
		weapongroup		mg42

		// DM Attributes
		dmbulletcount		1
		dmfiredelay		0.06
		firedelay 1.74 
		dmfiredelay 2.0
		dmbulletrange		4000
		dmbulletdamage	45
		dmbulletspread	40 40
	}
	client
	{
		cache muzsprite.spr
		cache models/fx/muzflash.tik
		cache models/ammo/rifleshell.tik
	}
}


animations
{
	idle	mg42.skc
	fire	mg42fire.skc
	{
		server
		{
			entry shoot
		}
		client
		{
			entry stopaliaschannel mg42_gun_snd_fire
			entry sound mg42_gun_snd_fire

			// muzzle flash
			entry tagdlight tag_barrel 0.25 0.2 0.05 140 0.11
			entry tagspawn tag_barrel
			(
				spawnrange 4096
				scale 0.4
				offsetalongaxis 1.5 0 0
				count 1
				model muzsprite.spr
				angles 0 0 crandom 25
				life 0.06
			)
			entry tagspawn tag_barrel
			(
				spawnrange 4096
				count 1
				scalemin 0.9
				scalemax 1.1
				model models/fx/muzflash.tik
				randomroll
				life 0.04
			)

			// shell eject
			entry commanddelay 0.1 tagspawn tag_eject
			(
				spawnrange 1024
				count 1
				model models/ammo/rifleshell.tik
				scale 1.0
				velocity 70
				randvel crandom 10 crandom 10 random 20
				emitterangles 0 0 0
				avelocity crandom 90 crandom 90 0
				accel 0 0 -800
				physicsrate 20
				life 2.0
				fadedelay 1.7
				collision
				bouncefactor 0.2
				bouncesoundonce snd_rifle_shell
			)

			// smoke puff
			entry tagspawn tag_barrel
			(
				spawnrate 1.00
				model vsssource.spr
				alpha 0.30
				color 1.00 1.00 1.00
				scale 0.10
				life 1.00
				scalerate 10.00
				velocity 65.00
				randvel range 20 -60 crandom -40 range 20 -60
				friction 7.00
				fade
				randomroll
			)
		}
	}
}

/*QUAKED turretweapon_german_mg42 (0.5 .25 0.25) (-8 -8 0) (8 8 16) FAKEBULLETS
MG42 gun turret
*/
And it doesn't work..it's possible that statew. cannot have zoom?!
$oldier Of Ra
Lieutenant Colonel
Posts: 404
Joined: Sun Oct 16, 2005 7:16 pm
Location: Belgium
Contact:

Post by $oldier Of Ra »

Indeed. I tried and it works if you add this to any other weapon's tik file:

Code: Select all

      zoom 20
      zoomspreadmult 0.055
      dmzoomspreadmult 0.055 
But it doesn't work with statweapons. :(
Our official website: http://www.mohaairborne.co.cc
(Still accessible through http://mohaaclantb.tk and http://users.skynet.be/mohaaclantb/)

For all your bot needs!!!!

$oldier Of Ra.
SilentAngel
Captain
Posts: 239
Joined: Wed Mar 12, 2008 8:27 pm

Post by SilentAngel »

:cry: my dreams broken by a creazy stateweapon!..what a sadness :cry:
HeavenBound
Colour Sergeant
Posts: 85
Joined: Thu Sep 11, 2008 12:55 am

Post by HeavenBound »

Muahaha the MOHAA gods hate you!!! :lol: :lol:
HeavenBound

I'm new at this :)
Post Reply