Solid Weapon Pickups
Moderator: InsideQC Admins
17 posts
• Page 1 of 2 • 1, 2
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?
- Ghost_Fang
- Posts: 336
- Joined: Thu Nov 12, 2009 4:37 am
all items are set solid in a seperate function:
and for regenerating weapons/ammo and such it's done in this function:
- Code: Select all
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: Select all
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);
};
-

Error - InsideQC Staff
- Posts: 865
- Joined: Fri Nov 05, 2004 5:15 am
- Location: VA, USA
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.
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.
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Or, you could like, use the same method I used to make a UT style shock rifle.
http://tlb.quakedev.com/files/shkrflv1.zip
http://tlb.quakedev.com/files/shkrflv1.zip
-

Dr. Shadowborg - InsideQC Staff
- Posts: 1110
- Joined: Sat Oct 16, 2004 3:34 pm
DO NOT play with solid, it is not necessary.
Just make a little hack:
In weapons.qc/ImpulseCommands add 2 lines
and in items.qc/weapon_touch:
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 )
Just make a little hack:
In weapons.qc/ImpulseCommands add 2 lines
- Code: Select all
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: Select all
// 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 )
-

Scrama - Posts: 20
- Joined: Fri Aug 28, 2009 6:16 am
- Location: Siberia, Omsk
makevectors(self.v_angle);
if ((v_forward * normalize(ent.origin - self.origin)) > 0.5)
SelfIsFacingTowardsEnt();
if ((v_forward * normalize(ent.origin - self.origin)) > 0.5)
SelfIsFacingTowardsEnt();
- Spike
- Posts: 2892
- Joined: Fri Nov 05, 2004 3:12 am
- Location: UK
Scrama wrote:...and you can check direction
Did you make all those maps on your site, Scrama?
The night is young. How else can I annoy the world before sunsrise?
Inquisitive minds want to know ! And if they don't -- well like that ever has stopped me before ..
-

Baker - Posts: 3666
- Joined: Tue Mar 14, 2006 5:15 am
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!"
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!"
- r00k
- Posts: 1110
- Joined: Sat Nov 13, 2004 10:39 pm
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.
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.
-

Scrama - Posts: 20
- Joined: Fri Aug 28, 2009 6:16 am
- Location: Siberia, Omsk
17 posts
• Page 1 of 2 • 1, 2
Who is online
Users browsing this forum: No registered users and 1 guest

