Three Quake1 Questions?

Discuss programming in the QuakeC language.
smd
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Three Quake1 Questions?

Post by smd »

hi!

i have 3 questions about q1!

1. what do i have to change that, when i gib a monster, all the bloody pieces dont disappear?

2. i have changed all my weapons to the right side, like in the dpmod, but when i shoot, the rockets nails & grenades dont appear in front of the guns, they are still in the middle of the screen. how can i fix that?

3. how can i add shell casings from the shotguns and nails stucking in the walls when i shoot with the nailguns?

i really hope someone can help... 8)
Orion
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Post by Orion »

Well, I can only answer the first 2 questions for you...

To make the bloody pieces don't disappear, open player.qc and find ThrowGib(), replace that whole function with this one:

Code: Select all

void(string gibname, float dm) ThrowGib =
{
	local	entity new;

	new = spawn();
	new.origin = self.origin;
	setmodel (new, gibname);
	setsize (new, '0 0 0', '0 0 0');
	new.velocity = VelocityForDamage (dm);
	new.movetype = MOVETYPE_BOUNCE;
	new.solid = SOLID_NOT;
	new.avelocity_x = random()*600;
	new.avelocity_y = random()*600;
	new.avelocity_z = random()*600;
	new.ltime = time;
	new.frame = 0;
	new.flags = 0;
};
Notice that I've removed the new.think and new.nextthink lines, that makes it disappear.

About the right side guns, open weapons.qc and scroll down to W_FireRocket(). Change the setorigin line to this:

Code: Select all

setorigin (missile, self.origin + v_forward*8 + '0 0 16' + v_right*9);
v_right will make the rocket spawn 9 units to the right.

Do the same with W_FireGrenade():

Code: Select all

setorigin (missile, self.origin + v_right*9);
Change launch_spike() in W_FireSuperSpikes():

Code: Select all

launch_spike (self.origin + '0 0 16' + v_right*9, dir);
Same with W_FireSpikes(), but a little different:

Code: Select all

launch_spike (self.origin + '0 0 16' + v_right*(9 + ox), dir);

Now the third question I don't know exactly... Maybe some other guy will help you.
smd
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Post by smd »

wow, thank u very much for your help !!!
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

There might be tutorials on this very site that can help you, but you really should consider removing entities such as the ones you describe, atleast after a while, since they'll eat memory and bandwidth, not to speak of the fact that you'll quickly hit the limit of 512 entities unless using an engine with upped limits or unlimited entities (such as darkplaces)
I was once a Quake modder
Error
InsideQC Staff
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA
Contact:

Re: Three Quake1 Questions?

Post by Error »

smd wrote: 1. what do i have to change that, when i gib a monster, all the bloody pieces dont disappear?
This could cause some problems with older computers and older engines.... packet overflows are not your friend. I'd recommend making a count for useless objects that're spawned, and when you get too many of them, start making the others disappear.
smd wrote: 2. i have changed all my weapons to the right side, like in the dpmod, but when i shoot, the rockets nails & grenades dont appear in front of the guns, they are still in the middle of the screen. how can i fix that?
Problem with that is the client's crosshair wouldn't be accurate at all. You could make you're own crosshair if you so pleased.
smd wrote: 3. how can i add shell casings from the shotguns and nails stucking in the walls when i shoot with the nailguns?
Again, packet overflow hell. Would add to the counter if I were you. Does add a touch of realism though.

Good luck on your mod, and ask again if you need anything else.
smd
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Post by smd »

thanks for your tips guys 8)

the gibbing work great, also do my right sided weapons!

only 1 little problem left:

the big lightning bold from the lightning gun !!!

have moved the little one, but i cant move the big one!! ???
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

smd wrote: only 1 little problem left:

the big lightning bold from the lightning gun !!!

have moved the little one, but i cant move the big one!! ???
You can't. Unless you use a custom engine. Oddly enough, iD made it such that entities other than the player can offset their bolts, but the player himself can't. O_o
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

umm. What? The little one I'm assuming is the model piece on the end of the gun viewmodel, you're talking about? The big one being the actual in engine lightning beam?

You most certainly can move that without modifying the engine.

look for:

Code: Select all

	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);
The org variable here is the start position of the beam, you can move it over by adding this before it (probably want to add it before the traceline too):

org = org + v_right * 9;
smd
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Post by smd »

Code: Select all

	org = self.origin + '0 0 16' + v_right*8;
	
	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);

	LightningDamage (self.origin, trace_endpos + v_forward*4, self, 30);
};

org = self.origin + '0 0 16' + v_right*8;

changed that for the little model piece!!!


can you please show me exactly what to change for the engine ligthning beam???

sorry im a n00b !
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

I think the engine automatically attaches the lightning beam to the person who fired it (as determined by the WriteEntity in there). Maybe that's only DarkPlaces though.

You could spawn a new entity to act as the origin of the lightning beam but that's kinda ugly...
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Urre
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon
Contact:

Post by Urre »

How is that ugly? Aren't those kind of things what Quake modding is all about? :P
I was once a Quake modder
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

Normal engines do not attach the beam to the entity. The entity parm is only for overriding an existing beam being fired by that entity. The start and end positions are the other parameters and ought to be followed. If LordHavoc fused it to the entity, then he just broke one of my mods (again).
Dr. Shadowborg
InsideQC Staff
Posts: 1120
Joined: Sat Oct 16, 2004 3:34 pm

Post by Dr. Shadowborg »

FrikaC wrote:umm. What? The little one I'm assuming is the model piece on the end of the gun viewmodel, you're talking about? The big one being the actual in engine lightning beam?

You most certainly can move that without modifying the engine.
o rly?

At long range in stock winquake, with org = self.origin + '0 0 16' + v_right*16;
http://tlb.quakedev.com/PICS/misc/lngvrx16a.jpg

At short range:
http://tlb.quakedev.com/PICS/misc/lngvrx16b.jpg

As for the separate entity method being ugly, I agree. For starters, whenever you shoot it up or down, it looks like you're shooting lightning from your eyes. And that's just for starters.

However, it is acceptable if you're going for a railgun.
FrikaC
Site Admin
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Post by FrikaC »

Dr. Shadowborg wrote: o rly?

At long range in stock winquake, with org = self.origin + '0 0 16' + v_right*16;
http://tlb.quakedev.com/PICS/misc/lngvrx16a.jpg

At short range:
http://tlb.quakedev.com/PICS/misc/lngvrx16b.jpg

As for the separate entity method being ugly, I agree. For starters, whenever you shoot it up or down, it looks like you're shooting lightning from your eyes. And that's just for starters.

However, it is acceptable if you're going for a railgun.
wtf
Sajt
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Post by Sajt »

FrikaC wrote:If LordHavoc fused it to the entity, then he just broke one of my mods (again).
It's a cvar. cl_lightningbeam_something probably.
Dr. Shadowborg wrote:whenever you shoot it up or down, it looks like you're shooting lightning from your eyes.
That's probably because you add '0 0 16'. Try origin + view_ofs - v_up * 6 or something.
F. A. Špork, an enlightened nobleman and a great patron of art, had a stately Baroque spa complex built on the banks of the River Labe.
Post Reply