View previous topic :: View next topic |
Author |
Message |
Ghost_Fang
Joined: 12 Nov 2009 Posts: 162
|
Posted: Tue Mar 09, 2010 4:02 am Post subject: Solid Weapon Pickups |
|
|
I know if i want manual weapon pickups i have to make the standard quake weapons solid to be detected by the traceline. I don't see anywhere in items.qc where it tells the weapons to be SOLID_NOT. Or is it something completely different? |
|
Back to top |
|
 |
Error Inside3D Staff

Joined: 05 Nov 2004 Posts: 558 Location: VA, USA
|
Posted: Tue Mar 09, 2010 7:38 am Post subject: |
|
|
all items are set solid in a seperate function:
Code: |
void() PlaceItem =
{
local float oldz;
self.mdl = self.model; // so it can be restored on respawn
self.flags = FL_ITEM; // make extra wide
self.solid = SOLID_TRIGGER;
self.movetype = MOVETYPE_TOSS;
self.velocity = '0 0 0';
self.origin_z = self.origin_z + 6;
oldz = self.origin_z;
if (!droptofloor())
{
dprint ("Bonus item fell out of level at ");
dprint (vtos(self.origin));
dprint ("\n");
remove(self);
return;
}
};
|
and for regenerating weapons/ammo and such it's done in this function:
Code: |
void() SUB_regen =
{
self.model = self.mdl; // restore original model
self.solid = SOLID_TRIGGER; // allow it to be touched again
sound (self, CHAN_VOICE, "items/itembk2.wav", 1, ATTN_NORM); // play respawn sound
setorigin (self, self.origin);
};
|
_________________ Inside3D : Knowledge Is Power
Darkplaces Documentation Wiki |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Tue Mar 09, 2010 9:20 am Post subject: |
|
|
weapons are SOLID_TRIGGER, so you can walk through them, but they still get touch notifications from players that walk inside them.
actually solid pickups will block the player's motion as well. consider using SOLID_CORPSE if your engine supports that.
failing that, you could use find and a traceline that succeeds when it reaches the center of the pickup without hitting anything.
note that to do that, you should probably make all such pickups use a single classname. _________________ What's a signature? |
|
Back to top |
|
 |
Downsider

Joined: 16 Sep 2008 Posts: 478
|
Posted: Tue Mar 09, 2010 12:41 pm Post subject: |
|
|
Can't you, before the user does the traceline, make them solid, then after, make them untouchabale again? |
|
Back to top |
|
 |
Dr. Shadowborg Inside3D Staff

Joined: 16 Oct 2004 Posts: 726
|
Posted: Tue Mar 09, 2010 5:16 pm Post subject: |
|
|
Or, you could like, use the same method I used to make a UT style shock rifle.
http://tlb.quakedev.com/files/shkrflv1.zip _________________ "Roboto suggests Plasma Bazooka." |
|
Back to top |
|
 |
Scrama

Joined: 28 Aug 2009 Posts: 20 Location: Siberia, Omsk
|
Posted: Wed Mar 10, 2010 3:13 am Post subject: |
|
|
DO NOT play with solid, it is not necessary.
Just make a little hack:
In weapons.qc/ImpulseCommands add 2 lines
Code: |
if (self.impulse == 213) // Any impulse number
self.use_time = time + 0.2 // time to allow item pick-up
|
and in items.qc/weapon_touch:
Code: |
// after lines
if (!(other.flags & FL_CLIENT))
return;
// insert next two
if (other.use_time > time)
return;
|
Also you need to define float .use_time somewhere.
To allow player use by impulse doors/buttons etc. just insert [if use_time] construction.
and... bind KEY "impulse 213" in config is very useful ) |
|
Back to top |
|
 |
Downsider

Joined: 16 Sep 2008 Posts: 478
|
Posted: Wed Mar 10, 2010 3:45 am Post subject: |
|
|
I think it would be best if the entity was kept non-solid and the findradius function was used instead, so you don't even have to look at it, just be near it.. |
|
Back to top |
|
 |
r00k
Joined: 13 Nov 2004 Posts: 483
|
Posted: Thu Mar 11, 2010 4:19 am Post subject: |
|
|
I was thinking the same thing. |
|
Back to top |
|
 |
Scrama

Joined: 28 Aug 2009 Posts: 20 Location: Siberia, Omsk
|
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Thu Mar 11, 2010 11:00 am Post subject: |
|
|
makevectors(self.v_angle);
if ((v_forward * normalize(ent.origin - self.origin)) > 0.5)
SelfIsFacingTowardsEnt(); _________________ What's a signature? |
|
Back to top |
|
 |
Baker

Joined: 14 Mar 2006 Posts: 1538
|
Posted: Thu Mar 11, 2010 11:38 am Post subject: |
|
|
Scrama wrote: | ...and you can check direction |
Did you make all those maps on your site, Scrama? _________________ Tomorrow Never Dies. I feel this Tomorrow knocking on the door ... |
|
Back to top |
|
 |
r00k
Joined: 13 Nov 2004 Posts: 483
|
Posted: Thu Mar 11, 2010 5:37 pm Post subject: |
|
|
I've always wondered how a static number of weapons provided on a map, with the limit of 1 weapon at a time in inventory would play out. I guess, with a balanced arsenal it could be viable.
Imagine everyone spawns with SG (axe well thats always there).
Other weapons spawn normally. If someone wants the new weapon they have to drop the old one. weapons do not respawn but are taken from a fallen enemy, thus forcing you to drop the weapon you had in hand that u used to kill that enemy.
hmm then again this might only be a good idea for an FFA game, otherwise you'll yell at your teammate "I want the RL!"  |
|
Back to top |
|
 |
Teiman
Joined: 03 Jun 2007 Posts: 309
|
Posted: Thu Mar 11, 2010 6:10 pm Post subject: |
|
|
r00k wrote: | I've always wondered how a static number of weapons provided on a map, with the limit of 1 weapon at a time in inventory would play out. I guess, with a balanced arsenal it could be viable. |
something like RUNES, only nothing like that |
|
Back to top |
|
 |
Scrama

Joined: 28 Aug 2009 Posts: 20 Location: Siberia, Omsk
|
Posted: Fri Mar 12, 2010 6:24 am Post subject: |
|
|
2Spike: exactly!
2Baker:
> Did you make all those maps on your site, Scrama?
Sounds like offtopic, but yes, I am the autor )
2r00k:
> I've always wondered how a static number of weapons provided on a map, with the limit of 1 weapon at a time in inventory would play out. I guess, with a balanced arsenal it could be viable.
like Counter-strike. BTW it is a good idea to limit player's arsenal in SP to 2-3 weapons at 1 time, not 1. _________________ http://scrama_levelart.livejournal.com |
|
Back to top |
|
 |
gnounc

Joined: 06 Apr 2009 Posts: 120
|
Posted: Fri Mar 12, 2010 8:45 am Post subject: |
|
|
for teamplay how about allowing 1 instance of a weapon PER TEAM.
so each team can have a lightning gun...but a team cant have 2 (and you wont end up with 4 lightning guns on one team in a 4v4 scenario) |
|
Back to top |
|
 |
|