2 registered members (TipmyPip, 1 invisible),
18,758
guests, and 8
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: Making a "Hitbox"
[Re: Leaf]
#134347
06/08/07 08:34
06/08/07 08:34
|
Joined: Jul 2002
Posts: 4,436 Germany, Luebeck
Xarthor
Expert
|
Expert
Joined: Jul 2002
Posts: 4,436
Germany, Luebeck
|
Yeah I just wrote it down quickly. The beep is just there for "debug purpose" so I would take it out and replace it with the code which should be executed when the if statement is "true". The action name was to long, yeah maybe but again I just wrote it as scetch and not "working" code 
|
|
|
Re: Making a "Hitbox"
[Re: Leaf]
#134351
06/14/07 08:57
06/14/07 08:57
|
Joined: Mar 2007
Posts: 776 Poor village - Poland ;)
tompo
User
|
User
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
|
But I dont't get it  What do You want to make? Just doors which woorks only when You are close enough and when you touch it with crosshair?
Last edited by tompo; 06/14/07 09:06.
Never say never.
|
|
|
Re: Making a "Hitbox"
[Re: tompo]
#134352
06/14/07 18:10
06/14/07 18:10
|
Joined: May 2006
Posts: 69 Canada
Leaf
OP
Junior Member
|
OP
Junior Member
Joined: May 2006
Posts: 69
Canada
|
Quote:
But I dont't get it  What do You want to make? Just doors which woorks only when You are close enough and when you touch it with crosshair?
Yup, when the center of my camera is over the entity and im withing the distance then do the unction I give it.
So if I aim at the entity with my crosshair and im within 200 quants.
|
|
|
Re: Making a "Hitbox"
[Re: Leaf]
#134353
06/14/07 18:14
06/14/07 18:14
|
Joined: Mar 2007
Posts: 776 Poor village - Poland ;)
tompo
User
|
User
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
|
so simple trigger event is not good enough?
function door_event { if(event_type == event_trigger) && (vec_to_screen(me,camera) ==1) {do action;} }
action door_action { my.enable_trigger = on; my.trigger_range = 200; my.event = door_event; }
or function door_event { if(vec_dist(my.x,player.x) <= 200) && (vec_to_screen(me,camera) ==1) {do action;} }
Last edited by tompo; 06/14/07 18:16.
Never say never.
|
|
|
Re: Making a "Hitbox"
[Re: Leaf]
#134355
06/14/07 18:54
06/14/07 18:54
|
Joined: Mar 2007
Posts: 776 Poor village - Poland ;)
tompo
User
|
User
Joined: Mar 2007
Posts: 776
Poor village - Poland ;)
|
if you use if(vec_dist(my.x,player.x) <= 200) && (vec_to_screen(me,camera) ==1) this one if(my.clipped != on && vec_dist(my.x,player.x) <= 200 && vec_to_screen(me,camera) ==1) is useless... specialy clipped becouse if(vec_to_screen) = if visible try just to copy/pste my code and we'll see what will happend 
Never say never.
|
|
|
|