Lightning gun -- help
Moderator: InsideQC Admins
27 posts
• Page 1 of 2 • 1, 2
Lightning gun -- help
Hi..
I'm trying to make a QuakeC-made LG without using builtin functions.
I've removed traceline, WriteByte, WriteEntity, and WriteCoord lines from W_FireLightning().
A little time ago, I've seen in slow-motion (host_framerate 0.001) the original one fires dozens of bolt2.mdl forward. And I've seen that they've avelocity_z set to some very high value. And I've noticed that the first bolt spins slower that the second, that spins slower than the third, and so on.
So, I need some help on how to make a QC made one, putting a bolt in front of another, limiting the distance of 600.
And removed after 0.2 seconds, and every frame pointing at the player's view angle like ezquake's fakeshaft.
Any ideas?
Thanks!
I'm trying to make a QuakeC-made LG without using builtin functions.
I've removed traceline, WriteByte, WriteEntity, and WriteCoord lines from W_FireLightning().
A little time ago, I've seen in slow-motion (host_framerate 0.001) the original one fires dozens of bolt2.mdl forward. And I've seen that they've avelocity_z set to some very high value. And I've noticed that the first bolt spins slower that the second, that spins slower than the third, and so on.
So, I need some help on how to make a QC made one, putting a bolt in front of another, limiting the distance of 600.
And removed after 0.2 seconds, and every frame pointing at the player's view angle like ezquake's fakeshaft.
Any ideas?
Thanks!
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
Just for curiosity: why are you trying to replicate the lightning beam in QuakeC ?
EDIT:
AFAIK this is just coincidence.
EDIT:
Orion wrote:A little time ago, I've seen in slow-motion (host_framerate 0.001) the original one fires dozens of bolt2.mdl forward. And I've seen that they've avelocity_z set to some very high value. And I've noticed that the first bolt spins slower that the second, that spins slower than the third, and so on.
AFAIK this is just coincidence.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
Ahh, I see. But you still need traceline() to determine if there's something in the way of your beam. Take a look at the original grappling hook code. It simulates a "chain" with spikes placed along the way between the axe and the spike. I suspect it's the nearest thing you'll get without custom builtins, though.
I know FrikaC made a cgi-bin version of the quakec interpreter once and wrote part of his website in QuakeC
(LordHavoc)
-

frag.machine - Posts: 2090
- Joined: Sat Nov 25, 2006 1:49 pm
I did it.
I've made a function that will spawn a bolt 32 units forward of each other, to make a line. The only problem is that the lightning goes through walls, I have a demo showing that.
And, 19 bolts reaches 608 units, because each bolt have 32 units of length. And the aiming is better, it's not exactly equal to fakeshaft, but the lightning looks more precise, each bolt have a touch function, and they're solid.
I've made a function that will spawn a bolt 32 units forward of each other, to make a line. The only problem is that the lightning goes through walls, I have a demo showing that.
And, 19 bolts reaches 608 units, because each bolt have 32 units of length. And the aiming is better, it's not exactly equal to fakeshaft, but the lightning looks more precise, each bolt have a touch function, and they're solid.
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
That's a weird way to do it. Just trace 600 units forward, and place bolts at 32 units from eachother until they reach trace_endpos, then stop, and just set their .think to SUB_Remove and .nextthink to time + 0.2, and damage whatever was hit by the traceline. Why'd you make them solid? I don't see any sense in not using traceline, since then you can't hit world geometry. You can hit entities without traceline, but not the world.
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
Take a look:
The bolts are SOLID_TRIGGER, which don't block the way of any entity. But I really should use traceline() to avoid going through walls.
- Code: Select all
void() BeamTouch =
{
if (other == self.owner)
return;
if (other.takedamage)
{
if (self.t_width < time)
{
particle (other.origin, '0 0 100', 225, self.dmg*4);
if (self.owner.classname == "player")
{
if (other.classname == "player")
other.velocity_z = other.velocity_z + 400;
}
T_Damage (other, self, self.owner, self.dmg);
self.t_width = time + 0.1; // don't do damage every frame
}
}
};
void(vector org, string bolt, float damage, float numbolts) ParseBeam =
{
local entity beam;
local float fwd;
fwd = 0;
while (numbolts > 0)
{
fwd = fwd + 32;
beam = spawn ();
beam.owner = self;
beam.movetype = MOVETYPE_FLY;
beam.solid = SOLID_TRIGGER;
beam.dmg = damage;
makevectors (self.v_angle);
beam.avelocity_z = 99999999;
beam.angles_x = self.v_angle_x * -1;
beam.angles_y = self.v_angle_y;
beam.angles_z = self.v_angle_z;
beam.touch = BeamTouch;
beam.nextthink = time + 0.1;
beam.think = SUB_Remove;
setmodel (beam, bolt);
setsize (beam, '0 0 0', '0 0 0');
setorigin (beam, org + v_forward*fwd);
numbolts = numbolts - 1;
}
};
The bolts are SOLID_TRIGGER, which don't block the way of any entity. But I really should use traceline() to avoid going through walls.
-

Orion - Posts: 476
- Joined: Fri Jan 12, 2007 6:32 pm
- Location: Brazil
27 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest