Better Thunderbolt

Inside3D
 • Front Page
 • Articles
 • Downloads
 • Forums
 • Hosting
 • Help Wanted
 • Interviews
 • Reviews
 • Staff

 
Allied Sites
 - AI Cafe
 - Bot Epidemic
 - Dark Places
 - Flat Earth
 - FrikBot
 - Ghoulish Art
 - Kilbert3D
 - Quake Info Pool
 - QSG: Quake Standards
 - Rusted Fork
 - Stroggs Gone Mad
 - More...
 
Quake
 - Getting Started
 - QuakeC Specs v1.0
 - QuakeC Tutorials
 - Quake Mod Index
 
Quake II
 - Getting Started
 - dll Sourcecode
 - Coding Tutorials
 
.dll Central
 - Getting Started
 - Learning
 - dll Primer
 - dll in C
 - dll in Delphi
 - Compilers
 
Jedi Knight
 - Getting Started
 - COG Specs
 - Sound Specs
 - Tutorials
 
Level Editing
 - Tutorials/Tips
 
 
Telefragged!!!
Created By: Marius
eMail: lordshoel@yahoo.com
Difficulty Scale: Easy


This tutorial is simple and will two two things to the lightning gun:
(1) Make it last longer/use less cells
(2) Make it a little weaker.
It is a much improved Lightning Gun which I like a lot myself.

Step 1.

Open up Defs.qc and scroll to the very bottom. Then add the following varible:

//Thunderbolt
.float temp_cells;
The above does not need to be at the bottom but it is easy and will not interfere with anything that might cause errors.
Step 2.

Ok open up Weapons.qc and scroll to the W_FireLightning function. Once there replace it with the following code:

void() W_FireLightning =
{
	local	vector org;
	local	float	cells;

	if (self.ammo_cells < 1)
	{
		self.weapon = W_BestWeapon ();
		W_SetCurrentAmmo ();
		return;
	}

// explode if under water
	if (self.waterlevel > 1)
	{
		cells = self.ammo_cells;
		self.ammo_cells = 0;
		W_SetCurrentAmmo ();
		T_RadiusDamage (self, self, 35*cells, world);
		return;
	}

	if (self.t_width < time)
	{
		sound (self, CHAN_WEAPON, "weapons/lhit.html", 1, ATTN_NORM);
		self.t_width = time + 0.6;
	}
	self.punchangle_x = -2;

	//This is Added
 	self.temp_cells = self.temp_cells + 1;
  	if (self.temp_cells == 3) 
  	{
    		self.currentammo = self.ammo_cells = self.ammo_cells - 1;
    		self.temp_cells = 0;  
    	}

	org = self.origin + '0 0 16';
	
	traceline (org, org + v_forward*600, TRUE, self);

	WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
	WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
	WriteEntity (MSG_BROADCAST, self);
	WriteCoord (MSG_BROADCAST, org_x);
	WriteCoord (MSG_BROADCAST, org_y);
	WriteCoord (MSG_BROADCAST, org_z);
	WriteCoord (MSG_BROADCAST, trace_endpos_x);
	WriteCoord (MSG_BROADCAST, trace_endpos_y);
	WriteCoord (MSG_BROADCAST, trace_endpos_z);

	//This is changed from 30 to 10. Mainly Because you will fire it 3 times at 10 for 
	//a cell rather than once per cell at 30 dmg
	LightningDamage (self.origin, trace_endpos + v_forward*4, self, 10); 
};

Step 3.

Save and Compile. Propably my simplest tutorial yet. Other energy weapons may be done like this for example a laser or plasma gun. Credit should also be give to Iikka Ker,nen for the temp_cells idea from his plasma gun. Marius






The Inside3D content and design is copyrighted by the Inside3D team, and may not be re-produced or copied without proper consent. All rights reserved. Any work credited to any author not part of InsideQC is copyrighted by that author. If you have any feedback, suggestions or flames please send it in to the author. Inside3D is hosted by telefragged and the design was originated by project-9.