Modding Help Spawn Monster through Object question

Discussion in 'Starbound Modding' started by Campaigner, Aug 28, 2016.

  1. Campaigner

    Campaigner Giant Laser Beams

    I've taken a liking to the coding for the Fluffalo/Mooshi egg items, and have applied it to a LOT of monsters in my mod. However, I've come to a point where I don't want the monster to spawn after a set amount of time; I want it to be inactive forever until the player clicks on the item.

    In the past, there were items that summoned bosses like this. Dreadwing, Fatal Circuit (RIP), Bone Dragon, and the Jelly Boss (also RIP) were summoned this way. Their coding is long gone, but I'm sure that wouldn't work with how stuff is today.

    Is there an easy way to set up an object that both spawns a monster and disables the object when activated, and never otherwise? Because I'm having a hard time finding one, and I deeply hope it's not LUA stuff since I can't do that kind of coding.
     
  2. ZimaZang

    ZimaZang Cosmic Narwhal

    Might be a good idea to take a peek at colony deeds and see where that gets you.
     
  3. Inf_Wolf14

    Inf_Wolf14 Parsec Taste Tester

    In the past, at least as I remember Dreadwing, the Iron Beacon used its script to destroy the object upon interaction.

    (Tested if it was placed on the surface of a world, if so, spawned Dreadwing, then used 'object.smash()' to delete itself.)
     
  4. Errors4l

    Errors4l Spaceman Spiff

    I found the following two bits of code for the object script by checking existing assets:

    inside init:
    Code:
    object.setInteractive(true)
    (new) function:
    Code:
    function onInteraction(args)
    end
    In the onInteraction code, you can break the object the same way as it was done before:
    Code:
    object.smash()
     

Share This Page