1. Post #1
    Gold Member
    snake logan's Avatar
    October 2005
    83 Posts
    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.
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Informative Informative x 1 (list)

  2. Post #2
    Ask Xyxen about L-Leaf.
    mcd1992's Avatar
    March 2008
    296 Posts

  3. Post #3
    Gold Member
    snake logan's Avatar
    October 2005
    83 Posts
    Thanks. I think I understand it, but any chance of an example?
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Informative Informative x 1 (list)

  4. Post #4
    Gold Member
    snake logan's Avatar
    October 2005
    83 Posts
    Actually yeah I don't get it, OnTrigger is a keyvalue or what?
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Informative Informative x 1 (list)

  5. Post #5
    Ask Xyxen about L-Leaf.
    mcd1992's Avatar
    March 2008
    296 Posts
    local entitys = ents.FindByClass("trigger_teleport")
    for k, ent in pairs(entitys) do
    	keys = ent:GetKeyValues().OnTrigger
    	print(keys)
    	PrintTable(keys)
    end
    

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

    from what im reading ( http://developer.valvesoftware.com/w...igger_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...

  6. Post #6
    Gold Member
    snake logan's Avatar
    October 2005
    83 Posts
    local entitys = ents.FindByClass("trigger_teleport")
    for k, ent in pairs(entitys) do
    	keys = ent:GetKeyValues().OnTrigger
    	print(keys)
    	PrintTable(keys)
    end
    

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

    from what im reading ( http://developer.valvesoftware.com/w...igger_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)
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Informative Informative x 1 (list)

  7. Post #7
    Ask Xyxen about L-Leaf.
    mcd1992's Avatar
    March 2008
    296 Posts
    hmmm ill have to mess around with it, do you know where a map is that has a trigger_teleport in it?

  8. Post #8
    Gold Member
    snake logan's Avatar
    October 2005
    83 Posts
    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 :)
    Reply With Quote Edit / Delete Reply United Kingdom Show Events Informative Informative x 1 (list)

  9. Post #9
    Ask Xyxen about L-Leaf.
    mcd1992's Avatar
    March 2008
    296 Posts
    actually i was wrong

    Code:
    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 :/