Modding Help Accessing functions available in other contexts

Discussion in 'Starbound Modding' started by Magmatic, Oct 18, 2018.

Tags:
  1. Magmatic

    Magmatic Space Hobo

    As part of a mod I'm working on, I'd like to have SAIL say things based on the warp phase and progress, but mostly just the progress. The issue is that the celestial table is only available through ScriptPane objects, so I can't use any of those functions in the regular techstation.lua file, or a lua file added to the techstation script lists. Is it possible to create a script in this context from the regular, always-running scripts on the techstation? If not, is it possible to enter this context within a script? I'm not super familiar with LUA and how the many scripts interact, so apologies if this seems obvious. If I'm being too vague I can elaborate, just let me know.
     
  2. The Avelon

    The Avelon Phantasmal Quasar

    I was just running into this wall with the take all hotkey mod. Script panes can't access key input. The workaround I used was keeping track of the button press by adding a unit of custom currency to the player with a key press embedded in the body slot tech, then having the pane check to see if the player has a unit of that currency.

    If I'm understanding your intent it seems you want SAIL to talk you through the ship's warp drive phases and possibly talk about your destination?

    Check out the animated FTL drive mod - it begins its thing when you start a warp (it monitors your fuel level) and runs until you come out of warp. The same script should in theory work on for example an inventory item. Your mod could add an item to inventory that does not show up in any of the tabs and acts as the controller for the script opening an invisible script pane when necessary. You also might be able to do it more easily using a quest, as I think quests have access to all tables.
     

Share This Page