Detecting Void
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) valuesThis way I can get a true mortar arch, and make the plugin very very useful. Thanks guys. |
Re: Detecting Void
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. |
Re: Detecting Void
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?
|
Re: Detecting Void
Register FM_Touch with the third parameter (post) as 0, which is the default.
http://www.amxmodx.org/funcwiki.php?go=func&id=615 |
Re: Detecting Void
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) valuesYour 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? |
Re: Detecting Void
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. |
Re: Detecting Void
Would this require a new module?
|
Re: Detecting Void
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.
|
Re: Detecting Void
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?
|
Re: Detecting Void
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. |
| All times are GMT -4. The time now is 22:20. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.