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

Joined: 07 Sep 2005 Posts: 40
|
Posted: Fri Sep 30, 2005 1:15 am Post subject: 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: | 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");
};
|
_________________ My mod site!
Mod Status:
Turret Defense: 30%
UPS: 45% |
|
Back to top |
|
 |
Spike
Joined: 05 Nov 2004 Posts: 944 Location: UK
|
Posted: Fri Sep 30, 2005 3:40 am Post subject: |
|
|
Put the setorigin or setsize after the t.solid = SOLID_SLIDEBOX;
Yes, it does make a difference. |
|
Back to top |
|
 |
FrikaC Site Admin

Joined: 08 Oct 2004 Posts: 947
|
Posted: Fri Sep 30, 2005 8:09 pm Post subject: |
|
|
There's nothing 'funny' about someone suffering from Tourettes Syndrome. |
|
Back to top |
|
 |
RooT

Joined: 07 Sep 2005 Posts: 40
|
Posted: Mon Oct 03, 2005 8:59 pm Post subject: 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? _________________ My mod site!
Mod Status:
Turret Defense: 30%
UPS: 45% |
|
Back to top |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Fri Oct 07, 2005 5:01 am Post subject: |
|
|
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. _________________ Look out for Twigboy |
|
Back to top |
|
 |
Plumb
Joined: 20 Apr 2006 Posts: 11
|
Posted: Thu Apr 20, 2006 11:06 am Post subject: |
|
|
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. |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Thu Apr 20, 2006 1:09 pm Post subject: |
|
|
You might want to use a bounding box with some kind of size, too. _________________ 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 |
|
 |
Urre

Joined: 05 Nov 2004 Posts: 1073 Location: Sweden
|
Posted: Sun Apr 23, 2006 12:34 am Post subject: |
|
|
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. _________________ Look out for Twigboy |
|
Back to top |
|
 |
Lardarse

Joined: 05 Nov 2005 Posts: 243 Location: Bristol, UK
|
Posted: Sun Apr 23, 2006 12:51 pm Post subject: |
|
|
That means you need to create a new field for the turret to point back to teh owner.
Code: | .entity turret_owner; |
Then when you create the turret:
Code: | t.turret_owner = self; |
|
|
Back to top |
|
 |
|