Modding Discussion Important thing to remember - persistent flags possible

Discussion in 'Starbound Modding' started by SuperMandrew, Dec 10, 2013.

  1. SuperMandrew

    SuperMandrew Cosmic Narwhal

    Hey all,

    Just wanted to throw a short reminder out there for everyone in case they didn't know - when working with the LUA files, in particular techs, it's possible to use a global flag that persists between inputs. For instance, I wanted to make a tech that had the double jump and bubble boost, but that the double jump came first. However, by doing so via an if statement, since both the double jump and bubble boost required the user to be in the air and such, the double jump would always try to steal the input then not do anything with it.

    I finally remembered (programming at 3 am is always good right?) that we have access to the tech's parameters in the .tech files, and that we can even create our own there. This allows us to have a global flag that persists between inputs, and was what I used to solve my problem.

    TLDR: Use custom parameters outside LUA files as persistent variables, if needed.

    Enjoy!
     
    Kristof likes this.

Share This Page