Hammer trigger actions without recompiling map

Ok so I’ve been looking around and I can’t seem to find the solution right for me. I don’t even know if this is possible.

I have a map that has a trigger_teleport(placed in hammer) in it. Is it possible for me to check if the player is passing through the trigger and execute code accordingly?

Just want to emphasise that editing the map is not an option at all. Thanks.

http://wiki.garrysmod.com/?title=Entity.GetKeyValues + OnTrigger

Thanks. I think I understand it, but any chance of an example?

Actually yeah I don’t get it, OnTrigger is a keyvalue or what?

local entitys = ents.FindByClass(“trigger_teleport”)
for k, ent in pairs(entitys) do
keys = ent:GetKeyValues().OnTrigger

im not sure what the OnTrigger puts out so run that and lemme know the output.

from what im reading ( http://developer.valvesoftware.com/wiki/Trigger_teleport ) the OnTrigger will put out the player and i assume a bool of it being fired, so just find the value that is changed on the teleporters run and adjust accordingly i guess…

Nothing was output to the console at all.

Edit: Scratch that, got it to error.

print(keys) returned - ‘nil’
PrintTable(keys) returned - ERROR: Hook ‘ChangeTeleport’ Failed: includes\util.lua:35: bad argument #1 to ‘pairs’ (table expected, got nil)

hmmm ill have to mess around with it, do you know where a map is that has a trigger_teleport in it?

The map im using hasnt been released to public yet, but I downloaded a deathrun pack the other day, they have trigger_teleports in them. deathrun_iceworld_v2 definitely does. http://www.garrysmod.org/downloads/?a=view&id=64864

I’m going to bed now, I hope you have some luck, and thanks :slight_smile:

actually i was wrong

shadowcastdist	=	0
ResponseContext	=	
gravity	=	0
damagefilter	=	
landmark	=	
globalname	=	
speed	=	0
ltime	=	0
friction	=	1
TeamNum	=	0
effects	=	0
hammerid	=	0
spawnflags	=	0
health	=	0
parentname	=	
filtername	=	filterT
classname	=	trigger_teleport
target	=	e2t2
max_health	=	0

GetKeyValues only puts out the above nothing about the activator, i looked around on the wiki and saw nothing that could get the activator but only somting that could activate it. So unless i can find somthing that can find the activator/output i cant help you here sorry :confused: