Advertisement
Guest User

Starbound Glad Giraffe 1 (2015-12-08) objecthooks.lua API

a guest
Apr 28th, 2017
585
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 1.61 KB | None | 0 0
  1. --- Stubs for functions that object scripts can define which will then be called by C++
  2.  
  3. --- Called (once) after the object is added to the world.
  4. function init() end
  5.  
  6. --- Update loop handler.
  7. -- Called once every scriptDelta (defined in *.object) ticks
  8. function update(dt) end
  9.  
  10. --- Called when the object is about to be removed from the world.
  11. function die() end
  12.  
  13. --- Called when the object is interacted with.
  14. -- Available interaction responses are:
  15. --    "OpenCockpitInterface"
  16. --    "SitDown"
  17. --    "OpenCraftingInterface"
  18. --    "OpenCookingInterface"
  19. --    "OpenTechInterface"
  20. --    "Teleport"
  21. --    "OpenSongbookInterface"
  22. --    "OpenNpcCraftingInterface"
  23. --    "OpenTech3DPrinterDialog"
  24. --    "ShowPopup"
  25. --    "ScriptConsole"
  26. --
  27. -- @tab args Map of interaction event arguments:
  28. --    {
  29. --      sourceId = <Entity id of the entity interacting with this NPC>
  30. --      sourcePosition = <The {x,y} position of the interacting entity>
  31. --    }
  32. --
  33. -- @return[1] nil (no interaction response)
  34. -- @treturn[2] string the interaction response that should be performed
  35. -- @treturn[3] array the interaction response and configuration:
  36. --    {
  37. --       <interaction response string>,
  38. --       <interaction response config table (map)>
  39. --    }
  40. function onInteraction(args) end
  41.  
  42. --- Called when the level of an inbound connected node changes
  43. --
  44. -- @tab args Map of:
  45. --    {
  46. --      node = <(int) index of the node that is changing>
  47. --      level = <new level of the node>
  48. --    }
  49. function onInboundNodeChange(args) end
  50.  
  51. --- Called when a node is connected or disconnected
  52. function onNodeConnectionChange() end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement