new years

Post your scripting questions / solutions here

Moderator: Moderators

Post Reply
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

new years

Post by ViPER »

any ideas on modding a pistol (or something) to shoot party favors (server side) for new years???
User avatar
bdbodger
Moderator
Posts: 2596
Joined: Tue Feb 25, 2003 7:34 am
Location: canada
Contact:

Post by bdbodger »

Why not use tltrude's fireworks from his pointer map .
Image
Rookie One.pl
Site Admin
Posts: 2752
Joined: Fri Jan 31, 2003 7:49 pm
Location: Nowa Wies Tworoska, Poland
Contact:

Post by Rookie One.pl »

Off the top of my head, but should work:

1. Use some mod to disable bazookas on your server.
2. Open your pistol TIKI, go to the server subsection in the init section and replace:

Code: Select all

		// Primary fire type info
		firetype		bullet
		ammotype		"pistol"
		meansofdeath	bullet
with:

Code: Select all

		// Primary fire type info
		firetype		projectile
		ammotype		"heavy"
		projectile		models/ammo/us_bomb.tik
Then, replace this:

Code: Select all

		// DM Attributes
		dmbulletcount	1
with this:

Code: Select all

		// DM Attributes
		dmprojectile	models/projectiles/bazookashell_dm.tik
Also, remove all bulletcount, dmbulletcount, bulletrange, dmbulletrange, firespreadmult, dmfirespreadmult, bulletdamage and dmbulletdamage lines.

3. Open models/ammo/us_bomb.tik and instert this init section before the animations section:

Code: Select all

init
{
	server
	{
		classname			Projectile
		anim idle
		setsize				"-4 -4 -4" "4 4 4"
		speed				1000 // adjust this speed here
		addownervelocity	0
		hitdamage			200 // whether you want it to cause damage or not?
		life				10.0 // or however long you want this to fly before exploding
//		health				50
//		takedamage				// uncomment these lines if you want it to take damage
		meansofdeath		rocket
		explosionmodel		models/fx/bazookaexplosion_dm.tik
		explodeontouch
		smashthroughglass 64
		knockback			300
		dlight 0.4 0.2 0.1 256 // red green blue radius

		commanddelay 0.17 drunk 0.12 0.12

		cache blastmark.spr
		cache models/fx/bazookaexplosion.tik
	}
}
And replace:

Code: Select all

	idle us_bomb.skc
with:

Code: Select all

	idle us_bomb.skc {
		entry exec global/fireworks.scr "trail"
	}
4. Open models/fx/bazookaexplosion.tik and under this line:

Code: Select all

			first explosioneffect bazooka
insert this one:

Code: Select all

			first exec global/fireworks.scr "explosion"
5. Make a global/fireworks.scr and put this into it:

Code: Select all

main local.arg:
	if (local.arg == "trail")
		goto trail
	if (local.arg == "explosion")
		goto explosion
end

trail:
	// self is the bomb projectile here
	self.scale = 0.5 // make the bomb smaller
	// insert your trail effects here - light, spawn smoke emitters, etc.
	self light 1 0 0 300
	local.smoke = spawn models/emitters/linger_smoke.tik
	local.smoke glue self
	while (isAlive(self))
		waitframe
	local.smoke delete
end

explosion:
	// self is the explosion here; keep in mind it gets removed in 0.1 second = 2 server frames, so store the origin if we want longer-lasting effects
	local.org = self.origin
	for (local.i = 0; local.i < 10; local.i++) {
		local.ent = spawn script_model model/fx/corona_red.tik origin local.org targetname "firework_light"
		local.ent light 1 0 0 400
		local.vec = ( -30 (randomint(360)) 0 ) // 30 degrees up
		local.vec = (angles_toforward local.angles) * 500 // 500 is the velocity here
		local.ent physics_on
		local.ent.velocity = local.vec
		local.ent playsound arty_leadinmp // you'll need to cache this sound!
	}
	wait 10 // how long do you want the lights to live
	$firework_light delete
end
6. Cache the arty_leadinmp* sounds and adjust the effects to your liking. :)

<EDIT>Come to think of it, you could just use the standard bazooka projectile, just adjust it properly and make sure the entry exec global/fireworks.scr command is in the idle animation. :)</EDIT>
Admin
Image
Image
Honour guide me.

here's my stuff - inequation.org | here's where I work - thefarm51.com
PKM
General
Posts: 1888
Joined: Tue Aug 09, 2005 4:43 pm
Location: Philadelpia but stuck in San Antonio TX (hell)

Re: new years

Post by PKM »

Viper wrote:any ideas on modding a pistol (or something) to shoot party favors (server side) for new years???
lol man i wish mru was throwing a new years mod contest also, that would win, hands down.
i'm not f****** angry, i'm from philadelphia .
Image
User avatar
ViPER
General
Posts: 1058
Joined: Fri Jan 14, 2005 5:48 pm
Location: California
Contact:

Post by ViPER »

Cool Rook ! Ill try if i have time.

I tried sparklers

Image
Post Reply