Raised This Month: $ Target: $400
 0% 

Creating a zone box


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
stupok
Veteran Member
Join Date: Feb 2006
Old 06-26-2007 , 00:56   Re: Creating a zone box
Reply With Quote #1

You're using engine, so it's a little bit different than my example. Originally I didn't understand the difference between pev_absmin and pev_mins but now I think I do.

pev_absmin contains the coordinates with respect to (0.0, 0.0, 0.0)
pev_mins contains the coordinates with respect to the entity's origin


When you are doing this:
Code:
entity_set_size(ent, mins, maxs)
It's equivalent to using fakemeta like this:
Code:
set_pev(ent, pev_mins, mins)
set_pev(ent, pev_maxs, maxs)
So you should use coordinates with respect to the entity's origin when you set its size with entity_set_size(). However, you should use coordinates with respect to (0.0, 0.0, 0.0) when you are drawing the box with write_byte(31); // TE_BOX.

By the way, you should use "TE_BOX" instead of "31", it should be defined already. It's always better to avoid hard-coding when you can.
stupok is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 21:35.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode