Monthly Target: $400 Donations: $348
 87% 

[TF2] Assister Domination Quotes (1.3, 2013-08-02)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Powerlord
Oh Ross.
Join Date: Jun 2008
Location: Seduce Me!
Plugin ID:
3646
Plugin Version:
1.3
Plugin Category:
General Purpose
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Approver:
    Plugin Description:
    Tired of getting a domination on an assist and not hearing the fun quotes? Well, now you will!
    Servers with this Plugin:
     
    Old 05-07-2013 , 23:38   [TF2] Assister Domination Quotes (1.3, 2013-08-02)
    Reply With Quote #1

    Description
    Are you tired of getting a domination on an assist and not hearing the sweet domination quotes? Or getting a revenge on an assist and not getting to tell off the person who had been dominating you? Well, no more!

    See Also: Force Domination Quotes, Spy Fake Dominations

    Feature List
    • If you get a domination on someone via an assist, you will now get to spout one of TF2's great domination one-liners.
    • If you get a revenge on someone via an assist, you will now get to spout an insulting retort to your former dominator.
    CVAR/Command List
    • assisterdomination_version - Plugin version
    • assisterdomination_enabled - [0/1] - Set to 0 to disable
    This is a really basic plugin and doesn't do anything else.

    Changelog
    • 2013-08-02 (v1.3)
      • New cvar to disable.
      • Standardized code between this and Spy Fake Dominations
    • 2013-08-02 (v1.2)
      • Fixed a typo that was preventing this from ever working
      • Now checks if a kill was a silent kill and doesn't play the assist domination or revenge sound if it was.
    • 2013-05-11 (v1.1)
      • Fixed an issue where the wrong command was being called, which logged an error in the console
    • 2013-05-07 (v1.0)
      • Initial Release
    Installation Instructions
    Copy the plugin into your addons/sourcemod/plugins/ directory.

    Dependencies
    SourceMod 1.4 and its SDKTools extension

    Plans
    I've considered making a command to let admins force other players to play their domination/revenge lines, but decided not to do that. Perhaps another plugin could be written for that...
    Attached Files
    File Type: sp Get Plugin or Get Source (assister-dominations.sp - 261 views - 3.0 KB)
    __________________
    My SourceMod Plugins
    PropHunt Dev Server: tf2.rbemrose.com:27015
    Testing backlog: PropHunt Redux 3.4, NativeVotes 1.0, NativeVotes MapChooser 1.7

    Last edited by Powerlord; 08-25-2013 at 14:45. Reason: Uploaded version 1.3
    Powerlord is offline
    Powerlord
    Oh Ross.
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 05-07-2013 , 23:39   Re: [TF2] Assister Domination Quotes (1.0, 2013-05-07)
    Reply With Quote #2

    Technical information on manipulating the TF2 Response System.

    This plugin uses TF2's own Response system to work.

    Inside tf2_misc_dir.vpk is the directory scripts/talker/ with has a number of .txt files.

    These text files control the Valve response system.

    To get characters to say their in-game lines, you can look up the response concept you want it to play and figure out what contexts have to be in place before it will work.

    This plugin uses the SpeakResponseConcept input instead of DispatchResponse. This is because DispatchResponse does not appear to work correctly in TF2.

    Here's an example of how to get a specific response working:

    For this, I chose to play the Medic's Melee Dare. The first step is to open up scripts/talker/medic.txt and search for the word Dare. Ignore the first one you find, as it's the Duel version. Eventually, you'll find this:

    Code:
    Response MeleeDareCombatMedic
    {
        scene "scenes/Player/Medic/low/661.vcd"
        scene "scenes/Player/Medic/low/669.vcd"
        scene "scenes/Player/Medic/low/672.vcd"
        scene "scenes/Player/Medic/low/667.vcd"
        scene "scenes/Player/Medic/low/677.vcd"
        scene "scenes/Player/Medic/low/680.vcd"
        scene "scenes/Player/Medic/low/1241.vcd"
        scene "scenes/Player/Medic/low/679.vcd"
    }
    Rule MeleeDareCombatMedic
    {
        criteria ConceptPlayerBattleCry IsWeaponMelee IsMedic IsCrosshairEnemy
        Response MeleeDareCombatMedic
    }
    The Rule is the important one. See the "criteria" line there? Everything after criteria is a space separate list of contexts defined in response_rules.txt

    So, open up scripts/talker/response_rules.txt and look for ConceptPlayerBattleCry
    Code:
    criterion "ConceptPlayerBattleCry" "Concept" "TLK_PLAYER_BATTLECRY" required
    The second argument (Concept) is the rule type. Concepts are special and we'll be sending it to SpeakResponseConcept later. The third ("TLK_PLAYER_BATTLECRY") is its value. The last argument tells us this is required (but pretty much all criteria are).

    Now, unfortunately IsMedic isn't really overridable, as the game resets it too quickly for us to override it.

    UPDATE: The above may not be true. However, when you define two contexts of the same type, only the first one applies. However, you can remove a context like this:

    Code:
    SetVariantString("playerclass");
    AcceptEntityInput(client, "RemoveContext");
    You can remove all existing contexts like this:
    Code:
    AcceptEntityInput(client, "ClearContext");
    END UPDATE
    Lets take a look at it anyway. Here's the definitions for this context:
    Code:
    criterion "IsMedic" "playerclass" "Medic" "required"
    This context isn't a Concept, meaning that it could (in theory) be set using AddContext. We'll talk more about AddContext in a moment.

    Lets look at the last two contexts: IsWeaponMelee and IsCrosshairEnemy

    Code:
    criterion "IsWeaponMelee" "weaponmode" "melee" required
    criterion "IsCrossHairEnemy" "crosshair_enemy" "Yes" "required"
    Remember what I said about AddContext? This is where you want it. It takes a single string argument, which is in format key:value. You can set these contexts by doing this:

    Code:
    #include <sdktools>
    
    ...
    
    SetVariantString("weaponmode:melee");
    AcceptEntityInput(client, "AddContext");
    
    SetVariantString("crosshair_enemy:Yes");
    AcceptEntityInput(client, "AddContext");
    Once you have the contexts set, it's time to call our Concept whose name we saw earlier... and remember to clear the contexts again afterwards.

    Code:
    SetVariantString("TLK_PLAYER_BATTLECRY");
    AcceptEntityInput(client, "SpeakResponseConcept");
        
    AcceptEntityInput(client, "ClearContext");
    I haven't tested this code, so the melee weapon context may be reset too quickly for us to fake it using this method... YMMV.

    Edit: My tf2-data respository contains the talker files, which did not change in the Gun Mettle Update.
    __________________
    My SourceMod Plugins
    PropHunt Dev Server: tf2.rbemrose.com:27015
    Testing backlog: PropHunt Redux 3.4, NativeVotes 1.0, NativeVotes MapChooser 1.7

    Last edited by Powerlord; 07-22-2015 at 10:47.
    Powerlord is offline
    FlaminSarge
    Veteran Member
    Join Date: Jul 2010
    Old 05-09-2013 , 00:48   Re: [TF2] Assister Domination Quotes (1.0, 2013-05-07)
    Reply With Quote #3

    Good to see this ended up working.
    __________________
    Bread EOTL GunMettle will break everything. Don't even ask.

    All plugins: Randomizer/GiveWeapon, ModelManager, BetheHorsemann, etc. (+SaxtonHale)
    Don't ask me about SourceMod stuff on Steam; instead, post in a thread or send PM here. You will be fed to javalia if you don't.
    Psyduck likes replays.
    FlaminSarge is offline
    Powerlord
    Oh Ross.
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 05-10-2013 , 11:16   Re: [TF2] Assister Domination Quotes (1.0, 2013-05-07)
    Reply With Quote #4

    Quote:
    Originally Posted by FlaminSarge View Post
    Good to see this ended up working.
    It now has a sister plugin, Force Domination Quotes. I thought about making them the same plugin, but realized that some server admins will want this plugin and not the other.

    It also occurred to me that I may be able to change which class's quotes are played if I removecontext on the one that sets the player class and then add a new one of my choice...
    __________________
    My SourceMod Plugins
    PropHunt Dev Server: tf2.rbemrose.com:27015
    Testing backlog: PropHunt Redux 3.4, NativeVotes 1.0, NativeVotes MapChooser 1.7
    Powerlord is offline
    cool_myll
    SourceMod Donor
    Join Date: Aug 2011
    Old 05-11-2013 , 08:02   Re: [TF2] Assister Domination Quotes (1.0, 2013-05-07)
    Reply With Quote #5

    Got a lot of error and uninstalled it. Will reinstall to report the exact errors.

    EDIT:
    Quote:
    1/2013 - 15:04:09: [SM] Displaying call stack trace for plugin "assister-dominations.smx":
    L 05/11/2013 - 15:04:09: [SM] [0] Line 46, /home/groups/alliedmodders/forums/files/3/8/9/9/6/119618.attach::Event_PlayerDeath()
    __________________

    Last edited by cool_myll; 05-11-2013 at 08:05.
    cool_myll is offline
    Powerlord
    Oh Ross.
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 05-11-2013 , 12:49   Re: [TF2] Assister Domination Quotes (1.0, 2013-05-07)
    Reply With Quote #6

    Quote:
    Originally Posted by cool_myll View Post
    Got a lot of error and uninstalled it. Will reinstall to report the exact errors.

    EDIT:
    Oh wow, I really derped while creating this... I really wish GetClientUserId and GetClientOfUserId were named more differently.

    Anyway, try this version.
    Attached Files
    File Type: sp Get Plugin or Get Source (assister-dominations.sp - 131 views - 2.5 KB)
    __________________
    My SourceMod Plugins
    PropHunt Dev Server: tf2.rbemrose.com:27015
    Testing backlog: PropHunt Redux 3.4, NativeVotes 1.0, NativeVotes MapChooser 1.7

    Last edited by Powerlord; 05-11-2013 at 12:51.
    Powerlord is offline
    Powerlord
    Oh Ross.
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 08-01-2013 , 12:03   Re: [TF2] Assister Domination Quotes (1.1, 2013-05-11)
    Reply With Quote #7

    Hmm, this plugin may not be working at the moment. Either that or it got disabled on my primary server when I wasn't looking.

    Thought it was weird when I got an assist domination last night and didn't hear my Medic say anything.
    __________________
    My SourceMod Plugins
    PropHunt Dev Server: tf2.rbemrose.com:27015
    Testing backlog: PropHunt Redux 3.4, NativeVotes 1.0, NativeVotes MapChooser 1.7
    Powerlord is offline
    Powerlord
    Oh Ross.
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 08-02-2013 , 12:01   Re: [TF2] Assister Domination Quotes (1.2, 2013-08-02)
    Reply With Quote #8

    OK, thanks to psychonic for pointing out a typo (deathflags should be death_flags). Now, hopefully this plugin will actually work.

    Released version 1.2, changelog is in first post.
    __________________
    My SourceMod Plugins
    PropHunt Dev Server: tf2.rbemrose.com:27015
    Testing backlog: PropHunt Redux 3.4, NativeVotes 1.0, NativeVotes MapChooser 1.7
    Powerlord is offline
    Powerlord
    Oh Ross.
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 08-02-2013 , 20:15   Re: [TF2] Assister Domination Quotes (1.3, 2013-08-02)
    Reply With Quote #9

    Another release already... this time some code improvements, plus there's a new cvar that allows you to disable the plugin.

    This version is also compatible with Spy Fake Domination Quotes v1.0.
    __________________
    My SourceMod Plugins
    PropHunt Dev Server: tf2.rbemrose.com:27015
    Testing backlog: PropHunt Redux 3.4, NativeVotes 1.0, NativeVotes MapChooser 1.7
    Powerlord is offline
    Reply


    Thread Tools
    Display Modes

    Posting Rules
    You may not post new threads
    You may not post replies
    You may not post attachments
    You may not edit your posts

    BB code is On
    Smilies are On
    [IMG] code is On
    HTML code is Off

    Forum Jump


    All times are GMT -4. The time now is 00:04.


    Powered by vBulletin®
    Copyright ©2000 - 2015, vBulletin Solutions, Inc.
    Theme made by Freecode