If you understand the basics and scripting follow this link to the complete list of Rod 3D scripting functions.
Rod 3D uses a C style scripting language based on the AngelScript library.
A large number of functions have been developed for the game allowing for a vast amount of posibilites and truely dynamic missions.
How The Script Works
There are up to 2 scripts active at any time, the game script always runs whereas the map script is optional.
Game Script
The game script (base\game\game.c) controls the actual game including all weapons, damage, object death behaviour and more. The game script is generally event driven meaning that the game automatically runs known functions in the script (for example: "OnFireWeapon" is run whenever a weapon is fired or "OnProjectileHit" for when a projectile hits something).
It is essentially possible to create a whole new game by customising this script.
Map Script
Each game map can have its own map script that contains map specific functions. Interestingly a game script function can be recreated (with the same function name) in a map script as Rod will look in the map script first.
An example of a typical map script event is "OnWaypointReached_10" for when an object reaches a waypoint 10 on the map.
Map Script Example:
When you run the map the sheep will walk to the waypoint and then die because SC_SetObjectHits sets the sheep's hit points to 0.
How it Works
Given the line of code below...
void OnWaypointReached_1( int ObjectId)
TIP: There are plenty of examples, take a look at the
existing game scripts (the .c files in the base\maps folder).
TIP: There are
loads of free C editors around with syntax highlighting, PSPad, Visual C++
Express Edition and Code::Blocks to name but a few.
TIP: Press the "Toggle
IDs" button on the Map Editor toolbar to display all waypoint and object IDs on
the screen at once.
Many of the script functions use coordinates so lets understand how these work.
The coodinates in Rod 3D are as follows:
X = Grows to the East
Y = Grows with height
Z = Grows to the South
Coordinates are in pixels and not tiles.
Examples (on a map 1024 by 1024 pixels):
Hope that makes sense.