tf.fgd editing question

Discussion in 'Mapping Questions & Discussion' started by 404UNF, Jun 27, 2016.

  1. 404UNF

    404UNF No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    229
    Positive Ratings:
    60
    So while working on setting up tf_logic_holiday in the map I'm working on, I noticed that it only gives you three holiday choices; None, Halloween and Birthday;

    Code:
    @PointClass base(Targetname) = tf_logic_holiday : "Holiday Entity. This is used to detect a holiday map."
    [  
        holiday_type(choices) : "Holiday" : 1 =
        [
            1 : "None"
            2 : "Halloween"
            3 : "Birthday"
        ]
    
        tauntInHell(choices) : "Taunt In Hell" : 0 : "Should players taunt when teleported to Hell." =
        [
            0 : "No"
            1 : "Yes"
        ]
    
        allowHaunting(choices) : "Haunting" : 0 : "Allow Wheel of Doom haunting." =
        [
            0 : "No"
            1 : "Yes"
        ]
    
        input HalloweenSetUsingSpells(integer) : "Disable/Enable spells for this map. Only works on Halloween maps. (0 disable, 1 enable)"
        input Halloween2013TeleportToHell(string) : "Teleport all players to hell."
    ]

    Here's the thing. There are obviously more holidays than that. Reading from "addons/sourcemod/scripting/include/tf2.inc" from a typical SourceMod install, we can see that there are currently 13 holidays available to choose from;

    Code:
    enum TFHoliday
    {
       TFHoliday_Invalid = -1 // #0
    };
    
    public const TFHoliday:TFHoliday_Birthday; // #1
    public const TFHoliday:TFHoliday_Halloween; // #2
    public const TFHoliday:TFHoliday_Christmas; // #3
    public const TFHoliday:TFHoliday_EndOfTheLine; // #4
    public const TFHoliday:TFHoliday_CommunityUpdate; // #5, not sure what this is for
    public const TFHoliday:TFHoliday_ValentinesDay; // #6
    public const TFHoliday:TFHoliday_MeetThePyro; // #7
    public const TFHoliday:TFHoliday_SpyVsEngyWar; // #8, unused
    public const TFHoliday:TFHoliday_FullMoon; // #9
    public const TFHoliday:TFHoliday_HalloweenOrFullMoon; // #10
    public const TFHoliday:TFHoliday_HalloweenOrFullMoonOrValentines; // #11
    public const TFHoliday:TFHoliday_AprilFools; // #12
    

    This is my question: If I was to code in the additional holidays like in the spoiler below, would it actually work in the game? I'm not sure if the entity has hardcoded settings in the engine that would prevent it from properly recognizing the existing holidays.

    I believe I can test it via a holiday switching SourceMod plugin and coding in the additional holidays and setting them up to enable/disable a specific prop and seeing if the game does allow the entity to control things on all the holidays.

    Code:
    @PointClass base(Targetname) = tf_logic_holiday : "Holiday Entity. This is used to detect a holiday map."
    [  
        holiday_type(choices) : "Holiday" : 1 =
        [
            1 : "None"
            2 : "Halloween"
            3 : "Birthday"
            4 : "Christmas"
            5 : "End of the Line"
            6 : "Community Update"
            7 : "Valentines Day"
            8 : "Meet the Pyro"
            9 : "Spy vs Engineer WAR"
            10 : "Full Moon"
            11 : "Halloween or Full Moon"
            12 : "Halloween or Full Moon or Valentines Day"
            13 : "April Fools"
        ]
    
        tauntInHell(choices) : "Taunt In Hell" : 0 : "Should players taunt when teleported to Hell." =
        [
            0 : "No"
            1 : "Yes"
        ]
    
        allowHaunting(choices) : "Haunting" : 0 : "Allow Wheel of Doom haunting." =
        [
            0 : "No"
            1 : "Yes"
        ]
    
        input HalloweenSetUsingSpells(integer) : "Disable/Enable spells for this map. Only works on Halloween maps. (0 disable, 1 enable)"
        input Halloween2013TeleportToHell(string) : "Teleport all players to hell."
    ]

    Side note: The Spy vs Engineer WAR holiday doesn't visibly change anything in the game/on a server whatsoever, so if this idea does work, you could use the Spy vs Engineer WAR holiday as a placeholder for your own custom holiday, then just create/ask someone (like me) to create a SourceMod plugin with a command that allows you to change the holiday to Spy vs Engineer WAR, thus enabling your custom holiday stuff on the map via the holiday logic entity. The holiday itself may end up being changed to be used or removed in the future, so that's something to watch out for.
     
    Last edited: Jun 27, 2016
  2. 404UNF

    404UNF No longer a "TF2 Beta/Cut Content Historian".

    Messages:
    229
    Positive Ratings:
    60
    Alright so I just realized that the entity I was looking to use in my map was actually tf_logic_on_holiday, so I could show/hide props and such depending on the holiday.

    The code for that is pretty different and I don't think I can add any new holidays to it;

    Code:
    @PointClass base(Targetname) iconsprite("editor/logic_auto.vmt") = tf_logic_on_holiday :
       "This entity allows you execute map actions on holidays. Will send all relevant outputs every time the Fire input is called."
    [
       input Fire(void) : "Cause one or more appropriate outputs to fire."
       output IsNothing(void) : ""
       output IsTFBirthday(void) : ""
       output IsHalloween(void) : ""
       output IsSmissmas(void) : ""
       output IsValentines(void) : ""
       output IsFullMoon(void) : ""
       output IsAprilFools(void) : ""
    ]

    I'd need to know if there were different Is<Holiday> outputs for things like EotL/Spy vs Engy WAR/etc. And I don't know how to find that out.
     
  3. Gabe Noodle from Volvo

    Gabe Noodle from Volvo L3: Member

    Messages:
    142
    Positive Ratings:
    32
    I don't know much about the fgd's. But I do know you need to hardcode entities in the source engine. It should still compile with the same values, but may not work without something other than the base game, such as sourcemod, that can recognize it.