Modding Help Changing hats/armor when sitting on a chair.

Discussion in 'Starbound Modding' started by vladvo, Sep 25, 2021.

  1. vladvo

    vladvo Void-Bound Voyager

    Is there a way to remove/replace a certain piece of clothing when sitting on chair (.object) ? Something like
    replacing a helm when in a mech. Mechs use armorCosmeticOverrides in .vehicle file. As expected this override does not work with objects. Any ideas ? "Nude" is not an option.
     
  2. vladvo

    vladvo Void-Bound Voyager

    Anyone ?
     
  3. rl.starbound

    rl.starbound Phantasmal Quasar

    I've thought about this in the context of making back armor invisible when sitting in chairs, since many back armors look very wrong when the player sits in a chair. I haven't found a really clean way to do it for both NPCs and players.

    Furniture can apply status effects when a player lounges in it. You could create a new status effect and write some lua code that would cause a player or NPC to remove an armor item. For an NPC, you could attach a property to the NPC's storage saying what the removed item was, so that when the status effect uninits, some more lua could could restore the item.

    However, I'm not sure how this could work for a player. Does the removed item go into inventory? What if inventory is full? Does the item just get dropped? When the player gets out of the chair, do they have to manually put the item back on? As you mention, vehicles have special code to handle this special case, but objects do not. Similarly, the "nude" status effect has its own special "nude" player stat to handle this, but that only works to hide all armor, not one specific type of armor.
     

Share This Page