Npcconfig.lua

From Moondust Wiki
Revision as of 00:58, 27 February 2015 by Hoeloe (talk | contribs) (Created page with "Download the latest version [https://dl.dropboxusercontent.com/u/30847069/npcconfig.lua here]. '''''This library is mostly untested, and could cause problems if used.''''' T...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Download the latest version here.

This library is mostly untested, and could cause problems if used.

This library allows access to the data usually set by NPC text files from Lua code. You can read and alter these values during the game.

Note: Not all values can be set meaningfully at runtime. Some are ignored, some cause problems when set. Which do this is currently not known.


Installation

To install the library, put the npcconfig.lua file into the LuaScriptsLib folder.


How to Use

First, import the library using this line:

npcconfig = loadAPI("npcconfig");

Then, you can access fields using this format:

npcconfig[NPCID].PROPERTY

For example, to get the current width of the Axe NPC, you could write:

npcconfig[178].width


Fields

This is a list of all the fields available to the npcconfig structure. Any beginning with def_ are the default values. These are copied into their respective regular values when a level loads. This is useful for changing the behaviour of NPCs for an entire set of levels.

Any in this list that are in bold are known to work. Any that are struck out are known to have problems when setting them (though the nature of these problems is not necessarily known).

  • gfxoffsetx
  • gfxoffsety
  • width
  • height
  • gfxwidth
  • gfxheight
  • speed
  • isshell
  • blocknpc
  • blocknpctop
  • isinteractable
  • iscoin
  • isvine
  • iscollectablegoal
  • isflying
  • iswaternpc
  • jumphurt
  • noblockcollision
  • score
  • blockplayertop
  • grabtop
  • cliffturn
  • nohurt
  • blockplayer
  • grabside
  • isshoe
  • isyoshi
  • noyoshi
  • foreground
  • isbot
  • isvegetable
  • nofireball
  • noiceball
  • nogravity
  • frames
  • framespeed
  • framestyle
  • def_gfxoffsetx
  • def_gfxoffsety
  • def_width
  • def_height
  • def_gfxwidth
  • def_gfxheight
  • def_speed
  • def_isshell
  • def_blocknpc
  • def_blocknpctop
  • def_isinteractable
  • def_iscoin
  • def_isvine
  • def_iscollectablegoal
  • def_isflying
  • def_iswaternpc
  • def_jumphurt
  • def_noblockcollision
  • def_score
  • def_blockplayertop
  • def_grabtop
  • def_cliffturn
  • def_nohurt
  • def_blockplayer
  • def_grabside
  • def_isshoe
  • def_isyoshi
  • def_noyoshi
  • def_foreground
  • def_isbot
  • def_isvegetable
  • def_nofireball
  • def_noiceball
  • def_nogravity