C-script/wdl quick reference guide

 

 

Includes Template stuff the included prewritten game codes plus your own

include <movement.wdl>; // Movement functions
include <venture.wdl>; // include Venture Script

Variables Names a position in memory to hold data

var v1 = 7;

var v1 = 13;

Functions A segment of code to perform a set operation

// this function takes an entity pointer as argument.
function flare_init(ent)
{
my = ent; // necessary, because my.bright = on works, but ent.bright = on won't work!
my.bright = on;
my.flare = on;
ent_alphaset(0,10);
}

Strings Variables to hold text data

string my_first_name = "Guardian";//string containing my name

function my_name()

{

msg.visible = on;//messages are now visible

msg.string = my_first_name;//name of the string I want displayed

}

on_p = my_name;when I press P cal the function "my_name"

Loops A segment of code to do repeated operations until ended

While(x < 100) // repeat while x is lower than 100
{
x+=1;
}

Entity A game element or actor with certain characteristics

action entity_rotate {
while (1){
my.PAN+= 3;
wait(1);
}
}

Actions A segment of code to perform action by an entity

action ent_rotate {
while (1) {
my.pan += my.skill1*time;
wait(1);
}
}

Events A coded instruction to trigger certain other related segments of code

function my_event()

{

my.ENABLE_impact = ON; // sensible for impact
my.EVENT = bounce_event; }

Vectors Movement direction in 3d space

distance = vec_dist(my.x,your.x); // calculate distance of MY and YOU entities

Pointers Pointers store references to objects, just like variables store numbers.

entity* my_player;

action move_player

{

my_player=me;

}

Panels Graphics images to desplay game information.

Panels.txt

Text Onscreen text to inform the player of something is happening in game.

String my_string = "Dies ist ein Text!!";

font standard_font = <panfont.pcx>,8,10;

text my_text
{
pos_x = 20;
pos_y = 40;
font = standard_font;
string = my_string;
}

function show_my_text { my_text.visible = ON; }

Views Create alternative camera views, like rocket, reareview, or multiplayer games. The predefined default view is called CAMERA.

Database and Dataview Defines a database. The database is split into records (rows) and fields (columns) like a spreadsheet table.

Database.txt

Multiplayer Professional and commercial GameStudio editions you can connect through a local area network or the Internet, or two PCs through a modem or serial connection.

http://www.gameresource.de/aum/aum19/english/aum19/index.html

Starter Window Definitions The first line defines the starting window, the second the size of the game window, the third one the window which appears after the end of the game.

Window.txt

Intro Movies Plays a movie or audio stream on the screen or on a texture or panel.

// Play music"ribanna.mid" at 50% volume endlessly.

handle = media_loop("ribanna.mid",null,50);

// Play film"news.avi" on the tv_model entity with maximum volume

media_play("news.avi",bmap_for_entity(tv_model,0),100);