Modding Help Possibilities of Objects

Discussion in 'Starbound Modding' started by JesseKomm, Jun 16, 2017.

  1. JesseKomm

    JesseKomm Void-Bound Voyager

    Hello everyone, I am currently looking into some possibilities regarding what an object is capable of performing within the game. Right now I am running into a few questions, and am hoping they can be answered before I continue my search:

    1. Can an entity/object somehow be told information regarding celestial bodies? For instance, are they capable of knowing what the star type of the current system is, or (While on a ship) knowing what type of planet is currently orbited? I am of course speaking of using lua coding for this, but I am not sure where they might call to for such information... if it is even possible.

    2. Can multiple separate entities/objects communicate to each other(Without wiring) for the purposes of determining script conditions and outcomes?
    2a. Subsequently, if an object can be spawned/removed via a script utilizing this communication?

    3.(Just a minor request)I'd also like to know some properties about object lighting; such as if I can change the light strength(Radius), or if there is an easy way for lightColor to change based on a frame or within an animation file?

    Thank you in advance to those who respond with the information I seek, and have a nice day!
     
  2. bk3k

    bk3k Oxygen Tank

    1. For lots of your answers. look in your \starbound\doc\lua\ folder
    Mainly celestial.md and world.md

    You can find most of that.

    2. Yes there is more than one method. scripted entity calls, calling scripts within world.entityQuery(), or the messaging system. The messaging system is capable of passing messages along between client side and server side entities, but the former 2 options cannot. If you just want objects to communicate with other objects, you don't really need that capability though. But for an object to talk to the player(for example), you do.

    2a. Certainly, because within the objects that receive the message, you define what happens upon getting that message. Self-destructing is easy. This isn't really what you'd do to spawn new objects. You can do that with world.placeObject() and that doesn't require talking to any other entity. Of course you can call that as a result of getting a certain answer in the standard way.

    edit:
    I missed 3.

    Lighting can be dynamically changed easily from within a LUA file of course. But for animation? You can indeed define lights in animation files, and turn them on or off. To say you want different lighting per frame, you'd want to turn one set of lights off, and another (with different levels) on.

    Depending on your specific intent, you can probably just use flickering in the object's JSON. But if that isn't going to work for you, and you must do it from the animation files, set a number of states. One for each frame(or pair of frames). Each state can be a transition state, leading to the next. The last state transitions to the first. Each state can have its own lights being turned on - again with their own custom levels.
     
    Last edited: Jun 16, 2017
  3. JesseKomm

    JesseKomm Void-Bound Voyager

    Thank you very much for this information! And I do apologize for my delayed response... a few days after this post I decided to take a break from my mod(As I found I was gradually becoming more ambitious toward ideas outside of my programming skills). Though I am returning once again, and likely making huge altercations so perhaps I may not even need some of this information anymore, but regardless I appreciate it to reflect upon.

    Thankfully I was aware of the lua documentation folder already, though I had not checked the celestial.md before now; realistically what I feel I need more are the JSON documentations... of course a lot can be found on the wiki regarding objects, but it seems a lot of information is glossed over or simply not included in there.

    For point 3, I really only need to know light parameters. I've not seen any object reference that determines the strength or radius of a light source and so I'm not aware of what to try... which again goes back to my previous statement of hoping for JSON parameter documentation so I could at least figure it out on my own.
     

Share This Page