RPG script
WARNING: I'm currently not too pleased with the scripting system. Keep in mind that it may change drastically before the next release.
Contents
Intro
Generally speaking, you should not invoke the commands directly, unless it's called from one of the r_script_ slots. See the container section.
Scripts work with a stack based approach. When invoking one of the containers, it may alter or check some values before executing the script. Once the script is executed it will revert the variables to their prior values.
Containers
These are all prefixed with r_execute_
Note that if any requires conditions aren't met, execution will abort.
- all - loops through all the maps and executes it on every entity.
- local - loops through the selected map's entities and executes the script.
- mapdata - loops through all the available maps and executes the script.
- map - executes the script on the selected map.
- selected - executes the script on the selected entity.
- player - executes the script on the player.
- curmap - executes the script on the current map.
- actor - executes the script on whatever interacted with you
- inv - loops through the selected entity's inventory
Examples
a substitute for r_execute_all
r_execute_mapdata [ r_execute_local [ .... ] ]
Looping through all entities on your current map
r_execute_curmap [ r_execute_local [ .... ] ]
How to be really nasty to people who won't leave you alone ;)
r_execute_actor [ r_execute_inv [ r_item_drop (r_get_itemamount) ] ]