Skip to content

Instantly share code, notes, and snippets.

View alex-lawson's full-sized avatar

Alex Lawson alex-lawson

View GitHub Profile
@alex-lawson
alex-lawson / notes.md
Last active August 29, 2015 13:58
Notes for Modders - Starbound unstable update April 8, 2014
  • New function world.tileIsOccupied(tile, tileLayer, includeEphemeral)
    • tile (vec2) the position to check
    • tileLayer (boolean, optional, default=true) the tile layer to check (true for foreground, false for background)
    • includeEphemeral (boolean, optional, default=false) include held but unplaced objects such as a player's object placement preview
    • returns true when the specified tile position contains a material or a placed object
  • New function world.farmableStage(entityId) returns the current growth stage of the specified farmable object as an integer, or nil if the object is not a valid farmable
  • Added entity.applyMovementParameters and entity.applyMovementModifiers to monster context, with functionality similar to the tech functions of the same name
  • Objects will now retain their storage table when broken into items
  • Container objects can now specify a hook to be called when the inventory is changed (by players or scripts).
@alex-lawson
alex-lawson / gist:8014884
Last active December 31, 2015 16:39
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