View previous topic :: View next topic |
Author |
Message |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Wed Sep 26, 2007 5:57 am Post subject: |
|
|
Dr. Shadowborg wrote: | 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. |
Uh, you obviously alter the shot origin based on your view angles, to match up when looking up or down... Having shot origin at self.origin + '0 0 16', now that's evil. I'd much rather have it at self.origin + self.view_ofs + v_up*-8 or something, that'd make it always spawn slightly under the gun, no matter the angle.
EDIT: lolz, Sajt already said it... _________________ Look out for Twigboy |
|
Back to top |
|
 |
Dr. Shadowborg Inside3D Staff

Joined: 16 Oct 2004 Posts: 726
|
Posted: Wed Sep 26, 2007 7:27 pm Post subject: |
|
|
And the problem from going up stairs/ramps and lifts while shooting beams? _________________ "Roboto suggests Plasma Bazooka." |
|
Back to top |
|
 |
Dr. Shadowborg Inside3D Staff

Joined: 16 Oct 2004 Posts: 726
|
Posted: Thu Sep 27, 2007 3:54 pm Post subject: |
|
|
Well, it's far from perfect, but you can try using this:
Code: |
Place at bottom of DEFS.QC
.entity owned;
Place at top of playerprethink and playerpostthink
local vector lgp;
local float norg;
place at bottom of playerprethink and playerpostthink
if(!self.button0 && self.owned != world)
{
remove(self.owned);
self.owned = world;
}
else if (self.button0 && self.owned != world)
{
if(self.origin_z > self.oldorigin_z && (other.solid == SOLID_BSP))
norg = -18;
else
norg = -12;
makevectors(self.v_angle);
setorigin(self.owned, self.origin + self.view_ofs + v_up*norg + v_right*8);
lgp = self.origin + self.view_ofs + v_up*norg + v_forward*600;
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
WriteEntity (MSG_BROADCAST, self.owned);
WriteCoord (MSG_BROADCAST, self.owned.origin_x);
WriteCoord (MSG_BROADCAST, self.owned.origin_y);
WriteCoord (MSG_BROADCAST, self.owned.origin_z);
WriteCoord (MSG_BROADCAST, lgp_x);
WriteCoord (MSG_BROADCAST, lgp_y);
WriteCoord (MSG_BROADCAST, lgp_z);
}
self.oldorigin = self.origin;
replace W_Firelightning in weapons.qc with this:
void() W_FireLightning =
{
local vector org, org2;
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;
}
makevectors(self.v_angle);
if (self.t_width < time)
{
sound (self, CHAN_WEAPON, "weapons/lhit.wav", 1, ATTN_NORM);
self.t_width = time + 0.6;
}
org = self.origin + self.view_ofs + v_up*-8 + v_right*8;
org2 = self.origin + self.view_ofs + v_up*-8;
if(!self.owned || self.owned == world)
{
newmis = spawn();
self.owned = newmis;
newmis.solid = SOLID_NOT;
setsize(newmis, '-1 -1 -1', '1 1 1');
}
setorigin(self.owned, org);
self.punchangle_x = -2;
self.currentammo = self.ammo_cells = self.ammo_cells - 1;
traceline (org2, org2 + v_forward*600, TRUE, self);
WriteByte (MSG_BROADCAST, SVC_TEMPENTITY);
WriteByte (MSG_BROADCAST, TE_LIGHTNING2);
WriteEntity (MSG_BROADCAST, self.owned);
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);
};
|
Feel free to tweak / point and laugh as needed. _________________ "Roboto suggests Plasma Bazooka." |
|
Back to top |
|
 |
smd
Joined: 23 Sep 2007 Posts: 23
|
Posted: Sun Oct 14, 2007 4:11 pm Post subject: Re: Three Quake1 Questions? |
|
|
smd wrote: | 2. i have changed all my weapons to the right side... |
but now i have changed all my old mdl weapons to new md3 weapons.
and so my question is, how is it possible to move my new weapons to the right side without edit the md3 file?
i mean is there a way in the weapons.qc file???
i have tried to modify the md3 in quark and gmax, but quark dont let me save md3 files. gmax save the modified md3, but without animations. |
|
Back to top |
|
 |
Entar

Joined: 05 Nov 2004 Posts: 422 Location: At my computer
|
Posted: Sun Oct 14, 2007 6:10 pm Post subject: Re: Three Quake1 Questions? |
|
|
smd wrote: | and so my question is, how is it possible to move my new weapons to the right side without edit the md3 file? |
In FTEQW and Vr2, there's are cvars (cl_gunx, y, and z) that adjust the viewmodel's position on the screen. Dunno if DarkPlaces has that added or not. _________________ woh... feelin woozy... too much cider...
http://entar.quakedev.com
games fascination - My Game Development Blog/Journal
 |
|
Back to top |
|
 |
smd
Joined: 23 Sep 2007 Posts: 23
|
Posted: Sun Oct 14, 2007 7:42 pm Post subject: |
|
|
thanks, but i need it for darkplaces! |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Sun Oct 14, 2007 10:43 pm Post subject: |
|
|
You have to use entities for the weapons, not .weaponmodel. Spawn an entity and set its .viewmodelforclient to the player, and the entity's origin is relative to the player.
Of course it may be a bit of work to transfer your weapon system to entities. _________________ 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. |
|
Back to top |
|
 |
smd
Joined: 23 Sep 2007 Posts: 23
|
Posted: Mon Oct 15, 2007 2:26 pm Post subject: |
|
|
ok thank you very much, will try that  |
|
Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2004 phpBB Group
|