Raised This Month: $ Target: $400
 0% 

Detecting Void


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 01-09-2007 , 15:09   Detecting Void
Reply With Quote #1

I have an entity that flies through the sky but has gravity. (It's a mortar shell)

The thing is, I'd like it to go through void. I already make it ignore sky so it basically bounces off of void right now. I'd like to be able to detect when the entity is hitting void and just make it go through.

Right now, as far as I know, it's bouncing off of void because it is MOVETYPE_TOSS

I've tried the other movetypes, but there is no movetype that has gravity but does not collide with void (but does collide with everything else)

Code:
// pev(entity, pev_movetype) values
#define	MOVETYPE_NONE                   0           // Never moves
#define	MOVETYPE_WALK                   3           // Player only - moving on the ground
#define	MOVETYPE_STEP                   4           // Gravity, special edge handling -- monsters use this
#define	MOVETYPE_FLY                    5           // No gravity, but still collides with stuff
#define	MOVETYPE_TOSS                   6           // Gravity/Collisions
#define	MOVETYPE_PUSH                   7           // No clip to world, push and crush
#define	MOVETYPE_NOCLIP                 8           // No gravity, no collisions, still do velocity/avelocity
#define	MOVETYPE_FLYMISSILE             9           // Extra size to monsters
#define	MOVETYPE_BOUNCE                 10          // Just like Toss, but reflect velocity when contacting surfaces
#define MOVETYPE_BOUNCEMISSILE          11          // Bounce w/o gravity
#define MOVETYPE_FOLLOW                 12          // Track movement of aiment
#define	MOVETYPE_PUSHSTEP               13          // BSP model that needs physics/world collisions (uses nearest hull for world collision)
Toss works for everything but the void bit. But is there anything that is called when the entity detects void and bounces that I can hook and supercede?

This way I can get a true mortar arch, and make the plugin very very useful.

Thanks guys.
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
VEN
Veteran Member
Join Date: Jan 2005
Old 01-09-2007 , 16:14   Re: Detecting Void
Reply With Quote #2

1. I do not think you need that because nobody need to see what happens after a touch to the map "bounds" so i'd assume that you could remove the projectile?

2. If you still want to complete that, try to pre-touch hook, detect that it's touching to the sky somehow and then try to set the projectile's solidity to SOLID_NOT.

EDIT: i think better just make it MOVETYPE_NOCLIP

EDIT2: Please nevermind, i overlooked your "arch" word, that completely changed the meaning of the point.

Last edited by VEN; 01-11-2007 at 08:49.
VEN is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 01-09-2007 , 16:48   Re: Detecting Void
Reply With Quote #3

Pre-Touch Hook? Haven't heard of it. That's a very good logical idea and will probably work if I can get a pre-touch hook. How do I hook that?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-09-2007 , 19:41   Re: Detecting Void
Reply With Quote #4

Register FM_Touch with the third parameter (post) as 0, which is the default.

http://www.amxmodx.org/funcwiki.php?go=func&id=615
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 01-10-2007 , 20:18   Re: Detecting Void
Reply With Quote #5

Okay thanks both of you for the help, but the thing is, if i set it to SOLID_NOT it doesn't fix the trick.

Code:
// pev(entity, pev_solid) values
// NOTE: Some movetypes will cause collisions independent of SOLID_NOT/SOLID_TRIGGER when the entity moves
// SOLID only effects OTHER entities colliding with this one when they move - UGH!
So it's not going to affect itself just other things that touch it.

Your edit, VEN, suggesting MOVETYPE_NOCLIP doesn't seem to work because NOCLIP gets rid of gravity, so it never comes back down it just shoots off into the sky and goes into another galaxy.

Is there any way to detect that "bounce" that a MOVETYPE_TOSS gets when touching void, so I can block it and let it just go through? Or another entity value I can set my shell to so it can go through the void but still have gravity?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
VEN
Veteran Member
Join Date: Jan 2005
Old 01-11-2007 , 12:28   Re: Detecting Void
Reply With Quote #6

I've overlooked your "arch" word, but now i clearly see your point.

There is no easy way. You have to understand that superceding the Touch will not ignore a physical collisions. You have to code the whole new movetype with its own physics.

As the base movetype for the sky part you can use MOVETYPE_NOCLIP mixed with a custom gravity physics implementation.

Last edited by VEN; 01-11-2007 at 12:34.
VEN is offline
Wilson [29th ID]
Veteran Member
Join Date: Nov 2005
Location: London
Old 01-15-2007 , 16:44   Re: Detecting Void
Reply With Quote #7

Would this require a new module?
__________________

Day of Defeat AMXX Community

FakeMeta Research . Voice Proximity . Advanced Deploy . Technician
Wilson [29th ID] is offline
Send a message via ICQ to Wilson [29th ID] Send a message via AIM to Wilson [29th ID] Send a message via MSN to Wilson [29th ID] Send a message via Yahoo to Wilson [29th ID]
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-15-2007 , 17:00   Re: Detecting Void
Reply With Quote #8

I'd imagine you just set its velocity, hook its think, and then slowly subtract from its Z velocity to replicate your gravity. The X and Y vectors should handle themselves.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX is offline
Bad_Bud
Senior Member
Join Date: Oct 2006
Location: The internet
Old 01-16-2007 , 16:23   Re: Detecting Void
Reply With Quote #9

Yeah, but you'll have to make sure you do some checking to see when the mortar enters void, and when it exits void, so that it's solid at every other point. There are a lot of factors involved, such as did you fire it from under a building (is it going to blow up before it even reaches the sky?), did it hit a rooftop on the way down? Is the skybox different heights for different parts of the level?
__________________
Bad_Bud is offline
XxAvalanchexX
Veteran Member
Join Date: Oct 2004
Location: abort73.com
Old 01-16-2007 , 17:02   Re: Detecting Void
Reply With Quote #10

Using MOVETYPE_NOCLIP and working your own gravity, the skybox is irrelevant. Since MOVETYPE_NOCLIP is not solid, it won't hit the skybox.

However, as you pointed out, you'll still want to see if it hit something. So, you can check its point contents for CONTENTS_SOLID every think, or draw a trace from its old destination (pre-gravity) to its new destination (post-gravity) and see if it hit something.
__________________
No longer around. Thanks your support, everyone! As always:
THIS ONES FOR YOU
3000 PTS
XxAvalanchexX 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 22:20.


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