turrets, not the funny mental disorder :p
Moderator: InsideQC Admins
9 posts
• Page 1 of 1
turrets, not the funny mental disorder :p
hah sorry bout that couldnt help it. well im making a turret upgrade for my ups mod, wich is coming out really sweet right now
but i have a problem with the turret. it wont become a solid, player blocking entity. my knowledge of entity types is pretty decent or so i thought but i cant get it to stop the player withour making it a bsp entity, and that lags really bad when i use it. well any help would be great, thanks!
- Code: Select all
void() build =
{
local entity t;
local vector dir, org, source;
makevectors (self.v_angle);
source = self.origin + '0 0 16';
traceline (source, source + v_forward*64, FALSE, self);
if (trace_fraction != 1.0)
{
sprint(self,"{}You can't build there\n");
return;
}
org = trace_endpos + v_forward*4;
t = spawn();
setmodel(t,"progs/agc.mdl");
setorigin(t, org + '0 0 20');
setsize (t, VEC_ORIGIN, VEC_ORIGIN);
t.owner = self;
t.movetype = MOVETYPE_TOSS;
t.solid = SOLID_SLIDEBOX;
t.touch = stp;
t.classname = "turret";
t.think = build1;
t.nextthink = time + 0.2;
makevectors (self.v_angle);
t.angles_z = self.angles_z;
t.angles_y = self.angles_y;
self.buildtime = time + 1.5;
self.impulse = 0;
sprint(self,"{}Building Turret!\n");
};
-

RooT - Posts: 40
- Joined: Wed Sep 07, 2005 1:28 am
question
ok i got the turret to be solid, solid_bsp actualy, not sure if thats good or not? but it works the best. only problem is it becomes un-solid when i attach an owner tag to it, my guess is that bsp solids are reserved for world brushes and such and that noone can own them so through w/e glitch this happens. anyone got an idea?
-

RooT - Posts: 40
- Joined: Wed Sep 07, 2005 1:28 am
You must be using DarkPlaces or possibly FTE, since to my knowledge those are the only engines that support non-bmodel entities to be SOLID_BSP. This enables polygon collisions against their model geometry (obviously doesn't work on sprites).
The issue you're having however, is that Quake makes entities non-solid for the targeted .owner. For example, all projectiles in Quake are owned by the shooter, so that they won't collide with him. I'm sure you've noticed when you bounce a grenade off a wall towards yourself, it goes straight through you. The entity will however stay solid for any other entities than their owner.
The issue you're having however, is that Quake makes entities non-solid for the targeted .owner. For example, all projectiles in Quake are owned by the shooter, so that they won't collide with him. I'm sure you've noticed when you bounce a grenade off a wall towards yourself, it goes straight through you. The entity will however stay solid for any other entities than their owner.
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
I thought this behavior was in the QuakeC code itself. At the top of GrenadeTouch is something like:
if (other == self.owner)
return;
This stops quake from reacting to touch events between the missile and it's owner. Commenting the line out will turn the gren launcher into a gib button
So when creating a new entity there shouldn't be a difference in how something collides with it's owner and anyone else unless you purposefully write something to make it so.
It doesn't explain why you're having trouble though, sorry.
if (other == self.owner)
return;
This stops quake from reacting to touch events between the missile and it's owner. Commenting the line out will turn the gren launcher into a gib button
So when creating a new entity there shouldn't be a difference in how something collides with it's owner and anyone else unless you purposefully write something to make it so.
It doesn't explain why you're having trouble though, sorry.
- Plumb
- Posts: 11
- Joined: Thu Apr 20, 2006 10:30 am
Plumb wrote:I thought this behavior was in the QuakeC code itself. At the top of GrenadeTouch is something like:
if (other == self.owner)
return;
This stops quake from reacting to touch events between the missile and it's owner. Commenting the line out will turn the gren launcher into a gib button
That quite simply is not true, the progs106 source contains a bunch of redundant code. Try and see for thyself. The Quake wiki says the same. An entity with an .owner cannot collide with the entity .owner points to, nor the other way around.
I was once a Quake modder
-

Urre - Posts: 1109
- Joined: Fri Nov 05, 2004 2:36 am
- Location: Moon
That means you need to create a new field for the turret to point back to teh owner.
Then when you create the turret:
- Code: Select all
.entity turret_owner;
Then when you create the turret:
- Code: Select all
t.turret_owner = self;
-

Lardarse - Posts: 266
- Joined: Sat Nov 05, 2005 1:58 pm
- Location: Bristol, UK
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest