Entity go though wall and but still trigger when touch
I tried to create an rocket entity that go can go though wall (I think about MOVETYPE_NOCLIP or MOVETYPE_FLY + SOLID_TRIGGER) and explode when contact. If it touch skybox, it will remove itself
For easier understanding, this is what I want to do: https://i.imgur.com/U6ca52P.png I was thinking about using traceline but I wanted it to travel instead of instant explode at all position so I save that if this isn't possible. |
Re: Entity go though wall and but still trigger when touch
Try this out
Code:
#include <amxmodx> |
Re: Entity go though wall and but still trigger when touch
Quote:
by "walls" I mean even thick wall/building |
Re: Entity go though wall and but still trigger when touch
I didn't understand your question. You want the rocket to explode when it hit objects in the world but it should not stop, instead, it will fly through the object as the spectators and will be removed when it flies out of the world "bounding box"? If so, set the entity move type to noclip as you first thought and constantly trace a monster hull. When the trace hits anything, create an explosion at the point of the collision. To determine if the entity is outside the world boundary, use CBaseEntity::IsInWorld, already implemented in engine_stocks.inc.
https://github.com/s1lentq/ReGameDLL...cbase.cpp#L856 https://github.com/alliedmodders/amx...tocks.inc#L225 If you want to prevent it from exploding if it is already within the object, check if it is the first time that the trace returns true (for that particular entity if isn't -1), may fail in some conditions but I think you will be ok. Pseudo-code: Code:
IAmThinking() Code:
|
Re: Entity go though wall and but still trigger when touch
When you mean walls ? you mean entities or worldspawn walls?
also try zXCaptainXz code but change the movetype PHP Code:
PHP Code:
|
Re: Entity go though wall and but still trigger when touch
Quote:
|
Re: Entity go though wall and but still trigger when touch
Quote:
|
Re: Entity go though wall and but still trigger when touch
Quote:
What I mean is "the rocket touch any surface or entity, it will explode. But instead of disappear, it go though that wall, explode when touch the next surface or entity" For example: - You stand above CT spawn (A short) in Dust2, you shoot under your feet, it will explode under your feet but also go though and explode in CT spawn. - You stand behind the lower box that can see from Long A (usually used for silent C4) in A site. You facing the wall that face to the A site and shoot. It explode there but also go though and explode at B Window Quote:
I want the entity to go though all of them but explode when it touch walls or entity. And then when it touch the skybox, remove it to prevent any crash might happened. Quote:
Quote:
|
Re: Entity go though wall and but still trigger when touch
You have three types of objects
1.point entities ( player, info_targrt, sprites, etc... ) 2. Brush Entities ( func_breakable, glass, door, etc.. ( 3. Worldspawn which ID is 0, its not an entity. Btw if any entity went outside of the sky/world a crash won't happen, you can tell when a player uses noclip and goes out of the map. But if you spawn a point entity outside the world it might crash not sure. |
Re: Entity go though wall and but still trigger when touch
https://i.imgur.com/FVtC1ch.png
It is not totally correct but I think I can work out from here Thanks for your help @CrazY. ^^ |
All times are GMT -4. The time now is 03:17. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.