[Home]  [Edit this page]  [Recent Changes]  [Special Pages]  [Help
Beginners-Guide-Scripting

Beginners Guide Game Scripting

This is a thorough overview of scripting languages as used in many Game engines. Since most Game engines have their own scripting - or at least a version of C-script - the following overview should also be useful for developers that use different scripting languages.

Object Oriented Scripting

The scripting language described here - C-script - is an object oriented scripting language, using methods, packages, datablocks and functions.

Object oriented in this case means that it uses a predefined object modell - similar to JavaSripts object modell tree - to create new instances of these objects.

SimObject %myObject = new SimObject; //create a new SimObject
Player %myPlayer = new Player; //new Player object
myPlayer.addItem("Ammo"); //add new ammo to player weapon arsenal


In the examples above, 2 new objects are created using the new operator. The first line of code above creates a new SimObject. A SimObject is the base object of any character object, that is aiPlayer or Player objects. Every new object or variable is prefixed either with % or $. The $ symbol is used to denote string variables.

$myPlayerName = "Doom";
%hour = (60*60 *60);


functions, packages and datablocks



last edited (July 26, 2004) by athomas, Number of views: 3410, Current Rev: 1

[Edit this page]  [Page history]  [What links here]  [Discuss this topic]  [Printer Friendly]  

Members

Username:

Password:


Register
Forgot Password?




Programmers Heaven - for .NET, Java, C/C++ and WEB Developers!
© 1996-2008 Community Networks Ltd. All rights reserved. Reproduction in whole or in part, in any form or medium without express written permission is prohibited. Violators of this policy may be subject to legal action. Please read Terms Of Use and Privacy Statement for more information. Development by Tore Nestenius at .NET Consultant - Synchron Data.