LunaLua global functions

From Moondust Wiki
Revision as of 21:49, 15 October 2014 by Kevsoft (talk | contribs)
Jump to navigation Jump to search
Global Functions
Function Return values Description
windowDebug(string debugText) nil Writes debugText in a message box and shows it to the user.
print(string text, int x, int y) nil Prints text at x, y with font-type 3
print(string text, int type, int x, int y) nil Clears the entire screen.
totalNPC() int Returns the number of npcs.
npcs() table with npc Returns a array of all NPCs.
findnpcs(int ID, string section) int Searches all npcs by ID and Section. Use -1 as a parameter to ingore the given filter.
mem(int address, int fieldtype, object value) nil Sets the memory of the given type.
mem(int address, int fieldtype) object Returns the value of the given address of the given type.
tiggerEvent(string eventName) nil Triggers a event by the given name
playSFX(int index) nil Plays a SMBX Sound by the SMBX Sound ID
playSFX(string filename) nil Plays a Soundfile
playMusic(int section) nil Plays the music, which is set by the given section id
loadImage(string filename, int resourceNumber, int transparentColor) nil Loads a image in the resource memory at resourceNumber. You can also set the transparent Color.
placeSprite(int type, int imgResource, int xPos, int yPos) nil Places a sprite from the resource memory and places it at xPos, yPos
placeSprite(int type, int imgResource, int xPos, int yPos, string extra) nil Places a sprite from the resource memory and places it at xPos, yPos.
placeSprite(int type, int imgResource, int xPos, int yPos, string extra, int time) nil Places a sprite from the resource memory and places it at xPos, yPos.
gravity() int Returns the current gravity.
gravity(int value) nil Sets the current gravity.
earthquake() int Returns the current earthquake factor.
earthquake(int value) nil Sets the current earthquake factor. Slowly returns to 0!
jumpheight() int Returns the current jumpheight factor of all players.
jumpheight(int value) nil Sets the current jumpheight factor of all players.
jumpheightBounce() int Returns the current jumpheight factor (when bounced of a enemy) of all players.
jumpheightBounce(int value) nil Sets the current jumpheight factor (when bounced of a enemy) of all players.