View previous topic :: View next topic |
Author |
Message |
Preach
Joined: 25 Nov 2004 Posts: 122
|
Posted: Wed Aug 16, 2006 12:59 am Post subject: |
|
|
Are you doing anything dangerous like setting the origin without setorigin or changing the model without resetting the size? Ran into that problem today when doing a tutorial on teleporting monsters, they ended up much larger that they should have been otherwise. |
|
Back to top |
|
 |
SkinnedAlive
Joined: 25 Feb 2005 Posts: 65
|
Posted: Wed Aug 16, 2006 9:54 am Post subject: |
|
|
Ah! That did it! The spawn function was setting the origin before it was setting the model. It's working just fine now. It's these little rules that always get me. Thanks for your help everybody! |
|
Back to top |
|
 |
Sajt
Joined: 16 Oct 2004 Posts: 1026
|
Posted: Wed Aug 16, 2006 8:39 pm Post subject: |
|
|
Good one Preach! *shoots self in the face* _________________ 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 |
|
 |
SkinnedAlive
Joined: 25 Feb 2005 Posts: 65
|
Posted: Fri Aug 18, 2006 1:53 pm Post subject: |
|
|
Sorry to be a burden but I have another problem. I'm doing a findradius to check if it's all clear for spawning. Which works great except that it gets blocked up if a corpse gets in the way.
So how do I check that every entity in the chain is not a corpse (i.e. SOLID_NOT) with out checking every .chain individually? |
|
Back to top |
|
 |
Quake Matt

Joined: 05 Jun 2005 Posts: 129
|
Posted: Sun Aug 27, 2006 7:59 pm Post subject: |
|
|
I'm pretty sure you'll have to check for every entity in the chain. Even if it's possible to do it another way, the simplest way is usually the best! Considering a single spawn point, your code might look like this:
Code: | head = findradius(org, 100);
while(head)
{
if (head.solid != SOLID_NOT) //if head is a corpse
//bad position - goto next spawn point
head = head.chain;
}
//spawn player here |
As an alternative to using findradius(), you could possibly do a droptofloor() check to see if the area is clear. Basically, if the entity cannot hit the floor (falls out of level, too high, stuff in way, etc) the function will return false and you'll know you can't spawn there. However, I haven't used it much myself, so I could be wrong about how it works. |
|
Back to top |
|
 |
SkinnedAlive
Joined: 25 Feb 2005 Posts: 65
|
Posted: Tue Sep 05, 2006 11:48 am Post subject: |
|
|
Just so you know I have this solved and am soldiering on with the rest of the coding. Thanks for your help Matt. |
|
Back to top |
|
 |
JasonX
Joined: 21 Apr 2009 Posts: 92
|
|
Back to top |
|
 |
|