say signindex; displays signs - Signs have to be defined in the level editor, this will simply display it.
if (playertouchsme){
say 0;
}
Displays the sign "0".
say2 text; displays text as a sign - Displays the specified text in a graphic like a sign.
if (playerenters){
say2 Welcome to This Town!;
}
Will display a sign that reads "Welcome to This town!".
lay itemname; lays an item - Drops the item of the specified name (names are found in the item list).
if (playertouchsme){
lay darts;
}
Will lay the item "darts" when touched.
lay2 itemname,x,y; lays an item to the specified position - Puts the specified item at the specified location.
if (weaponfired){
lay2 fullheart,playerx+5,playery;
}
This weapon, when fired, will lay a full heart 5 spaces to the right of the player.
take itemname; takes an item if available - This will cause the NPC to take any item close to it that has the same name as specified with "itemname".
if (playerlaysitem){
take greenrupee;
}
This will make the NPC take a green rupee if that's what the player laid.
take2 index; takes the item with the specified index - The NPC will only take the item with the specified index.
for (i=0;i
if (items[i].type==1){
take2 i;
}
}
Of all the items currently on the level, whichever ones are of type 1 (a blue rupee) they will be taken.
message text; displays a text message over the npc - Same thing as when a player chats, its a text message displayed above the NPC.
if (playertouchsme){
message Don't touch me!;
}
NPC will display the text "Don't touch me!" when it's touched.
timershow; lets the npc's timeout be shown - Shows the amount of time left until a timeout is reached (only displays it in whole number increments).
if (playertouchsme){
timeout=20;
timershow;
}
Displays the amount of time left for the NPC to reach 0 on its timeout.
showcharacter; displays a player character instead of the npc image - Instead of showing the gif file specified, this will cause the NPC to look like a player (it reads from sprites.gif). With this you can set it's sprites, clothes, head gif, sword, and shield.
if (created){
showcharacter;
}
Displays a character when created.
setcharprop messagecode,string; sets string properties of the character - Allows you to change numerous string values for a showcharacter NPC. The "messagecode" can be found in section 13.
if (created){
showcharacter;
setcharprop #3,head173.gif;
}
This will set the character's headgif file to head173.gif.
setcharani anifile,param1,param2...; This sets the animation file of the character. "params" are passed by the NPC and read by the .gani
if (timeout){
setcharani walk.gani;
}
When there is a timeout, the character's animation will be set to "walk.gani".
setchargender gender; sets the gender of the npc (male/female) - Assigns the gender of the NPC.
if (created){
showcharacter;
setchargender female;
}
This will make the created showcharacter a female (only changes things like the voice for it).
putnpc imgname,scriptname,x,y; creates a npc, scriptname is the name of a textfile containing the npc script - Puts a new NPC on the board with the specified script, and image at the specified location. The script has to be a .txt file with all the script the NPC is supposed to do written inside.

if (washit){
putnpc bomb.gif,npcbomb.txt,x,y;
}
Puts a NPC with the gif of bomb.gif and the script of npcbomb.txt at the NPC's x,y when hit.
putnpc2 x,y,{script} creates a npc at x,y with given script - This is like putnpc but instead of needing a text file and an image, all of that is handled within the { } as a script.
if (washit){
putnpc2 x+3,y,{
if (created){setimg bomb.gif;timeout=3};
if (timeout){putexplosion 2,x,y;destroy};
}

}
When this NPC is hit, it will place a NPC near it that will automatically set its own gif to "bomb.gif" and its timeout to 3. After the timeout, the NPC will putexplosion on itself, then destroy itself.
callnpc index,flag; calls the script of another npc (not immediatelly) - Makes the npc execute the script of another npc under the flag specified. May take up to .05 seconds for the script to execute.
//Currently executing NPC
if(testnpc(x,y)>0){
callnpc testnpc(x,y),washit;
}
//NPC at (x,y)
if (washit){
message OW!;
}
What this does is checks to see if there is an npc at (x,y); if so, it calls the 'washit' part of the script, thus causing the NPC at (x,y) to say 'OW!'.
callweapon index,eventflag; calls the script of a weapon (used together with the variable selectedweapon) - This triggers an event on the currently selected weapon of the player.
//Currently executing NPC
if (washit){
message Ow! Now I will make you missfire!;
callweapon selectedweapon,weaponfired;
}
//Weapon currently selected by the player
if (weaponfired){
shoot();
}
In this case, if an NPC were to be hit by the player, the NPC will cause the weapon selected by the player to go off (hence the "missfire").
destroy; deletes the npc - Completly removes the NPC from the board (I reccomend putting this in putnpcs).
if (washit){
destroy;
}
Destroys the NPC when hit by a sword.
carryobject objectname; the character carriesanobject(onlywhen23<=sprite<=32) - This makes it so the NPC (must be a showchar NPC) carries the specified object. But you must set the sprites to anything from 23 to 32.
if (peltwithbush){
sprite = 23;
carryobject bush;
}
If the NPC is hit with a bush, the NPC will carry a bush (ought to look like he caught it.)
throwcarry; throws the carried object - This is used to make the NPC throw the object it is carrying.
if (playertouchsme){
throwcarry;
}
This will will what the NPC is carrying when it's touched.
followplayer; lets the npc follow the player; the action script keeps running; set x/y to leave the player - This causes the NPC to follow the player. It is disabled in online mode. If you want it to stop following the player, then you just specify what x,y cordinate you want the NPC to be at, and it'll stop.
if (playertouchsme){
followplayer;
}
if (followsplayer&&washit){
x=playerx+3;
y=playery+3;
}
This will cause the NPC to follow the player when touched, but if it was hit while following the player, it'll stop following.
toinventory flag; puts the npc into the player's inventory until the flag is unset - Puts the NPC in the player's inventory, and that NPC will stay there until the flag specified is removed from the player's list.
if (playertouchsme){
set gotkey;
toinventory gotkey;
}
If the NPC is touched, it will set "gotkey" and the NPC will be put in the inventory. If "gotkey" is unset, the NPC will be removed.
toweapons weaponname; adds this npc to the players weapon list - Turns the NPC into a weapon, the player carries it with him/her in their weapon list. Putting a '*' in front of the name prevents the weapon from being deletable.
if (playertouchsme){
toweapons Tech Bow;
}
Puts the NPC in the weapon list as "Tech Bow".
showimg index,filename,x,y; shows an image at the given position - The index can be any number the scripter wants, only use it as a reference to the gif. The filename is what gif to display, and x,y is where to display it. For non-weapons only the current player can see the image.
if (weaponfired){
showimg 1,arrow.gif,playerx+3,playery;
}
Displays the gif "arrow.gif" at playerx+3.playery when the weapon is fired.
showimg index,@font@style@text,x,y; It is now possible to do showimg text - This puts the specified text with specified font and style at x,y
Note that you can change the color and size of the text using changeimg colors / zoom
if (washit){
timeout=.05;
}
if (timeout){
showimg 1,@b@This Guy Hit Me!,playerx,playery;
timeout=.05;
}
If this NPC is hit by the player, then the player will be "branded" by the bold text "This Guy Hit Me!".
showimg2 index,filename,x,y,z; showimg with the z variable - This allows you to use a z value when placing a showimg.
if (weaponfired){
showimg2 1,light.png,playerx,playery,playerz+3;
}
When this weapon is fired, it will put a light three tiles in the z-direction above the player.
showani index,x,y,direction,animation,params; shows a gani at given x,y with some parameters - This will display a gani animation with a specified direction, index, x, and y cords.
if (weaponfired){
showani 0,playerx-3,playery,3,puppy.gani,1,5;
}
This weapon will put a gani of a puppy (facing right) to the left of the player.
showani2 index,x,y,z,direction,animation,params; shows a gani at given x,y,z with some parameters - This will display a gani animation with a specified direction, index, x, y and z cords.
if (weaponfired){
showani2 0,playerx+1.5,playery+1.5,5,3,lightbulb.gani,0,0;
}
This will put the ani "lightbulb.gani" above the player's head.
showpoly index,{x1,y1,x2,y2,x3,y3,..}; draws a polygon - This will draw a two dimensional figure using the given cords.
if (playerenters){
  showpoly 1,{x,y,x+1,y,x+1,y+1,x,y+1};
  changeimgcolors 1,255,0,0,1;
}
This will draw a red square (1x1) at the NPC's x,y cords
showpoly2 index,{x1,y1,z1,x2,y2,z2,x3,y3,z3,..}; draws a polygon - This will draw a three dimensional figure using the given cords.
if (playerenters){
  showpoly 1,{x,y,z,x,y+1,z,x+1,y+1,z+1,x+1,y,z+1};
  changeimgcolors 1,0,0,255,1;
}
This will draw a blue square (1x1) tilted at 45 degrees to the x-axis around the NPC's x,y,z cords.
showtext index,x,y,font,style,text; displays some text - This will put text (like a showimg) at the given x,y cords *Style is a string of: b for Bold, i for Italic, u for Underlined, r for Right Aligned, s for Strike-through, c for Centered
if (washit){
  showtext 1,playerx,playery,Times New Roman,biu,PLAYER KILLER!;
}
This will display the bolded, underlined, and italicized "PLAYER KILLER!" on the player when the NPC is struck.
showtext2 index,x,y,z,font,style,text; displays some text - This will put text (like a showimg) at the given x,y,z cords *Style is a string of: b for Bold, i for Italic, u for Underlined, r for Right Aligned, s for Strike-through, c for Centered
if (washit){
  showtext 1,playerx,playery,playerz+3,Times New Roman,i,PLAYER KILLER!;
 
changeimgcolors 1,255,0,0,1;
}
This will display the italicized "PLAYER KILLER!" (in red) over the player when the NPC is struck.
hideimg index; removes the image with the specified index - This will hide an image that was displayed using showimg.
if (timeout){
hideimg 1;
}
Hides the image with index 1.
hideimgs startindex,endindex; Hides all images with startindex<=i<=endindex - This is an easy way to remove all images shown by an NPC without running for loops or counters
if (gameover){
hideimgs 0,52;
}
This will hide all images with an index of 0 to 52.
changeimgpart index,x,y,width,height changes the visible part of the showimg - Changes the viewable part of the image shown with the specified index. (Use with showimg, works similar to setgifpart).
if (timeout){
showimg 88,arrowset.gif,playerx+3,playery;
changeimgpart 88,10,5,32,32;
}
Changes the image with an index of 88 to show only the part of the image at 10,5 that is 32x32 pixels.
changeimgvis index,drawheight; changes the drawing height of the showimg - Changes the layer on which the specified image is drawn. 0 is drawunder, 1 is same as player, 2 is drawover, and 4 is like a stat.
if (weaponfired) {
showimg 1,bomb.png,3,4;
changeimgvis 1,4;
}
This will draw the image of index 1 (bomb.png) at a height of 4, so it is considered a stat at this point.
changeimgcolors index,red,green,blue,alpha; Alters the color of the image of the specified index.
if (timeout){
showimg 1,orb.png,x,y;
changeimgcolors 1,255,0,0,1;
}
This will display the image "orb.png" then change it's colors to a bright red.
changeimgzoom index,zoomeffect; This zooms in on the image with the specified index.
if (timeout){
showimg 5,orb.png,x,y;
changeimgzoom 5,8;
}
This will display orb.png, and then zoom in on the orb to 8x its normal size.
seteffectmode mode; This changes the way the NPC's image is drawn - This is the command to use when you want an image to look like light, semi-invisible, or full of holes. *The modes are: 0 - as light 1 - as transparency 2 - holes (colors are subtracted)
if (created){
seteffectmode 1;
setcoloreffect 255,255,255,.5;
}
This NPC will apear to be somewhat hazy, or semi-invisible because I used the transparency mode. Increasing the '.5' at the end will make the NPC more visible, whereas decreasing it lessens the visibility.
changeimgmode index,mode; This changes the way an image is drawn - This is the command to use when you want an image to look like light, semi-invisible, or full of holes. *The modes are: 0 - as light 1 - as transparency 2 - holes (colors are subtracted)
if (weaponfired){
showimg2 1,arrows.png,x,y,5;
changeimgmode 1,0;
changeimgcolors 1,255,255,255,.9;
}
This weapon when fired will first place an image at x,y,5. The image will then be drawn as light by the changeimgmode command. Lastly the changeimgcolors determines what the light looks like.
shootarrow direction; shoots an arrow - The NPC will shoot an arrow in the direction specified. Directions can be: up, left, down, or right; or they can be numerical: 0, 1, 2, or 3 (respectively). You can also use variables, such as playerdir.
if (weaponfired){
shootarrow playerdir;
}
Shoots an arrow in the direction the player is facing.
shootfireball direction; shoots a fireball - This is the same as shootarrow, but instead its a fireball.
if (weaponfired){
shootfireball 3;
}
Shoots a fireball to the right when the weapon is fired.
shootfireblast direction; shoots a fireblast - Same as above, but a fireblast instead.
if (washit){
shootfireblast up;
}
When the NPC is hit, it'll shot a fireblast upward.
shootnuke direction; shoots an nukeshot - Same as above but for a nuke.
if (washit){
for(dir=0;dir<3;dir++){
shootnuke dir;
}
}
When this NPC is hit, it'll shoot a nuke in all four directions.
shootball; shoots a ball directly to the player - This shoots a ball that is always made to travel in the straightest path to the player.
if (wasshot){
shootball;
}
If the NPC is shot, it'll shoot a ball.
hitplayer index,halfhearts,fromx,fromy; hurts a player - Hits the player with the specified index, and takes of the specified amount of half hearts from fromx,fromy.
for (i=0;i< FONT>
if(abs(players[i].x-x)<=1&&abs(players[i].y-y)<=1){
hitplayer i,2,x,y;
}
}
This will hit whatever player is less than or equal to one space away from the NPC's x,y cordinates, and will take off 1 whole heart (2 half hearts), and hit the player from the NPC's x,y. For information on how to use a for loop to read a player's index, check sections: 2Biii, 2Biii.1 and 14.
hitnpc index,halfhearts,fromx,fromy; hurts an npc (changes hearts, hurtdx, hurtdy) - Hurts the NPC with the specified index (automatically subtracts the appropriate amount of hearts from the NPC being hurt, as well as sets the hurtdx and hurtdy vars).
n = testnpc(this.hitx,this.hity);
if (n>=0){
hitnpc n,2,this.hitx,this.hity;
}
If there is an NPC at (this.hitx,this.hity) then hit the NPC.
hitobject power,x,y; hurts players/npcs/computer opponents that are on the specified position - This is "hitplayer", "hitnpc", "hitcompu" all rolled into one.
if (timeout){
hitobject 2,imagex,imagey;
}
Will hurt anything and everything for 2 hearts at (imagex,imagey) when there is a timeout.
takehorse index; takes the horse with the specified index (only works in combination with 'showcharacter' ) - This takes the horse that a showcharacter NPC is riding.
if (strequals(#5,ride.gif)){
takehorse 0;
}
If the NPC is riding the horse "ride.gif" then it will be taken.
triggeraction targetx,targety,action,params; Invokes an event to the object on positon (targetx,targety) - Kind of like call NPC... I dunno what else to say.
if (timeout){
triggeraction imagex,imagey,burn,2;
}
if (actionburn) hearts-=#p(0);
Calls the action "burn" with a paramter of "2" to whatever NPC/Player is at location (imagex,imagey). When "burn" is called, the damage done is based on the parameter with an index of 0, in this case the value is "2".
move dx,dy,time,options;

The value of "options" would be something like this:
(0,1,2)+(0,4)+(0,8)+(0,16);

This moves the npc without needing you to update the
position of the npc 'manually' by changing x and y. - Moves the NPC the specified distance over the specified time, with some lame options.
- cachingmode:
- 0: previous movements will be finished immediatelly
- 1: movements will be cached, the previous movements
will only be finished when the cache is too large
(distance to go >5);
this caching can be used on server-side npcs to
make the movement look like non-laggy even when
there are little delays sometimes
- 2: the movement will just be appended to the movement
list; you can add up to 100 movements
- blockcheck: add 4 to the options when you want the
npc to stop when there is a wall blocking the npc
- informmewhendone: if you add 8 to the options then the
script will be called with a 'movementfinished' flag
when the the npc has stopped walking; catch this event
with
if (movementfinished) {...}
if you want to do something when the npc has stopped
(e.g. walking in a different direction)
- applydirection: add 16 to the options if you want the
game to automatically set the direction of the npc
depending on the movement direction (can be good
when using movement caching)
if (playertouchsme){
move 4,0,2,4+8+16;
}
if (movementfinished){
message Done;
}
When touched, this NPC will take 2 seconds to move 4 tiles to the right, but will stop if a wall is in the way (option 4), will face the direction it is walking (option 16), and when it is done (option 8), the flag "movementfinished" will be called to make the NPC display the message "Done".
wraptext linelength,delimeters,text; Word-wraps a text into pieces each of length 'linelength'; the result can be accessed by reading #t(0..tokenscount-1) - This command tokenizes a block of text.
if (playersays(WhatamIdoing?)){
wraptext 4,#c;
}
If the player specifically says "WhatamIdoing?" the NPC will divide it into blocks of text each 4 characters long to look like this: "What", "anId", "oing", "?"
wraptext2 pixelwidth,zoomfactor,delimiters,text; Wraps a text depending on the visible text width; instead of the numbers of characters you give the width of the text on the screen (in pixels) - This tokenizes text based on pixel width instead of number of chars.
if (playersays(WhatamIdoing?)){
wraptext2, 5,1,#c;
}
This will tokenize the the text but into a lot more blocks since each piece can only be 5 pixels wide.
tokenize (str) divides str into words (tokens) which can be read with #t(index) - Divides "str" into "tokens". Tokens are determined by spaces within the string. Everything within ""s is considered one token.
setstring Toker,this is an example;
if (washit){
tokenize (toker);
message #t(3);
}
This will take the string "toker" and because of the spaces in the string, it will divide it into 4 "tokens", so that the message the NPC displays will be "example".
tokenize2 delimeter,str divides str into tokens, using ‘delims’ as additional delimiters - Like tokenize, but you can specify other delimiters besides spaces and commas.
setstring toker,this/is/a/different example/./;
if (washit) {
tokenize2 /,toker;
message #t(3),#t(4),#t(5);
}
In this case I specified "/" to be a delimeter, so that when the tokenizing is done, "/" and spaces will determine how the string is divided into tokens. Therefore the message would be "differentexample." (Note that I did not include and spaces, because the message script does not have any text specifing spaces.)
setshape type,width,height; sets the shape of the npc: type=1 means rectangle (width & height in pixels) - Makes the NPC take up a rectangular area of space regardless of the size/shape of the image being used for it.
if (created){
setshape 1,16,32;
}
This will make a NPC behave like it is 1 tile wide and 2 tiles tall (recall that one tile is 16x16 pixels).
setshape2 width,height,{tiletypes..}; sets the shape of the npc to a rectangle of tiles - Like setshape but width,height is in tiles and you can specify the type of tile the NPC is supposed to behave like.
0 nonblocking 2 hurting underground
3 chair 4 bed upper side
5 bed lower side 6 swamp
7 lava swamp 8 near water
9 near lava 11 water
12 lava 20 throw-through (fences)
21 jumping stone 22 blocking tile
if (created){
setshape2 3,4,{3,3,3,3,3,3,11,11,11,11,11,11};
}
This will make a NPC that is 3x4 tiles, the top half of the NPC will behave like a chair that the player can sit on, and the bottom half will behave like water to swim in.
setshootparams Call this before using the shoot command - You can pass one or two parameters to be read when the shot projectile lands.
shoot x,y,z,angle,zangle,power,gani,ganiparams; Use this to shoot a projectile - x,y,z are the starting cords; angle is the direction the projectile is to shoot, z angle is the verticle angle it is shot at, power is the strength to shoot the projectile.
angle: 0=East 3.14/2=North 3.14=West 3.14*3/2=South
zangle: 0=horizontal 3.14/2=Verticle 3.14/4=45°
power: 0=infinite1<2<3
if (weaponfired){
setshootparams #w,2;
shoot playerx,playery,playerz,0,3.14/4,1.3,throw.gani,;
}
When this weapon is fired, the parameters for the projectile will be the weapon's name (#w) and "2".
Then the projectile is shot to the east (which is to the right on the screen) at a 45° angle with a power of 1.3. Since I did not use 0 for power, this projectile will shoot upwards, but will fall down after a little bit.
actionprojectile This is called when a shot projectile hits the ground and/or a player/npc/baddy. #p(0),#p(1) are the parameters passed with setshoot params. - On upgraded servers this is called when a shot projectile lands, for everyone else this is only called on a struck player or NPC.
if (actionprojectile){
if (strequals(#p(0),ShootWep)){
hearts-=strtofloat(#p(1));
}
}
If this NPC is hit by a projectile it will check to see that the firstparameter passed by the projectile is the string "ShootWep", if it is that string, then the amount of hearts taken off the NPC is equal to the value passed in parameter #p(1).
spyfire length,power Shoots fire from the player - This command could have been implemented better. length is the length (away from the player) you want the fire to travel. Power is either a 1 for normal or 3 for jolt.

if (weaponfired){
spyfire 5,3;
}

This will put a jolt-flame (like one from a horse) extendeding in the direction the player is facing of length 5.