Working with game_playerkill, lookin for logic_eventlistener...

Discussion in 'Mapping Questions & Discussion' started by Avaray, Mar 23, 2016.

  1. Avaray

    Avaray L2: Junior Member

    Messages:
    73
    Positive Ratings:
    3
    I want to listen for event when player is killed by other player.
    I started my journey from this topic and official wiki page of trigger_brush.
    So I tried with trigger_brush (there is example in wiki; link above) and with func_button 1 / func_button 2 ways.
    In both cases player stuck on spawn (it looks like player is spawning inside solid block). But it doesnt matter if player is spawning inside that brush/button or outside. In every case player will stuck. Even if that brush/button is outside map.

    There is also another way to listen that event. With logic_eventlistener.
    I want to add it into tf.fgd, But I cant find source of it anywhere. Even in actual Portal 2 FGD...
    Code:
    logic_eventlistener is a point entity available in all Source games since Portal 2.
    Do you have any ideas why that trigger_brush doesnt work?
    Do you have code (script? I dont know how to name it) for logic_eventlistener?

    Edit: I think I found that logic_eventlistener
    Code:
    @PointClass base(Targetname) = logic_eventlistener :
            "An entity that can listen to events fired from code and fire " +
            "and output when it happens."
    [
            EventName(string) : "Event Name" : "" : "The name of the event that you want to listen for."
            IsEnabled(choices) : "Start Enabled" : 1 =
            [
                    0 : "No"
                    1 : "Yes"
            ]
            TeamNum(choices) : "Team Number" : -1 : "If set, will only fire its output if the event is generated from someone of the specified team." =
            [
                    -1 : "Don't care"
                    1 : "Team 1"
                    2 : "Team 2 (ORANGE)"
                    3 : "Team 3 (BLUE)"
            ]
                   
            // Inputs
            input Enable(void) : "Enable the logic_measure_movement."
            input Disable(void) : "Disable the logic_measure_movement."
           
            // Outputs
            output OnEventFired(void)  : "Fired when the event has been detected."
    ]
     
    Last edited: Mar 23, 2016
  2. Egan

    aa Egan

    Messages:
    1,318
    Positive Ratings:
    1,519
    game_playerkill will be 'use'-ed whenever a player dies in the entire map, not just inside of the trigger itself. You can safely place it at the side of the map, behind a wall, etc, as a small box (in both cases: as func_button or as trigger_brush).

    logic_eventlistener doesn't exist in TF2 -> adding it to the FGD will allow it to appear for use in hammer etc only if it exists already in TF2's code..
     
    • Thanks Thanks x 1
  3. Vel0city

    aa Vel0city func_fish

    Messages:
    1,938
    Positive Ratings:
    1,540
    According to the wiki:

    logic_eventlistener is a point entity available in all Source games since Portal 2.

    So unless TF2's Source branch (Source MP I believe) got updated to Portal 2's engine it won't even be in TF2's code.
     
    • Thanks Thanks x 1
  4. Avaray

    Avaray L2: Junior Member

    Messages:
    73
    Positive Ratings:
    3
    Yeah. I was trying like that.
    Anyway.... after short break from mapping it started working somehow (func_button way), haha :)
    Thanks for responses!