Forum

Three Quake1 Questions?

Discuss programming in the QuakeC language.

Moderator: InsideQC Admins

Three Quake1 Questions?

Postby smd » Sun Sep 23, 2007 3:15 pm

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)
smd
 
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Postby Orion » Sun Sep 23, 2007 4:47 pm

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.
User avatar
Orion
 
Posts: 476
Joined: Fri Jan 12, 2007 6:32 pm
Location: Brazil

Postby smd » Sun Sep 23, 2007 7:38 pm

wow, thank u very much for your help !!!
smd
 
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Postby Urre » Mon Sep 24, 2007 6:10 am

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
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Re: Three Quake1 Questions?

Postby Error » Mon Sep 24, 2007 6:14 am

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.
User avatar
Error
InsideQC Staff
 
Posts: 865
Joined: Fri Nov 05, 2004 5:15 am
Location: VA, USA

Postby smd » Mon Sep 24, 2007 7:24 pm

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!! ???
smd
 
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Postby Dr. Shadowborg » Mon Sep 24, 2007 11:20 pm

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
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby FrikaC » Tue Sep 25, 2007 12:49 am

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;
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby smd » Tue Sep 25, 2007 5:56 am

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 !
smd
 
Posts: 26
Joined: Sun Sep 23, 2007 2:58 pm

Postby Sajt » Tue Sep 25, 2007 6:20 am

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.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Postby Urre » Tue Sep 25, 2007 6:50 am

How is that ugly? Aren't those kind of things what Quake modding is all about? :P
I was once a Quake modder
User avatar
Urre
 
Posts: 1109
Joined: Fri Nov 05, 2004 2:36 am
Location: Moon

Postby FrikaC » Tue Sep 25, 2007 3:27 pm

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).
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby Dr. Shadowborg » Tue Sep 25, 2007 6:41 pm

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.
User avatar
Dr. Shadowborg
InsideQC Staff
 
Posts: 1110
Joined: Sat Oct 16, 2004 3:34 pm

Postby FrikaC » Tue Sep 25, 2007 9:44 pm

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
FrikaC
Site Admin
 
Posts: 1026
Joined: Fri Oct 08, 2004 11:19 pm

Postby Sajt » Wed Sep 26, 2007 4:27 am

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.
Sajt
 
Posts: 1215
Joined: Sat Oct 16, 2004 3:39 am

Next

Return to QuakeC Programming

Who is online

Users browsing this forum: Bing [Bot] and 1 guest