EventScripts
Encyclopedia
EventScripts is a free game scripting plugin for Valve Corporation
's Source engine
. Aimed at first-time scripters, EventScripts has grown to be one of the most popular Source scripting engines, running on more than 5,000 dedicated game servers worldwide as of December 2010.
http://www.game-monitor.com/search.php?search=eventscripts_ver&type=variable
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.
.
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.
"), 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
programming language was added. An example script would look like this:
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. Thus giving Python a huge leap over the original scripting language ES.
Some of the most popular scripts are featured on hundreds or thousands of servers:
Valve Corporation
Valve Corporation is an American video game development and digital distribution company based in Bellevue, Washington, United States...
's Source engine
Source engine
Source is a 3D game engine developed by Valve Corporation. It debuted in June 2004 with Counter-Strike: Source and shortly thereafter Half-Life 2, and has been in active development ever since...
. Aimed at first-time scripters, EventScripts has grown to be one of the most popular Source scripting engines, running on more than 5,000 dedicated game servers worldwide as of December 2010.
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 via Valve's Source SDK in C++C++
C++ is a statically typed, free-form, multi-paradigm, compiled, general-purpose programming language. It is regarded as an intermediate-level language, as it comprises a combination of both high-level and low-level language features. It was developed by Bjarne Stroustrup starting in 1979 at Bell...
.
EventScripts Python
As of EventScripts 2.0, the plugin includes full PythonPython (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
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_loadAlmost 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
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
programming 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 like Mani 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
Python (programming language)
Python is a general-purpose, high-level programming language whose design philosophy emphasizes code readability. Python claims to "[combine] remarkable power with very clear syntax", and its standard library is large and comprehensive...
scripting on Windows
Microsoft Windows
Microsoft Windows is a series of operating systems produced by Microsoft.Microsoft introduced an operating environment named Windows on November 20, 1985 as an add-on to MS-DOS in response to the growing interest in graphical user interfaces . Microsoft Windows came to dominate the world's personal...
and Linux
Linux
Linux is a Unix-like computer operating system assembled under the model of free and open source software development and distribution. The defining component of any Linux system is the Linux kernel, an operating system kernel first released October 5, 1991 by Linus Torvalds...
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. Thus giving Python a huge leap over the original scripting language ES.
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:
- 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.
- 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.
- ba_bank allows players to store and withdraw money from a virtual bank each round.