Again the question: limit weapons by script ?

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Again the question: limit weapons by script ?

Post by mcunha98 »

Hi,

In some servers, like V2 ONLY SNIPER and OMAHA ONLY SNIPER, of course, is possible play only a weapon (SNIPER).

My question, is this possible by script/map maker or only for server start parameters ????

My idea is limit to sniper, remove pistols and decrease number of grenades (sample 2).

Another question, if is possible, have way to give a specific weapon to two sides (sample, Axis and Allies using only KAR98) ???

Remember: i'm say of maps to multiplayer !!!
User avatar
At0miC
General
Posts: 1164
Joined: Fri Feb 27, 2004 11:29 pm
Location: The Netherlands

Post by At0miC »

You should have to work with the weapons TIKs then.
You can find them in pak0/models/weapons/ (*.TIK)
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Post by mcunha98 »

At0miC wrote:You should have to work with the weapons TIKs then.
You can find them in pak0/models/weapons/ (*.TIK)
Ok, in past i see a reply like this.
But, i try copy the tik file to models/weapons folder in my pk3, but i dont have sucess using this method.

Exist a map/sample for i study ?
lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

No there's no example maps for study really, the easiest method is to copy all of your .TIK of your weapons (in Pak0>models>weapons) and change the dmstartammo value to 0. leave the snipers as usual of course. then just have the server put in that pk3 you've made and there will only be snipers, with ammo that is.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Post by mcunha98 »

Well,

We are try ?
First, based on Kar98.tik file i have some questions...

1) I need copy all .tik files to my folder, and change settings for your weapons, or only weapons i copy to my pk3 is "enabled" in DM ?

2) If for example, i direct my game to DM using only KAR98, a ALLIED soldier use this weapon automatic ?

3) The dmstartammo parameter its a number of bullets is this ? If is this, i change only to 0 (zero) all rest of weapons and ready !?!

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
	path models/weapons/KAR98
	skelmodel KAR98.skd
	surface KAR981 shader KAR98
	surface KAR982 shader KAR98
	surface material7 shader m1clip
	surface material8 shader m1clip
}

init
{
	server
		{
		classname		Weapon
		weapontype		rifle
		name			"Mauser KAR 98K"
		rank			220 220


		pickupsound		kar98_snd_pickup
		ammopickupsound	kar98_snd_pickup_ammo
		noammosound		kar98_snd_noammo

		// Primary fire type info
		firetype		bullet
		ammotype		"rifle"
		meansofdeath	bullet
		semiauto
		bulletcount		1
		clipsize		5
		startammo		5
		ammorequired	1
		firedelay 		1.2

		//========================================//
		//		WEAPON ACCURACY MODELLING	//
		//========================================//

//		Kar98K: Max Eff. Range is 400 yds with a muzzle velocity of 2650 ft/s. (7.92 x 57mm Mauser)

		bulletrange		4000	 		//the range at which bulletspread is applied
		bulletspread	8 8 65 65 		//minpitch minyaw maxpitch maxyaw
		bulletdamage	75

		tracerfrequency 	2 //original 0

		crosshair		1
		airange			long
//		viewkick		-2 -3   -1 1

		// AI animation group info
		weapongroup		rifle

		// DM Attributes
		dmbulletcount		1
		dmstartammo			200
		dmammorequired		1
//		dmfiredelay			1.45
		dmfiredelay			1.1

		dmbulletrange		4000
		dmbulletspread		2 2 65 65
//		dmbulletdamage		110	//original 75
//		dmbulletdamage		115	//original 75
//		dmbulletdamage		106 // this makes it the same as a sniper rifle
		dmbulletdamage		90 // had to reduce the damage since it fires about twice as fast as the sniper rifles
		dmmovementspeed		0.94

		dmcrosshair			1

		surface material7 +nodraw
		surface material8 +nodraw
		
		// this is attached to the player during reload
		cache models/ammo/kar98_clip_reload.tik
	}
	client
	{
		cache tracer.spr
		cache muzsprite.spr
		cache models/fx/snipesmoke.tik
		cache models/ammo/rifleshell.tik
	}
}

animations
{
	idle		KAR98.skc
	{
		server
		{
			entry surface material7 +nodraw
			entry surface material8 +nodraw
		}
	}
//	reload	reload_KAR98.skc
	reload	reload_KAR98.skc // this is the start of the reloading sequence
	{
		client
		{
			entry sound kar98_snd_reload item
		}
		server
		{
			entry surface material7 +nodraw
			entry surface material8 +nodraw
			43 surface material7 -nodraw
			43 surface material8 -nodraw
			53 surface material7 +nodraw
			62 surface material8 +nodraw
			last surface material7 +nodraw
			last surface material8 +nodraw
			last idle
		}
	}
	reload_single KAR98.skc // this is the reload loop that loads in a single shell
	{
		client
		{
			entry sound kar98_snd_reload_single item
		}
	}
	reload_end KAR98.skc
	{
		server
		{
			last idle
		}
		client
		{
			entry sound kar98_snd_reload_end item
		}
	}
	rechamber	rechamber_kar98.skc
	{
		client
		{
			entry sound kar98_snd_bolt item
			18 tagspawn tag_eject 1024
			(
				spawnrange 2048
				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
			)
		}
	}
	fire		KAR98.skc
	{
		server
		{
			entry shoot
			entry surface material7 +nodraw
			entry surface material8 +nodraw
		}
		client
		{
			entry stopaliaschannel kar98_snd_fire
			entry sound kar98_snd_fire

			// By now, the server has already fired the weapon, so it's
			// ok to apply the view kick apon entry to avoid problems
			// with multiple application on single frame animations.

			////////////////////////////////////////////////////////////////////////////////////////
			// View Kicking
			//
			// View Kicking works based on the assumptions that every weapon has its own tendencies to kick in
			// a paticular fashion. In MOH we call then scatter patterns. Currently we have 2 scatter patterns which
			// will be explained.
			// Scatter Patterns:
			// "V" - the cone. The longer you shoot the more random your shots will be in the horizontal axis.
			// "T" - the T shape. The gun has a tendancy to push in a paticular direction.
			//
			//
			//             		+-------------------------------------------- Scatter Pitch Min
			//              		|    +--------------------------------------- Scatter Pitch Max
			//              		|    |       +------------------------------- Scatter Yaw Min
			//             		|    |       |   +--------------------------- Scatter Yaw Max
			//             		|    |       |   |     +--------------------- The Recentering speed in fraction per second
			//              		|    |       |   |     |    +---------------- The Scatter Pattern
			//              		|    |       |   |     |    |     +---------- The absolute pitch min/max
			//              		|    |       |   |     |    |     |  +------- The absolute yaw min/max
			//              		|    |       |   |     |    |     |  | +----- This is the pitch at which you loose all
			//              		|    |       |   |     |    |     |  | |      control of the weapon and its behavior is
			//             	 	|    |       |   |     |    |     |  | |      purely random.
			//				V    V       V   V     V    V     V  V V
			entry viewkick 	    -3.5 -4.0    -1.0 -1.05 2.5  "T"   5.0 2.0 5

//			entry viewkick 	    -1.2 -1.2    -0.2  0.2   1   "V"   3.0 1.0 1.6 (Colt .45 Pistol)

//			entry viewkick -3.5 -4.0   -1.0 1.0 (old)

			// muzzle flash
			entry tagdlight tag_barrel 0.25 0.2 0.15 150 0.11
			entry tagspawn tag_barrel
			(
				model muzsprite.spr
				count 1
				alpha .5
				color 1.00 1.00 1.00
				varycolor
				scale 0.70
				life 0.05
				scalerate 1.00
				velocity 4.00
				friction 3.00
				fade
				alignstretch 1.00
				randomroll
			)
			entry tagspawn tag_barrel
			(
				model muzsprite.spr
				count 1
				alpha .5
				color 1.00 1.00 1.00
				scale 0.60
				life 0.05
				scalerate 0.70
				velocity 17.00
				offsetalongaxis 5 0 0
				fade
				alignstretch 0.40
				randomroll
			)

			entry tagspawn tag_barrel
			(
				model muzsprite.spr
				count 1
				alpha .5
				color 1.00 1.00 1.00
				scale 0.60
				life 0.05
				velocity 18.00
				offsetalongaxis 9 0 0
				fade
			)

			// smoke puff used on sniper version of kar98
			entry commanddelay 0.020 tagspawn tag_barrel
			(
				spawnrate 1.00
				model vsssource.spr
				//count 1
				alpha 0.10
				color 1.00 1.00 1.00
				spritegridlighting
				scale 0.09
				life .9
				scalerate 23.00
				velocity 429.00
				accel 0.00 20.00 30.00
				friction 2.00
				fade
				offsetalongaxis random 4 0 0
			)

			entry tagspawn tag_barrel
			(
				count 1
				scale .7
				model models/fx/snipesmoke.tik
			)
		}
	}
}

/*QUAKED playerweapon_german_kar98 (0.0 0.0 1.0) (-8 -8 -8) (8 8 8)
German rifle - Mauser KAR98.
*/

lizardkid
Windows Zealot
Posts: 3672
Joined: Fri Mar 19, 2004 7:16 pm
Location: Helena MT

Post by lizardkid »

i'll run through it a little clearer, my last post was a bit unclear.

1. Take all your weapon's .tik files and place them somewhere else, when i mod my weapons i place them in My Documents

2. individually open each one and find this line

Code: Select all

dmstartammo
afterwards there will be a number. on all the weapons but the sniper rifles, change that number to 0.

3. place all the modified weapon .tik files into a new folder named weapons. place that one into another folder called models. then put the models folder into a pk3, call it whatever you want, jsut make sure it's a pk3.

4. put the finished pk3 into your main folder of MOHAA.

now whenever a server has this pk3 in it, all players will start with a normal sniper, else they will have no ammo.
Moderator

۞
Abyssus pro sapientia
Olympus pro Ignarus
۞

AND STUFF™ © 2006
User avatar
mcunha98
Lieutenant Colonel
Posts: 384
Joined: Sat Jan 17, 2004 1:52 am
Location: Brasil
Contact:

Post by mcunha98 »

YESSSSSSSSSSSSSSSSSSSSSSSSSSS !
Work !

I change :

All weapons to 0
Grenades to 2
Kar Scoped and M1-Garand Scoped to 100 (max is 95)

I try and work !

My unique question is i need copy only .tik files to pk3 or your structure (my file now have 1.4mb before have 700kb) ?
Post Reply