- EventScripts
EventScripts is a free game scripting
plugin forValve Corporation 'sSource engine . Aimed at first-time scripters, EventScripts has grown to be one of the most popular Source scripting engines, running on over 10,000 dedicated game servers worldwide as of January 2008. [http://www.game-monitor.com/search.php?search=eventscripts_ver&type=variable]Overview
EventScripts is a plugin for Valve's Source engine that allow custom scripts to execute on the server. The engine is heavily event-driven, as the name implies, allowing a scripter or game server administrator to take action whenever an event occurs in the game. It also allows scripts to register server console commands themselves [http://www.eventscripts.com/pages/Es_regcmd] and interact heavily with the Source engine to create effects [http://www.eventscripts.com/pages/Es_effect] and interact with players/entities.
Over time the goals of the project have evolved into maintain backwards compatibility, providing a simple interface for non-experts, and delivering active support and help via forums. In this way, EventScripts continues to be an important factor in the Source gaming community, particularly for
Counter-Strike Source .The scripting engine of EventScripts supports two different scripting styles.
EventScripts Classic
EventScripts Classic is not unlike a command-line shell (like
bash ) built on top of the Source engine's console. It was designed to be simple to use for administrators since experienced coders have access to creating Source plugins [http://www.valve-erc.com/srcsdk/Code/ServerPlugins.html via Valve's Source SDK] inC++ .EventScripts Python
As of EventScripts 2.0, the plugin includes full Python scripting support as an alternative language to EventScripts Classic. The focus again is on providing libraries and wrappers that make it easy to script against, while still providing access to all the power of the existing Python language and standard library.
How it works
At its core, EventScripts is just a Valve Source Plugin which passes information it receives from the Source engine to loaded scripts. When an administrator loads a script (typically through a configuration file via "es_load
"), EventScripts parses out the block structures in the file and stores them in memory. When an event fires, EventScripts passes the registered parts of the script to the Valve command console and stores the event-specific information if a script later needs it. Almost all interaction between scripts and the Source engine happens through special console commands that EventScripts or other plugins register. This allows the scripts to interact with any other plugin (e.g. an admin plugin) that also register console commands for admins.
A simple example script for EventScripts Classic would look like this: event player_hurt { // tell the victim who hit them es_tell event_var(userid) You were attacked by event_var(es_attackername) }
In the example above, "es_tell" is simply an EventScripts console command registered with the game engine. When the game console executes it, EventScripts is given control and expands all of the variables on the line before executing the line's logic.
In EventScripts 2.0, support for the Python scripting language was added. An example script would look like this:
History
The EventScripts plugin was initially released in December 2004 by
Mattie Casper . Originally the design was to allow administrators to automatically invoke configuration (*.cfg) files whenever important game events happened. In this way, administrators could do things like change the gravity upon round start, or invoke commands for popular administrator addons likeMani Admin Plugin . [http://forums.mattie.info/cs/forums/viewtopic.php?t=29] . The cross-interaction with other plugins really drove a lot of EventScripts initial popularity.In 2005, by community request, EventScripts was updated to become more powerful, adding console commands for logic operations (if/then, while, etc) and the notion of "script packs" [http://www.eventscripts.com/pages/Script_Authoring] which allowed for grouping of event-based configuration files. The popularity of the plugin grew rapidly in this timeframe as the community released dozens and dozens of scripts to the public, like the popular MugMod (originally a plugin) and GunGame scripts.
In 2006, EventScripts 1.0 was released. This introduced a new script structure that allowed authors to create stand-alone script files without relying on packs of multiple .cfg files. This structure also provided block-based language constructs that allowed for loops, advanced conditions (via if/else), and custom console, say, and client commands. [http://forums.mattie.info/cs/forums/viewtopic.php?t=4844] Important feature releases improved performance in 2006 and early 2007 via the 1.2 [http://forums.mattie.info/cs/forums/viewtopic.php?t=8322] and 1.3 [http://forums.mattie.info/cs/forums/viewtopic.php?t=9894] releases. During 2006, the popular support plugin ES_Tools was released to provide access to deeper things within the Source engine which EventScripts could not or did not yet offer.
In May 2007, EventScripts 1.5 was released and provided support for SQLite databases, regular expressions, and a variety of other modern language features. In this release, EventScripts changed its server variable expansion dramatically to improve performance. During this time, the project took on the Evie zebra mascot.
In October 2007, EventScripts 2.0 was released to public beta. This version allows for full-fledged Python scripting on Windows and
Linux game servers. Scripts are loaded a lot like Python modules, but they support a simplified syntax that automatically registers events and code blocks. Python offers a huge library of existing functionality and tutorials, so this gives a Source server a lot more access to just about anything supported by normal Python applications.Script Addons
There are over a thousand addons written for EventScripts. For a growing list, see Script Addons in the external links below.
Some of the most popular scripts are featured on hundreds or thousands of servers:
* [http://www.cagemonkey.org/forum/viewforum.php?f=6 GunGame] , written by cagemonkey, is a modification that changes the dynamic of Counter-Strike: Source to become a race to get at least one kill with every gun. A challenging ending calls for someone to kill another player with only a knife and then only a single hand grenade. This has become popular enough to be backported to the original Counter-Strike.
* [http://forums.mattie.info/cs/forums/viewtopic.php?t=5046 MugMod] is a simple addon that gives player's the ability to steal the money of their victims when they kill them with a knife.
* [http://addons.eventscripts.com/addons/view/ba_bank ba_bank] allows players to store and withdraw money from a virtual bank each round.External links
* [http://mattie.info/cs EventScripts release page]
* [http://www.eventscripts.com EventScripts Classic official reference site]
* [http://python.eventscripts.com EventScripts Python official reference site]
* [http://addons.eventscripts.com EventScripts - script list]
Wikimedia Foundation. 2010.