Inside3D!
     

turrets, not the funny mental disorder :p

 
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming
View previous topic :: View next topic  
Author Message
RooT



Joined: 07 Sep 2005
Posts: 40

PostPosted: Fri Sep 30, 2005 1:15 am    Post subject: turrets, not the funny mental disorder :p Reply with quote

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 Razz 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
View user's profile Send private message AIM Address
Spike



Joined: 05 Nov 2004
Posts: 944
Location: UK

PostPosted: Fri Sep 30, 2005 3:40 am    Post subject: Reply with quote

Put the setorigin or setsize after the t.solid = SOLID_SLIDEBOX;

Yes, it does make a difference.
Back to top
View user's profile Send private message Visit poster's website
FrikaC
Site Admin


Joined: 08 Oct 2004
Posts: 947

PostPosted: Fri Sep 30, 2005 8:09 pm    Post subject: Reply with quote

There's nothing 'funny' about someone suffering from Tourettes Syndrome.
Back to top
View user's profile Send private message Send e-mail
RooT



Joined: 07 Sep 2005
Posts: 40

PostPosted: Mon Oct 03, 2005 8:59 pm    Post subject: question Reply with quote

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
View user's profile Send private message AIM Address
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Fri Oct 07, 2005 5:01 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Plumb



Joined: 20 Apr 2006
Posts: 11

PostPosted: Thu Apr 20, 2006 11:06 am    Post subject: Reply with quote

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 Razz

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
View user's profile Send private message Visit poster's website
Sajt



Joined: 16 Oct 2004
Posts: 1026

PostPosted: Thu Apr 20, 2006 1:09 pm    Post subject: Reply with quote

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
View user's profile Send private message
Urre



Joined: 05 Nov 2004
Posts: 1073
Location: Sweden

PostPosted: Sun Apr 23, 2006 12:34 am    Post subject: Reply with quote

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 Razz


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
View user's profile Send private message Visit poster's website
Lardarse



Joined: 05 Nov 2005
Posts: 243
Location: Bristol, UK

PostPosted: Sun Apr 23, 2006 12:51 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Inside3d Forums Forum Index -> QuakeC Programming All times are GMT
Page 1 of 1

 
Jump to:  
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