Modding Discussion ComputerBound

Discussion in 'Starbound Modding' started by Defiance3, Aug 3, 2016.

  1. Hekkaryk

    Hekkaryk Scruffy Nerf-Herder

    I'm impressed - that's nice mod you have here ^^
     
  2. Slash0mega

    Slash0mega Subatomic Cosmonaut

    wait, can your computers effect more than just the computers if they are using the server logics lua?
     
  3. Defiance3

    Defiance3 Phantasmal Quasar

    Thanks! Hopefully I'll get a release out sooner than later.

    I'm not sure what you mean by that. Can you explain it a bit further?
     
  4. Slash0mega

    Slash0mega Subatomic Cosmonaut

    like, spawning items for or applying scripts to players, or looking at files it probably shouldn't have access too on the server machine. (not sure how powerfull starbounds lua is)
     
  5. Defiance3

    Defiance3 Phantasmal Quasar

    Well, I do have plans for a "modder's computer," which will essentially give you the ability to do things such as, like you said, spawn items or apply scripts to players.
    Though, It's still in the planing stage since I still have a lot of base material to work on and finish. Of course, such a computer could only be spawned in.
     
  6. UniQMG

    UniQMG Void-Bound Voyager

    So your lua environment within the computers is completely sandboxed? You couldn't, for example, call something like object.position() (Assuming this is running in an object script)?
     
  7. Defiance3

    Defiance3 Phantasmal Quasar

    Yep. It's 100% sandboxed as far as I know. I haven't tried breaking out of it, but I doubt one would be able to. And yes, this is running in an object script.
     
    origamania likes this.
  8. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    Even if its an object script, you still have a good scope into SBs scripts. Spawning items, etc are pretty possible.

    Might be a pain, but you can have an interpreter for your environment, that could read, maybe a leading keyword that triggers the proceeding string to be formatted and insert parameters for external functions?

    I.E: How ComputerCraft used the inherent 'call' function to run other programs.
     
    Last edited: Aug 20, 2016
  9. Defiance3

    Defiance3 Phantasmal Quasar

    Oh, when I was talking about the sandbox, I was referring to the threads which run user code themselves that don't have access to the game related APIs that are offered to the object.

    Also, I'm not quite sure what you mean, even with your given ComputerCraft example. Think you could give another example or explain further?
     
  10. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    What I meant was to implement a function that could be interpreted to take the given parameters and pass them to those other functions in the game. The CC example was me giving an example of how that would look, essentially, in the code shown to a user.

    I'm not being very helpful, only giving my two cents as I haven't a thorough understanding of your code, so I can't really give an example of how to break the sandbox.
     
  11. Defiance3

    Defiance3 Phantasmal Quasar

    The sandbox is just a table that will serve as the _ENV / _G for the computer threads. If you're talking about adding the game's APIs to said sandbox, all I have to do is add it to the table.
     
    Inf_Wolf14 likes this.
  12. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    Hey whatever works. I'm just throwing around ideas. It's still your brain child man. :)
     
    Defiance3 likes this.
  13. Storm_UK

    Storm_UK Existential Complex

    Looks very interesting and pretty involved. I'm intrigued to see it how you progress, good luck with the mod!
     
  14. Defiance3

    Defiance3 Phantasmal Quasar

    Thanks! You know, I actually went to look over your mod (macrochip) a few times to understand a few functions and how they worked before, so you've indirectly helped out with it's progression. :)
     
  15. Defiance3

    Defiance3 Phantasmal Quasar

    Here are a few gifs I forgot to make displaying the node API I mentioned earlier.
    To recap, the node API is used to interact with objects and peripherals.
    Any object that's not from my mod that can be wired is registered as a "primitive"
    All other peripherals have proper names, such as "monitor" or "keyboard"

    teaser4.gif
    The "s" that prefixes the names of the peripherals and objects simply means "string," and isn't part of the actual name, so it can be ignored.

    Here's another gif showing how computers can communicate with each other.
    teaser5.gif
     
  16. Defiance3

    Defiance3 Phantasmal Quasar

    Alright, just finished implementing a way to interact with files and such from outside the game using the io and os library.

    Originally, I was going to use the storage table given to objects to save data, but I found that it wasn't viable since you couldn't easily access your computer's files from outside the game, nor could data easily be transferred from one computer to another. Putting entire computer directories in the hard drive items wasn't really gonna cut it, either. So, now each hard drive will have a UUID which will refer to a folder in "starboundDirectory/win64/Computer/Storage/" (I'd like it to refer to "starboundDirectory/storage/Computer/Storage", but nothing I seem to do will change the working directory that io uses).

    I'll admit that it does feel a bit hacky to have to use things like io.popen() and os.execute() in order to make the library fully functioning, but I don't really know of any other alternatives.
     
  17. MrVauxs

    MrVauxs Giant Laser Beams

    Are you going to implement random generated discs like in ComputerCraft? i can't do lua and im too lazy to do that unless it is seriously nice and explained
    a i love to find an pacman disc!
    EDIT: And also a How to make lua. for dummies codex? :p
    EDIT2: Please add it to starbound workshop ;-;
     
    Last edited: Aug 24, 2016
  18. Defiance3

    Defiance3 Phantasmal Quasar

    I'd like to be able to implement randomly generated discs in chests and dungeons. Another feature that I've been thinking about is an NPC at the output who not only sells random computer parts at different times, but also sells programs on ROM discs. I'd like to see user-submitted programs added to the list that he sells so it feels somewhat like a marketplace to buy programs, and potentially sell copies of your own.

    Also, as far as a "how-to" on Lua goes, I'd simply refer people to the offical Lua manual and The Lua Tutorial, two good sources for good learning. There are numerous other good tutorials, which can be found with a simple google search. :)
     
    charity236 likes this.
  19. MrVauxs

    MrVauxs Giant Laser Beams

    ok and last thing

    computers anywhere.jpg
     
    MelOzone likes this.
  20. Defiance3

    Defiance3 Phantasmal Quasar

    It's only page two and we've already got memes. :p
     

Share This Page