View Single Post
Author Message
Damizean
SourceMod Donor
Join Date: Mar 2009
Old 08-05-2010 , 14:18   [TF2] Yet Another Dodgeball Plugin (1.0) - 08/05/2010
Reply With Quote #1

[TF2] Dodgeball (1.0)
by Damizean, based on Voogru's mod

What's this?
A game mode inspired in the classic Dodgeball. On this mode, all classes except the Pyro are disabled and the respawn is limited to the same rules as the Arena game mode. Each Dodgeball map has a set of spawn points from where rocket projectiles are fired. These projectiles are designed to follow a target player until the player is killed or the rocket has been deflected.

Based on Voogru's original plugin and similar to Asherkin's plugin, I tried to design this one as flexible as possible without having to mess with the plugin's code.
  • All the parameters of the rocket classes are fully configurable: model, sounds, speed, damage, turn rate, etc.
  • Each rocket uses a small events system wich can be used to extend the functionality of the rockets by the execution of custom commands, so if you can write Sourcemod plugins, you can easily extend the functionality of the rockets.
  • You can independently setup the spawn points by defining their full target name, in case you want an specific spawn point to have a different spawn chances table.
The configuration included with the plugin contains a base rocket setup and a sample nuke rocket type (along with the model and it's 3DS Max source).

Changelog
  • 1.0
    • Initial release.

TODO

  • Extend functionality so map makers can enable/disable spawn points through the entities User Outputs.

How do I install it?
Place the files in the zip on the correct folders:
  • The files placed at the gameserver folder should be placed your game server.
  • The files placed at the fastdownload folder should be placed in your fast download server.
Remember, this plugin will activate itself only on maps that are prefixed as tfdb_, as long as the tf_dodgeball_enabled cvar is set to 1.

Cvars
Some basic cvars are included, but most of the parameter settings is done through the configuration file.
  • tf_dodgeball_version - Version of the plugin.
  • tf_dodgeball_enabled <0/1> - Is the plugin enabled?
  • tf_dodgeball_enablecfg <path> - Config file to be executed when enabling the game mode. Default: sourcemod/dodgeball_enable.cfg
  • tf_dodgeball_disablecfg <path> - Config file to be executed when disabling the game mode. Default: sourcemod/dodgeball_disable.cfg

Config Files
In order to setup the settings of the game mode, the plugin looks for a configuration file, wich should be located at /addons/sourcemod/configs/dodgeball/general.cfg. It contains the general settings, rocket classes and spawn point classes to be used in all the maps. In addition to this one, the plugin will try to look for a map specific configuration file, located at /addons/sourcemod/configs/dodgeball/<map name>.cfg, in wich you can override the default settings or even add new map-specific rocket classes.

The meaning of every parameter of the configuration file is explained on the file itself. The example configuration file is the following:
PHP Code:
// -------------------------------------------------------
// Events
// -------------------------------------------------------
// 
// In order to further customize the rocket types, you can
// set a command to be executed when a certain event happens
// with a dodgeball rocket.
//
// The events that are right now implemented are the following:
//
// on spawn- When a rocket spawns.
// on deflect- A client has deflected a rocket.
// on kill- One of the rockets has killed the client.
// on explode- Same as on kill, only triggered once.
//
// The possible parameters passed for the commands are the following.
//
// @name         - Name of the projectile type
// @rocket       - Rocket entity index
// @owner        - Owner client userid
// @target       - Target client userid
// @dead         - Last dead client
// @speed        - Speed of the rocket
// @deflections  - Number of rocket deflections
// 
// -------------------------------------------------------
// Commands
// -------------------------------------------------------
//
// For using with the events system, the plugin has two useful
// commands if you want to make kickass explosion blasts.
//
// tf_dodgeball_explosion <client>
// Shows a huge explosion at the location of the specified client.
//
// tf_dodgeball_shockwave <client> <damage> <force> <radius> <falloff>
// Wich applies a huge shockwave at the location of the client.
//
// If you are able to write plugins, you can include your custom
// commands too!
// -------------------------------------------------------

"tf2_dodgeball"
{

    
"general"
    
{
        
"music"                            "1"      // Play music on Dodgeball gamemode?
        
        
"round start"                      ""                                          // Music to play on round start
        
"round end (win)"                  ""                                          // Music to play for the winner team
        
"round end (lose)"                 ""                                          // Music to play for the loser team
        
"gameplay"                         ""                                          // Music to play when the gameplay starts
        
        
"use web player"                   "0"      // If the use of web player is enabled, these will be
        
"web player url"                   ""       // used instead of the gameplay music
    
}
    
    
"classes"
    
{
        
"common"
        
{
            
// >>> Basic parameters <<<
            
"name"                        "Homing Rocket"    // Full name of the rocket type
            
"behaviour"                   "homing"           // The only behaviour right now is homing :P
            
"model"                       ""                 // Default: Common rocket model
            
"is animated"                 "0"                // Only works when using a custom model
            
"play spawn sound"            "1"                // Does the rocket emit a sound when spawning?
            
"play beep sound"             "0"                // Does the rocket emit a beeping sound?
            
"play alert sound"            "1"                // Does the rocket emit an alert sound to the client when being targetted?
            
"spawn sound"                 ""                 // Default: Sentry rocket sound
            
"beep sound"                  ""                 // Default: Sentry searching sound
            
"alert sound"                 ""                 // Default: Sentry client spotted sound
            
"beep interval"               "0"                // Emit sound every x time
            
            // >>> Specific behaviour modificators <<<
            
"elevate on deflect"          "1"                // Does the rocket can elevate after deflection?
            
"neutral rocket"              "0"                // Does this rocket has no team based targets?
            
            // >>> Movement parameters <<<
            
"damage"                      "50"               // Base damage done by the rocket.
            
"damage increment"            "25"               // Increment per reflection.
            
"speed"                       "800"              // Base speed for the rocket.
            
"speed increment"             "150"              // Speed increment per reflection.
            
"turn rate"                   "0.215"            // Turn rate / tick for this rocket.
            
"turn rate increment"         "0.0275"           // Increment per deflection.
            
"elevation rate"              "0.1075"           // Elevation rate when deflected (if enabled)
            
"elevation limit"             "0.175"            // Maximum elevation when deflected (if enabled)
            
"control delay"               "0.01"             // Delay until the rocket starts tracking the target after a deflection.
            
"critical chance"             "100"              // Percentage of chance for a critical rocket.
            
"no. players modifier"        "0"                // Increment based upon the number of players in the server. 
            
"no. rockets modifier"        "0"                // Increment based upon the number of rockets fired since the start of the round.
            
"direction to target weight"  "15"               // Weight modifier for target selection, based upon the direction of the rocket
                                                             // to the client.
            // >>> Events <<<
            
"on spawn"                    ""                 // Actions to execute on rocket spawn.
            
"on deflect"                  ""                 // Actions to execute when a rocket is deflected.
            
"on kill"                     ""                 // Actions to execute when a rocket kills a client.
            
"on explode"                  ""                 // Actions to execute when a rocket kills a client (triggered once).
        
}
    
        
"nuke"
        
{
            
// >>> Basic parameters <<<
            
"name"                        "Nuke!"
            "behaviour"                   "homing"
            "model"                       "models/custom/dodgeball/nuke/nuke.mdl"
            "is animated"                 "1"
            "play spawn sound"            "1"
            "play beep sound"             "1"
            "play alert sound"            "0"
            "spawn sound"                 ""
            "beep sound"                  ""
            "alert sound"                 ""
            "beep interval"               "0.5"
            
            
// >>> Specific behaviour modificators <<<
            
"elevate on deflect"          "1"
            "neutral rocket"              "0"
            
            
// >>> Movement parameters <<<
            
"damage"                      "200"
            "damage increment"            "200"
            "speed"                       "600"
            "speed increment"             "100"
            "turn rate"                   "0.233"
            "turn rate increment"         "0.0275"
            "elevation rate"              "0.1237"
            "elevation limit"             "0.1237"
            "control delay"               "0.01"
            "critical chance"             "100"
            "no. players modifier"        "0"
            "no. rockets modifier"        "0"
            "direction to target weight"  "25"
            
            
// >>> Events <<<
            
"on spawn"                    ""
            "on deflect"                  ""
            "on kill"                     ""
            "on explode"                  "tf_dodgeball_explosion @dead ; tf_dodgeball_shockwave @dead 200 1000 1000 100"
        
}
    }
    
    
"spawners"
    
{
        
// >>> Default RED spawner <<<
        
"red"
        
{
            
// >>> Basic parameters <<<
            
"max rockets"            "1"                // Max no. of rockets before the spawner can fire another.
            
"interval"               "2.0"              // Minimum time between rocket fires.
            
            // >>> Chances table <<<
            
"common%"                "90"               // Chance to spawn a common rocket
            
"nuke%"                  "10"               // Chance to spawn a nuke rocket
        
}
        
        
// >>> Default BLU spawner <<<
        
"blu"
        
{
            
// >>> Basic parameters <<<
            
"max rockets"            "1"               // Max no. of rockets before the spawner can fire another.
            
"interval"               "2.0"             // Minimum time between rocket fires.
            
            // >>> Chances table <<<
            
"common%"                "90"              // Chance to spawn a common rocket
            
"nuke%"                  "10"              // Chance to spawn a nuke rocket
        
}
    }

Resource files
The plugin implements a resources precacher like the one in the Equipment Manager plugin. The sound files will be automatically precached and added to the download list, and for each model file the plugin will automatically search for a .res file with the same name, in wich every line is a dependency for the model.

For example, with the model called "nuke.mdl", the plugin will search for a file called "nuke.mdl.res". It'll precache and add to the downloads table all the files listed on it:
Code:
materials\models\custom\dodgeball\nuke\nuke_blu.vmt
materials\models\custom\dodgeball\nuke\nuke_blu.vtf
materials\models\custom\dodgeball\nuke\nuke_red.vmt
materials\models\custom\dodgeball\nuke\nuke_red.vtf
materials\models\custom\dodgeball\nuke\nuke_neutral.vmt
materials\models\custom\dodgeball\nuke\nuke_neutral.vtf
models\custom\dodgeball\nuke\nuke.dx80.vtx
models\custom\dodgeball\nuke\nuke.dx90.vtx
models\custom\dodgeball\nuke\nuke.mdl
models\custom\dodgeball\nuke\nuke.phy
models\custom\dodgeball\nuke\nuke.sw.vtx
models\custom\dodgeball\nuke\nuke.vvd
Remember! Set the proper whitelist entries if you're going to use the nuke on a pure server! The locations of the files are the ones listed above.

Thanks to
Downloads
Where do I get maps?
This plugin is compatible with the maps created for Asherkin's TFDodgeball. Find maps on his thread:
http://forums.alliedmods.net/showthread.php?t=127034
__________________
Dat annoying guy

Last edited by Damizean; 08-05-2010 at 15:13.
Damizean is offline
Send a message via AIM to Damizean Send a message via MSN to Damizean