Sign in to follow this  
Busterwolf

What Is A Scripted Event?

Recommended Posts

I've never been quite clear on what exactly a "Scripted Event" is. If anyone could please help me out with this, I'd appreciate it. Thanks for reading.

Share this post


Link to post
Share on other sites
In levels, it usually refers to a scene that's set up beforehand by the level-designer. For example, the chat that your fellow soldiers are having, that's being interrupted by a tank coming through a wall. Every time you play that level again, it's exactly the same, which is a clear indicator that it's a scripted scene.

Share this post


Link to post
Share on other sites
In terms of gameplay you could also think of some features that are "core gameplay elements" such as enemy AI, picking up goodies, pulling levers to open doors etc. So when you run around a level, trying to shoot the bad guys, they will behave in a semi-intelligent manner that can be different for each playthrough (although it'll probably be a quite predictable behaviour). They'll do this by using the core game mechanics.

Whenever the game needs something more complex and interesting (usually to further a story or something) the game designers will insert a "scripted event" where they take full control of the game world and game characters to make them do something that is so complex that the core game mechanics isn't enough.

Share this post


Link to post
Share on other sites
Yep. A scripted event is usually an event that it happening NOT because of in-game physics or A.I. for instance, but one that was "hard-coded" beforehand to always happen in the same way when the player performs a certain action or arrives at a certain point in a level.

Share this post


Link to post
Share on other sites


Events are usually triggered by a standard (hard-coded) mechanism in a game engine. A scripted event is an event that invokes a script. The script can contain alot of customized logic and do alot of specialized game actions. Different scripts can be selectively assigned (hooked) to event callbacks on different objects to give them significantly different behaviors/result. Script mechanisms in the game engine are often seperated/independant allowing easier recompilation and debug/modification and are simpler languages for non/semi-programmers to learn/use. A script system can be made isolated/restricted from the game engine's data and thus protect from crashes (which makes debugging alot easier).

Game scenario logic can be quite complex and that event tied logic can be voluminous. Scripts offer flexibility and ease to the task of building the logic that the game require (and will require alot more in future).




Example:

OnDestroyed is a standard 'event' for all objects in a game which is triggered when an object meets the criteria for being destroyed.

A script would be attached to ObjectA's OnDestoyed event hook.

That script would then have logic to do all the specialized things that ObjectA
needs to have done in the game when destruction occurs(ie- special combination of animation sequences and sound effects, and scenario flags for the games plot line logic). Calls to game engine routines might be called with parameters specific to ObjectA and specific/custom if-then logic to handle the consequences of ObjectA's destruction. Events can trigger other events and set up complex scenario sequences.

Many simple objects may have a default 'OnDestroyed' behavior and be hooked to the same minimal 'default_OnDestroyed' script for their type of object.





Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this