Thread: Entity touch
View Single Post
Author Message
Rirre
Veteran Member
Join Date: Nov 2006
Old 09-15-2016 , 15:53   Entity touch
Reply With Quote #1

I have created a zone (a cube/box) on fun_allinone map all over the spawn area and fwBoxTouch function do not get triggered by any player touching it.
But as soon all of the env_beam's gets triggered/toggled on (they're inside of this cube), then fwBoxTouch is somehow working as it should.
My questions are:
Why isn't it working without the beams triggering it? And how to get it to work as it should without env_beam entitites has to trigger it to work?

PS. I have to use MOVETYPE_NONE and SOLID_TRIGGER since it's supposed to act like a trigger_multiple entity.
Since the doors are within the cube as well.
I have figured out if any other value beside of MOVETYPE_NONE, when one of the doors gets triggered, it will kill/move the box away from it's position.
I have taken a look at the env_beam's keys and keyvalues to try figuring out what's triggering it to work, my guess was pev->dmg, but set_pev(entity, pev_dmg, <any value here>) did not work. So, I'm out of ideas.

Code:
public plugin_init() register_touch("box", "player", "fwBoxTouch") public fwBoxTouch(zone, player) {     if (!pev_valid(zone))         return FMRES_IGNORED     server_print("Test")     return FMRES_IGNORED } public CreateZone(Float:position[3], Float:mins[3], Float:maxs[3]) {     new entity = create_entity("info_target")     set_pev(entity, pev_classname, "box")     DispatchSpawn(entity)     engfunc(EngFunc_SetModel, entity, "models/gib_skull.mdl")     set_pev(entity, pev_solid, SOLID_TRIGGER)     set_pev(entity, pev_movetype, MOVETYPE_NONE)     set_pev(entity, pev_effects, EF_NODRAW)     engfunc(EngFunc_SetOrigin, entity, position)     engfunc(EngFunc_SetSize, entity, mins, maxs)     return entity }

Last edited by Rirre; 09-16-2016 at 00:21.
Rirre is offline