Modding Help Projectile that places object on Reap?

Discussion in 'Starbound Modding' started by Iaeyan Elyuex, May 24, 2018.

  1. Iaeyan Elyuex

    Iaeyan Elyuex Cosmic Narwhal

    I'm trying to make a weapon that throws a "technical projectile" that is near-instantly reaped and replaced with an object that breaks when mined. Kind of like a graffiti spray can, only different. I know I could just have these objects crafted by hand, but that's not what the person who asked for this thing wants.

    What "actionOnReap" parameters would I need to have in the technical projectile that would cause this to happen? And would the resulting object pop off objects in the way, would it intersect, or would it simply fail to place? It's described by the one asking for this as "unable to be placed on an uneven surface" (read: won't work if objects are in the way).

    Also, is it possible to have an activeitem sorted into the furniture tab? I've seen something where a block is simultaneously a block and a crafting ingredient, and the item awkwardly switches rapidly between both when click-held.
     
  2. Cyel

    Cyel Scruffy Nerf-Herder

    I don't think you can use actionOnReap to place objects (you can use it for liquids of tiles tho), you'd probably need a custom Lua script, and the similar-est I can find is /projectiles/guns/grenades/proximitymines/
    Something like this should work:
    Code:
    function update(dt)
       if self.hitGround or mcontroller.onGround() then
         mcontroller.setRotation(0)
         world.placeObject("objectName", mcontroller.position())
        projectile.die()
       else
         mcontroller.setRotation(math.atan(mcontroller.velocity()[2], mcontroller.velocity()[1]))
       end
    Edit: just tested it out with placeholder vanilla assets, and it's actually really fun:
    https://imgur.com/a/l10JqoA
    [​IMG]
     

    Attached Files:

    The | Suit likes this.
  3. Iaeyan Elyuex

    Iaeyan Elyuex Cosmic Narwhal

    Okay! My odd request has spurred the invention of the Chair Gun! Thanks for the code, friendo.
     
    Cyel likes this.

Share This Page