Modding Help Can you make mods using lua yet?

Discussion in 'Starbound Modding' started by MysticPing, Jan 20, 2014.

  1. MysticPing

    MysticPing Subatomic Cosmonaut

    Has i understood it wrong or is the lua api already documented? Everything i can find is lua tutorials which i already know.
    Nothing about the starbound lua api itself. And if you want some kind of proof i guess i could share a snippet from the mini game i am working on.

    Code:
    
    Also if i was not clear enough this code under has nothing with starbound to do
    
    function update_gamestate()
           for i, v in ipairs(boxes) do
             if v.name == "Play" and v.clicked then
                gamestate = "Playing"
             elseif gamestate == "Playing" and starship.health <= 0 then
                gamestate = "Game Over"
             elseif false then -- pressed "play again"
                starship.health = 100
               for y, x in ipars(starts) do
                 for i, v in ipars(meteorites) do
                   table.remove(meteorite, i)
                   table.remove(stars, x)
                    gamestate = "Playing"
                 end
               end
               elseif false then -- wip false is beacuse its not yet implemented
                gamestate = "Menu"
                   -- relevant stuff here \/
               elseif (gamestate == "Playing" or gamestate == "Paused") and love.keyboard.isDown("p") then
                     if gamestate == "Paused" then
                      gamestate = "Playing"
                             elseif gamestate ~= "Paused" then
                              gamestate = "Paused"
                   end
                 end
     end  end
    not this might be horribly dirty and none clean but i just searched pastebin in my history so im not even sure if it works or how old it is :p
    
     
  2. vileRaisin

    vileRaisin Tentacle Wrangler

    There's some API stuff exposed, but I'm not sure if I understand your question. I can't really see what you're trying to do with the code, as well as that it wouldn't run in the first place with all the syntax errors.
     
  3. MysticPing

    MysticPing Subatomic Cosmonaut

    I just wanted to post a example that had nothing to do with starbound to prove that i kinda know what i am doing so people woudnt share a lua tutorial instead.

    Also i mentioned that it is broken and non functional.

    What i wondered is if the api is out yet and what is out of it is enough to actually do something (and working)
     
  4. vileRaisin

    vileRaisin Tentacle Wrangler

  5. MysticPing

    MysticPing Subatomic Cosmonaut

    Ok thanks
     
  6. Yes, it is very possible to make mods via Lua. Just check the Mods section! Theres tons of people, including myself, using extensive use of Lua already.
    Im not gonna give you the rundown on Lua cuz its clear you know your fair share with Love2D.

    This will help you extensively.
     

Share This Page