Skip to content

Instantly share code, notes, and snippets.

@alex-lawson
Last active December 31, 2015 16:39
Show Gist options
  • Save alex-lawson/8014884 to your computer and use it in GitHub Desktop.
Save alex-lawson/8014884 to your computer and use it in GitHub Desktop.
Bonus patch notes for modders

Lua API / Modding Changes

  • The object table accessible from object scripts has been renamed to entity for consistency
  • Object scripts receive an argument in init which is true when the object is being previewed and false when it is placed in the world
  • Wire objects can now use getInboundNodeIds(nodeIndex) and getOutboundNodeIds(nodeIndex) to get a table of entityIds for all objects connected to the specified wire node
  • Object scripts can now define a function die() to be called when the object is broken or destroyed
  • Added an entityProxy wrapper function to make more entity functions available (details here: https://www.irccloud.com/pastebin/ZQBDj4ou)
  • Added entity.setDropPool for monsters to allow changing their dropPool parameter from scripts, which can also be set to nil to disable drops
  • Added world.damageTiles and world.placeMaterial for tile manipulation
  • Added world.itemDropQuery and world.takeItemDrop
  • Added entity.energy and entity.maxEnergy to NPCs
  • Documentation for world/object hooks can now be found in /assets/scripts/API
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment