Raised This Month: $12 Target: $400
 3% 

[TF2] GunGame Fortress 2 (11/24/2012)


Post New Thread Reply   
 
Thread Tools Display Modes
Author
Erreur 500
Senior Member
Join Date: Aug 2012
Location: Paris, France
Plugin ID:
3192
Plugin Version:
2.03
Plugin Category:
Gameplay
Plugin Game:
Team Fortress 2
Plugin Dependencies:
    Servers with this Plugin:
     
    Plugin Description:
    Play GunGame mod like in CS:S but here for TF2
    Old 08-22-2012 , 10:18   [TF2] GunGame Fortress 2 (11/24/2012)
    Reply With Quote #1

    GunGame Fortress 2





    New UPDATE (11/24/2012) : See change log


    Description

    Play GunGame mod, like in CS:S but here for Team Fortress 2.
    You play with only one weapon, and for each kill, you upgrade to a new level. The first player on the last level, win the round !

    When a player make 5 kills in a row, he's got a bonus : +200 healts =) .
    When a player have 5 deads and never kill, he downgrade 1 level =( .
    At the end, the winner is add on the data-base and show his number of victory.






    How does it work ?

    On this GunGame mod, you can enable or disable GunGame mod with the CVAR : gg_enabled

    By default, this plugin just run in gg_ map and dm_ , but it can run in other maps: disable gg_gungame_map

    Assister kill can be include in the rank. If gg_assist 1, 2 assisters kills = level up !

    You can choose how much level do you want play. They don't have limit, but they must have the same levels in gungame_levels.cfg as CVAR gg_level or less.
    You choose each weapons that you play on each level and class that correspond like this :

    PHP Code:
    "GunGame Weapons"
    {
        
    "0"                          // Level number
        
    {
            
    "index" "160"         // Weapon Index during this level
            
    "class" "scout"      // Class name during this level
        
    }
        
    "1"
        
    {
            
    "index" "22"
            "class" "engineer"
        
    }
        
    "2"
        
    {
            
    "index" "425"
            "class" "heavy"
        
    }
        
    "3"
        
    {
            
    "index" "36"
            "class" "medic"
        
    }
     
         
    // ...
         // continue on for all levels that you want to play.
         // ...
     
        
    "25"
        
    {
            
    "index" "331"
            "class" "heavy"
        
    }
        
    "26"
        
    {
            
    "index" "423"
            "class" "spy"
        
    }
     



    (More information for weapon's index: here)

    DEFAULT :
    Here, in this example, the last level number is : 26
    So gg_level = 26.

    YOUR:
    If you change level number for add more or delete level, think to change gg_level with your level number !



    CVARS

    Code:
    gg_enabled => (def : 1)            ==> Enable or disable GunGame Fotress 2
    gg_gungame_map => (def : 1)  ==> Enable or disable only GunGame Fortress 2 on map gg_ and dm_
    gg_level => (def : 26)                ==> Number of level to play.
    gg_assist => (def : 1)                 ==> Enable or disable Assister rank




    Where does it work ?


    If gg_gungame_map = 1 , it work only on gg_ and dm_ maps

    Else it work on all map, but i recommend to create special map for this mod, where they no have control-point, play-load or documents.
    I post 2 maps specially for this mod and others later.
    gg_office by me, and gg_violet_1 by erreur403.
    If you are a good mappers, create and post your map gg_ or dm_




    How to install ?

    Need for work :
    - morecolors.inc
    - TF2 Items
    - [TF2 Items] Give Weapon

    Decompress GunGame_Fortress2.zip, and place the folders on your game server.
    Decompress gg_office.zip, and place the .bsp files in your tf/maps.






    Server Example :

    Max-Play.pl







    Change Log

    Code:
    v2.03
     
    Fixe some array errors.
    Delete one variable and somes events.
    Add some security and logs.
    Change gungame_levels.cfg.
     
     
     
    v2.02
     
    Fixe levels problems for first spawn.
    Add fixes by FlaminSarge.
     
     
     
    v2.01
     
    Fixe 2 bugs : 
    - Restart Rank when round restart, waiting end, setup end.
    - Stop ranking between 2 round.
     
    Add Assister rank : 2 assister kill = level up. You can now play with medic gun, jarate ... 
    Add Cvar for enabled or disabled assister rank : gg_assist
     
    Change gg_levels.cfg : Add 1 more level with medicgun. Total = 26 defaults levels
     
     
    v2.00
     
    Change CVARs in GunGame_Fortress2.cfg
    Change GunGame_Fortress2.cfg => gungame_maps.cfg
     
    Add a new systeme to choose weapons and class :
       - Delete Weapons list and 51 CVARs
       - Add gungame_levels.cfg for select weapon index to use on each level and select class.
       - You choose class to use for specific weapon : No weapon class conflit.
       - You can choose all weapons that you want.
     
     
    v1.01
     
    Add a "map check" where this plugin can only work on gg_ and dm_ map
    Add gg_violet_1 by erreur403
     
     
    v1.00
     
    Initial




    Thanks To

    Mecha the Slag who inspired me, with his GunGame mod.
    Powerlord who help me for create key value file.
    FlamingSarge for fixes bugs.
    Attached Files
    File Type: zip gg_office.zip (1.14 MB, 692 views)
    File Type: zip gg_violet_1.zip (109.9 KB, 562 views)
    File Type: zip GunGame_fortress2 v2.03.zip (388.1 KB, 891 views)
    __________________
    My public creation : PortalMod - Free Duels - Unusual Effects - Particle fireworks - !stuck

    Need private plugin ? We can found an agreement !
    Steam : Erreur 500

    Last edited by Erreur 500; 01-23-2013 at 12:03. Reason: update
    Erreur 500 is offline
    lucasdidur
    Senior Member
    Join Date: Jan 2011
    Location: Brazil
    Old 08-22-2012 , 10:22   Re: [TF2] GunGame Fortress 2
    Reply With Quote #2

    This is awesome, can't wait to install on my server. Thank you.
    __________________



    lucasdidur is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 08-22-2012 , 10:55   Re: [TF2] GunGame Fortress 2
    Reply With Quote #3

    Wouldn't it be easier to store the weapons list in a file (KeyValues?) and load it into an array (or adt_array) in memory from there?
    __________________
    Not currently working on SourceMod plugin development.
    Powerlord is offline
    lucasdidur
    Senior Member
    Join Date: Jan 2011
    Location: Brazil
    Old 08-22-2012 , 11:13   Re: [TF2] GunGame Fortress 2
    Reply With Quote #4

    My server crash on first round. And I have 2 sugestions:


    * Make a MapCheck(), to enable only in gg_ maps.
    * Change gg_enabled on sourcemod cfg folder.
    __________________



    lucasdidur is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 08-22-2012 , 11:24   Re: [TF2] GunGame Fortress 2
    Reply With Quote #5

    Quote:
    Originally Posted by lucasdidur View Post
    And I have 2 sugestions:
    * Make a MapCheck(), to enable only in gg_ maps.
    I haven't tested this, but wouldn't it work on any Arena game mode, or does it do instant respawns?
    __________________
    Not currently working on SourceMod plugin development.
    Powerlord is offline
    Erreur 500
    Senior Member
    Join Date: Aug 2012
    Location: Paris, France
    Old 08-22-2012 , 11:48   Re: [TF2] GunGame Fortress 2
    Reply With Quote #6

    Quote:
    Wouldn't it be easier to store the weapons list in a file (KeyValues?) and load it into an array (or adt_array) in memory from there?
    I don't know, because for now I don't know how to create file with key values.


    Quote:
    My server crash on first round
    For me, I tested on 2 of my server, and it work without crash.
    When does it crash ?


    Quote:
    Make a MapCheck(), to enable only in gg_ maps.
    I will make this in the futur version.


    Quote:
    wouldn't it work on any Arena game mode, or does it do instant respawns?
    Don't need instant respawn, and it work in arena game mod.
    __________________
    My public creation : PortalMod - Free Duels - Unusual Effects - Particle fireworks - !stuck

    Need private plugin ? We can found an agreement !
    Steam : Erreur 500

    Last edited by Erreur 500; 08-22-2012 at 11:57.
    Erreur 500 is offline
    AeroAcrobat
    AlliedModders Donor
    Join Date: Apr 2011
    Location: lives in a circus
    Old 08-22-2012 , 12:19   Re: [TF2] GunGame Fortress 2
    Reply With Quote #7

    oh man super awesome!
    do bots work with this ?

    I will try it later, thank you!
    __________________
    AeroAcrobat is offline
    Steell
    SourceMod Donor
    Join Date: Mar 2009
    Old 08-22-2012 , 12:34   Re: [TF2] GunGame Fortress 2
    Reply With Quote #8

    Just so you know, there is already an existing GunGame mod for TF2: https://forums.alliedmods.net/showthread.php?t=161307

    However, it doesn't appear to be as customizable as this one.
    __________________
    Steell is offline
    pac_man0
    Junior Member
    Join Date: Mar 2012
    Location: Brazil
    Old 08-22-2012 , 12:37   Re: [TF2] GunGame Fortress 2
    Reply With Quote #9

    Quote:
    Originally Posted by Steell View Post
    Just so you know, there is already an existing GunGame mod for TF2: https://forums.alliedmods.net/showthread.php?t=161307

    However, it doesn't appear to be as customizable as this one.
    Some people posted that it crashes the server
    pac_man0 is offline
    Powerlord
    AlliedModders Donor
    Join Date: Jun 2008
    Location: Seduce Me!
    Old 08-22-2012 , 12:54   Re: [TF2] GunGame Fortress 2
    Reply With Quote #10

    Quote:
    Originally Posted by Erreur 500 View Post
    I don't know, because for now I don't know how to create file with key values.
    KeyValues files aren't that hard to create. They look something like this:

    Code:
    "GunGame Weapons"
    {
        "1"    "160"
        "2"    "22"
        "3"    "425"
        "4"    "36"
        "5"    "45"
        "6"    "16"
        "7"    "171"
        "8"    "37"
        "9"    "40"
    // continue on for all weapons
    }
    If you wanted to get really fancy, you could put the class in there, too, rather than restricting the class based on the index in your code.

    Code:
    "GunGame Weapons"
    {
        "1"
        {
            "index" "160"
            "class" "scout"
         }
        "2"
        {
            "index" "22"
            "class" "engineer"
        }
        "3"
        {
            "index" "425"
            "class" "heavy"
          }
        
    // continue on for all weapons
    }
    Note: You can convert a class name to a TFClassType value using TF2_GetClass.

    No, the hard part is processing a KeyValues file. For example, the first example would processed like this:

    PHP Code:
    #define FILENAME "gg_weapons.kv"

    new Handle:g_WeaponsList;

    new 
    String:g_Filename[PLATFORM_MAX_PATH];

    public 
    OnPluginStart()
    {
        
    g_WeaponsList CreateArray();

        
    BuildPath(Path_SMg_Filenamesizeof(g_Filename), "configs/%s"FILENAME);
    }

    public 
    OnMapStart()
    {
        
    // Reset weapon list
        
    ClearArray(g_WeaponsList);
        new 
    Handle:kv CreateKeyValues("GunGame Weapons");
        
        
    FileToKeyValues(kvg_Filename);
        
        if (!
    KvGotoFirstSubKey(kvfalse))
        {
            
    SetFailState("Could not read weapons file: %s"g_Filename);
        }
        
        do
        {
            new 
    item KvGetNum(kvNULL_STRING, -1);
            if (
    item > -1)
            {
                
    PushArrayCell(g_WeaponsListitem);
            }
        } while (
    KvGotoNextKey(kvfalse));

    The second example is problematic, as we'd end up needing two arrays: one for weapons and a second for their classes. Never-the-less, here's how to do it:

    PHP Code:
    #define FILENAME "gg_weapons.kv"

    new Handle:g_WeaponsList;
    new 
    Handle:g_ClassList;

    new 
    String:g_Filename[PLATFORM_MAX_PATH];

    public 
    OnPluginStart()
    {
        
    g_WeaponsList CreateArray();
        
    g_ClassList CreateArray();
        
        
    BuildPath(Path_SMg_Filenamesizeof(g_Filename), "configs/%s"FILENAME);
    }


    public 
    OnMapStart()
    {
        
    // Reset weapon list
        
    ClearArray(g_WeaponsList);
        
    ClearArray(g_ClassList);
        
        new 
    Handle:kv CreateKeyValues("GunGame Weapons");
        
        
    FileToKeyValues(kvg_Filename);
        
        if (!
    KvGotoFirstSubKey(kv))
        {
            
    SetFailState("Could not read weapons file: %s"g_Filename);
        }
        
        do
        {
            
    decl String:classString[16];
            
    KvGetString(kv"class"classStringsizeof(classString));
            
            new 
    TFClassType:class = TF2_GetClass(classString);
            
            new 
    item KvGetNum(kv"index", -1);
            if (class != 
    TFClass_Unknown && item > -1)
            {
                
    PushArrayCell(g_WeaponsListitem);
                
    PushArrayCell(g_ClassList, class);
            }
        } while (
    KvGotoNextKey(kv));

    Note: I haven't tested any of this code; I only know that it compiles.

    Note 2: You'd need to set MaxRank to GetArraySize(g_WeaponsList) instead of having a cvar for it.
    __________________
    Not currently working on SourceMod plugin development.
    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 02:03.


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