EventScripts

From Valve Developer Community
Jump to navigation Jump to search
Broom icon.png
This article or section needs to be updated to include current information regarding the subject.
Remember to check for any notes left by the tagger at this article's talk page.

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 over 8900 dedicated game servers worldwide as of July 2007. [1]

Warning.pngWarning:This plugin is outdated and is broken[confirm]
float

Overview

As of version 1.5, the scripting engine of EventScripts is similar to a command-line shell (like batch) 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++.

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 [2] and interact heavily with the Source engine to create effects [3] and interact with players/entities.

Over time the goals of the project have evolved into ensuring eternal 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.

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 <script>"), 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 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.

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. [4]. The cross-interaction with other plugins really drove a lot of EventScripts initial popularity.

'Evie' the EventScripts community mascot.

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" [5] 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. [6] Important feature releases improved performance in 2006 and early 2007 via the 1.2 [7] and 1.3 [8] 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.

Script Addons

There are hundreds and hundreds of addons written for EventScripts. For a growing list, see Script Addons in the External links below.

There are a handful of scripts that are very popular, featured on hundreds or thousands of servers:

  • Gun Game, 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.

External links

3rd Party Information for Steam Publishing

Description

EventScripts is a free game scripting plugin for the Source engine. Aimed at first-time scripters, EventScripts is one of the most popular Source scripting engines, running on thousands of dedicated game servers worldwide. Popular Counter-Strike: Source adaptations like Gun Game and MugMod are built on this engine.

Screenshots (Scripts)

Turtles3.jpg Emote.JPG BA BANK.JPG Quad.jpg Waterguns2.jpg

Game page header

ES modHeader.png

Small game capsule

ES modHeader small.png