Modding Help Creating an item that can be moved, but not by picking it up

Discussion in 'Starbound Modding' started by Kaldo, Mar 20, 2016.

Tags:
  1. Kaldo

    Kaldo Scruffy Nerf-Herder

    So basically, I want to create an item that can be moved, but not by picking it up in your inventory and putting it down later. I want to create a core feature with which I'd later mod a system for cargo transport that isn't rendered trivial by huge player inventories, instead it would depend on ship's physical cargohold size. However, I'm a new modder and even though I've gone through some tutorials and checked how other mods are made, I'm not sure if this can be done at this stage in Starbound, with the tools currently at our disposal.

    I'm looking for design ideas and hints on how to approach this task so I can eventually complete it on my free time. I'm guessing it's a huge undertaking but I'm enjoying thinking about it and if I come to a good enough solution and idea how it could work in the game, who knows what might happen?

    Goals / functionalities I'd have to realize:

    1. Needs to be able to move between planet surface and players' ship

    2. Cannot be picked up and stored in player's inventory - maybe only destroyed with player's tools

    3. It's created and used when physically stored on top of special blocks / workstations (since it's not created or used in player's inventory)

    Some of my ideas on how to solve them:

    1. Transport to and from ship is done by beaming it - after interacting with the object on the planet, it's beamed to a specific predetermined location on the ship if there's space. It's beamed down to the planet by interacting with the specific spot down there and "requesting it". Long term goal - the option of directly selling it from the ship by talking to an NPC, or through an ingame interface.

    One possible way to do this is by having a special "empty slot/dock" placeable object (on the ship) that would be replaced by the sent object (from the planet) when needed. Objects would "simply" swap places. I'm not sure if this is possible however - can I affect placed items on ships while I'm on planets? Can I store somewhere a list of "storage docks on the ship", access them while on the planet's surface and change their state or identity by swapping them with the object?

    2. I'm not sure how I'd go around making it unpickable - maybe something like infinite durability so it can never be disassembled. However, that raises the problem of how to destroy it if the player wants to throw it away? I might need an interaction menu when clicking on the objects that would show the options like "beam to ship", "destroy the object", "show info", stuff like that. I'm hoping there's an easier solution than creating a special GUI for this but I might need it anyway so, maybe better to bite the bullet asap...

    edit: I guess I could just make it drop nothing when destroyed, and increase durability so it doesn't happen accidentally.

    3. Since it can't be crafted in player's inventories, it would have to be created by a third party. I'm wondering if there is a way to programmatically create and place objects without player's input. For example, can I make a furnace that would, provided its requirements are met and sufficient time has passed, create and place the object to a platform next to it? Long term idea is to have colonies create and use these items.

    I've read about farmables and how I can use them to create tiles that spawn objects on top of them, but I'm not sure how to add various requirements to them - cargo objects like "a packaged reactor" or "a pallet of food rations" would need more than just time and water to be created. I'm also not sure if I can use this to create any type of objects or just gatherable types.

    3.1. Adding to this, is there a way for an object / placeable workbench to be "aware" of an object near it? If there's a placed object, can it check if there's a specific object placed right next to it, or on top of it? Is there a way for a block to detect what is placed on top of it? Can it subsequently destroy that object?


    I understand this is probably a huge undertaking. However, it's fun to think about it, and it seems doable - at least in other common languages. I'm not sure if we have that kind of control with lua and modding in Starbound though, so that's why I'm looking for your input guys... should I even bother, is this doable? Any ideas on how to get started?
     
    Last edited: Mar 20, 2016
  2. C0bra5

    C0bra5 Oxygen Tank

    this seems quite ambitious, but i don't know if it would actually be possible. because as far as i know we can't place blocks in the world from a lua script, though i think we can for containers
    also making so that the ships all have the extra space required for this special room will take a while. also i don't know of a way to allow a block to be placed only on a specific block, unless you edit and/or add a script to all the object in the game to break when it detects a block underneath it.
     
  3. Kaldo

    Kaldo Scruffy Nerf-Herder

    Actually, I wouldn't change ships at all - players would craft and place the "cargo socket" items anywhere they wanted to on their ship. They would have the same size as a "filled cargo socket" item and ideally I'd just switch them with the filled ones when they get "filled". No need to create blocks that only allow one type of item since it's all just one item, and no need to create special ship rooms because it could ideally fit anywhere, either for storage or transport.

    However, if we're unable to create, destroy or replace placed objects with lua based on their unique ID or location, this all kinda falls into water.
     
  4. Peelz

    Peelz Giant Laser Beams

    Might be worth looking into the vehicle system. So far that's the best way to create persistant, movable objects in the game. Or maybe make your object a monster. That's what they do with the little red ball in vanilla.
     
    C0bra5 likes this.

Share This Page