Modding Help Particle bursts?

Discussion in 'Starbound Modding' started by Pint, Dec 5, 2016.

Tags:
  1. Pint

    Pint Space Spelunker

    Can't seem to find an API function for emitting particles without an entity/projectile attached. Is there any way to do this?
     
  2. IHart

    IHart Scruffy Nerf-Herder

    What are we trying to get to emit particles? A tile? The player?
     
  3. Pint

    Pint Space Spelunker

    Not necessarily anything. I'd like to be able to trigger a burst of particles at any given point in the world. Or at least a point offset from the object.

    It's for a odd sprinkler kind of thing. I'd like for it to display a puff of green particles at the tile's position whenever a tile is moisturized. The problem is that I’m not using projectiles with the modify setting-- I’m just using raw Lua.
     
  4. bk3k

    bk3k Oxygen Tank

    Probably just add particleEmitters(check out techs for examples) to an animation file attached to part states. Set the state with LUA.
    on the same lines where you see things like
    Code:
    {
      "image" : "stringHere"
    }
    you could have
    Code:
    {
      "particle" : "defaultblue",
      "offset" : [0.2, -3]
    }
    
    etc


    for example on doors you might change the part state like this
    Code:
    local aState = "closed"
    animator.setAnimationState("doorState", aState)
    in that case "doorState" is found in the animation file for the door. Substitute it for your own part and part states.

    You could even do this.
    Code:
    local offset = "[" .. tostring(dist[1]) .. ", " .. tostring(dist[2]) .. "]"
    animator.setGlobalTag("offset", offset)
    animator.setAnimationState("sprinkles", sprinkleState)
    then in the animation file
    Code:
    {
      "particle" : "defaultblue",
      "offset" : <offset>
    }
     

Share This Page