Modding Help Making a mod to make ores glow briefly - NO IDEA what I'm doing. Assistance needed!

Discussion in 'Starbound Modding' started by RacketLord, Aug 10, 2016.

  1. RacketLord

    RacketLord Scruffy Nerf-Herder

    Hi. So i'm sure many of us are familiar with a little game called Terraria. In it, there is a thing called a Spelunker Potion that highlights ores for a brief period of time. I see that there is an "Illuminated Ores" mod, but that one has the ores glowing all the time. I wanted a mod that adds in that feature, but in a more "immersive" way, I guess you could say. Which is why I came up with...

    [​IMG]
    The Spelunker Stim!

    I already have the art assets in the game. I can use the stim, the sound plays, my buff icon is displayed in the top left corner until the duration passes. Of course, the stim itself does not work, but that's where you guys come in! I know nothing on how to actually make it so that ores glow for the duration of the stim (2.5 minutes) then go back to being all unglowy (ew) when it expires. I would also like having each ore glow have their own color relative to the color of the ore. Any assistance in helping me set that up would be greatly appreciated. Does something like that require LUA scripting? I have zero experience doing that. D: I also want it to be compatible with the Frackin' Universe ores, too.

    On top of that, i'm having some other minor issues with this thing. Such as:

    1. I can't actually craft the thing! I have it tied to the Apothecary, but it doesn't show up for crafting UNLESS I do /admin first, then it appears in the proper location. If I disable /admin, it goes away again.

    2. If I spam-click with the stim equipped, I can keep going through them. Unlike normal stims where you cannot use another one until the effect expires. Knowing how to prevent mass stim spam is important to me. Can't have people poking all those holes into their arms, now can we?

    Any help you guys could provide would be awesome. First time making a mod, so it's a bit overwhelming, but we all gotta start somewhere, eh?
     
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    1. You need to learn the recipe - either by learn blueprint or player.config

    2. Look at blocking effects on food

    3. To make ores glow briefly you need to know Lua.
     
  3. TheDerpySupport

    TheDerpySupport Subatomic Cosmonaut

    Just another thing to add there is already an item in game that does what you're trying to do called the Ore Detector :wut: If anything you can rip the coding from that if you're hellbent on making a stimpack for the same effect
     
  4. Nirrudn

    Nirrudn Void-Bound Voyager

    Kind of an aside, but I found the Ore Detector to be extremely underwhelming. By the time you get it, you don't really need it anymore, since it requires (nearly) end-game ores to make. This stim sounds like it might be fairly early game and see a lot more usage.
     
  5. RacketLord

    RacketLord Scruffy Nerf-Herder

    1. Turns out my player.config.patch wasn't written correctly. Was able to fix it thanks to Naddox's tutorial video on blueprints!

    2. Got that knocked out, too. I was testing blockingEffects earlier, but once again, a missing comma made me believe I wasn't doing it properly since the game would crash. Hooray programming!

    3. I had a feeling. Now I just need to figure out how to make ores glow in LUA script. Maybe even letting the stim make storage containers glow, too. That would be the toughest part for me, as I have never dealt with a programming language of any kind, so seeing stuff like

    Code:
    function init()
      world.sendEntityMessage(entity.id(), "queueRadioMessage", "full")
    
      animator.setParticleEmitterOffsetRegion("healing", mcontroller.boundBox())
      animator.setParticleEmitterActive("healing", config.getParameter("particles", true))
    
      self.healingRate = 1.0 / config.getParameter("healTime", 60)
    
      script.setUpdateDelta(5)
    end
    makes my brain cry. If anyone has any tips, resources or even willing to throw together a bare-bones template I could work off of - anything would be super helpful. You've already been very helpful, so thank you for that!
     
  6. TheDerpySupport

    TheDerpySupport Subatomic Cosmonaut

    Like I suggested; rip the lua code from the Ore Detector item
     

Share This Page