Difference between revisions of "Scripting"

From Amulets & Armor Wiki
Jump to: navigation, search
(Scripting Tutorials)
(Scripting Tutorials)
Line 17: Line 17:
  
 
All-player scripts can call personal scripts and vice versa. This means that a switch with a personal effect, like teleportation, can then call an all-player script to open a door as well.
 
All-player scripts can call personal scripts and vice versa. This means that a switch with a personal effect, like teleportation, can then call an all-player script to open a door as well.
 +
 +
Levels call scripts by either the player activating a linedef or stepping over a sector. Linedefs with a special will call the script number that matches the special. Sectors that have a special will call the script number that matches the special.
  
 
=== Commands ===
 
=== Commands ===

Revision as of 00:37, 23 February 2014

Installation Instructions

The script compiler is available on GitHub. Currently you will need to have a C++ compiler in order to build it. (MSVC++ 2010 Express is free and is compatible with the provided project files)

https://github.com/ExiguusEntertainment/AAScriptCompiler


Scripting Tutorials

Scripts are written in .SRC files. These contain the script's source which is compiled into .SRP files by the A&A Script Compiler utility. BLANK.SRC, TEMPLATE.SRC, and L1.SRC are provided to show examples of scripting methods and layout. The L1.SRC is the source for Quest 1's first map (L30.MAP). This can be opened in Doom Builder 2 using the [Classic Editor" | Classic Editor].

Remember, compiled script files are formatted S###.SRP as opposed to all of the other level data files that begin with an "L". You will need to rename the outputted .SRP file using this format so that the game will be able to locate the file by map number.

Scripts 0-199 run for all players. This should be used for moving platforms, opening doors, spawning monsters, traps, and playing world sounds. Every player will see this change.

Scripts 200-255 only run for the current player. Other players are not affected. This is used for teleporters, personal damage, and healing. Deactivating switches in this script should only happen on the client, allowing other players to see the same effect. You'll see this with healing pools in the main game.

All-player scripts can call personal scripts and vice versa. This means that a switch with a personal effect, like teleportation, can then call an all-player script to open a door as well.

Levels call scripts by either the player activating a linedef or stepping over a sector. Linedefs with a special will call the script number that matches the special. Sectors that have a special will call the script number that matches the special.

Commands

Below are a list of scripting commands with examples. (More added as examples are made)