Modding Help Where are these effects?

Discussion in 'Starbound Modding' started by Mackinz, Feb 28, 2015.

Thread Status:
Not open for further replies.
  1. Mackinz

    Mackinz The Waste of Time

    Edit: Now I need to figure out how to make "fireImmunity" into a status effect so that a given consumable can apply it for a given duration.

    Help is appreciated. I have zero experience with LUA.

    I'm currently looking for where effects, like "regeneration4", are found in the assets. If someone could point me to the correct folder, that would be great. The "effects" folder seems to deal with particle use by these effects, and does not contain the raw effect data itself.
     
    Last edited: Feb 28, 2015
  2. The | Suit

    The | Suit Agent S. Forum Moderator

    Best Answer
    BlockingStat is a binary value. 0 or 1.

    If you want 50% value you will have to change the damage calculation entirely.

    Code:
    damageType = "IgnoresDef",
            damage = math.floor(status.resourceMax("health") * self.tickDamagePercentage) + 1,
    You will need to first modify the burning lua code
    To something like

    Code:
    damageType = "IgnoresDef",
            damage = (math.floor(status.resourceMax("health") * self.tickDamagePercentage) + 1) * status.stat(fireArmor), 
    Though the above formula would require without armor to = 1
    But its just for sake of quick example.

    ==

    My temperature mod deals a lot with this stuff. If you want a better idea
    http://github.com/xxswatelitexx/Starbound_Temperature

    Use the link above so you can see the code without having to download it.
     
  3. GROVER CURES HOUSES

    GROVER CURES HOUSES Void-Bound Voyager

    Check out stats\effects\regeneration. References regeneration.lua, which is where the magic happens.
     
  4. Mackinz

    Mackinz The Waste of Time

    I managed to find it shortly before you posted, Grover. I will keep this thread open for any questions I might have regarding status effects in the near future. :nod:[DOUBLEPOST=1425108362][/DOUBLEPOST]Okay, question time.

    I want to make an item which makes the player resistant to burning. In burning.statuseffect, there is this little bit of coding:

    Code:
    "blockingStat" : "fireImmunity",
    Which obviously indicates that the status effect that blocks burning is "fireImmunity". So I pasted "fireImmunity" into the effects given by a consumable when eaten, crafted the consumable in-game, ate it and...

    Code:
    [23:22:02.653] Error: Exception caught in client main-loop: (StatusEffectDatabaseException) No such unique stat effect 'fireImmunity'
      StatusEffectDatabaseException::StatusEffectDatabaseException(string)
      StatusEffectDatabase::uniqueEffectConfig(String)
      StatusController::defaultUniqueEffectDuration(String)
      StatusController::addEphemeralEffects(List<EphemeralStatusEffect, deque<EphemeralStatusEffect, allocator<EphemeralStatusEffect> > >)
      ConsumableItem::fireTriggered()
      FireableItem::update(EntityMode)
      ConsumableItem::update(EntityMode)
      ToolUser::tick(bool, bool, EntityMode)
      Player::tickShared()
      Player::tickMaster()
      _Function_handler<void (shared_ptr<Entity>), WorldClient::update()::{lambda(shared_ptr<Entity>)#3}>::(_Any_data, shared_ptr<Entity>)
      EntityMap::forAllEntities(function<void (shared_ptr<Entity>)>)
      WorldClient::update()
      UniverseClient::update()
      ClientApplication::updateRunning()
      ClientApplication::update()
      StarApplicationBase::run()
      _SDL_main
      _console_main
    Tell me, oh glorious @GROVER CURES HOUSES, what should I do? D:
     
    Last edited: Feb 28, 2015
  5. GROVER CURES HOUSES

    GROVER CURES HOUSES Void-Bound Voyager

    Fire immunity is not an effect. It's just a property, like name or description. You need to set "statusSettings" : { "stats" : { "fireImmunity" : { "baseValue" : 1.0 } } } to have 100% fire protection. Going off mostly memory + 2 second grep.

    e: uh status settings is for spawning things, isn't it? fuck it, it's a stat like health and energy, set it like one of those
     
  6. Mackinz

    Mackinz The Waste of Time

    And where would I add that?

    Edit: Just to clarify, I do not want the effect to be permanent. I want it to be temporary, and wear off after a certain period.
     
  7. The | Suit

    The | Suit Agent S. Forum Moderator

    Code:
    {
      "itemName" : "apegrapes",
      "rarity" : "Common",
      "inventoryIcon" : "apegrapes.png",
      "description" : "A healthy mix of bananas and grapes.",
      "shortdescription" : "Ape Grapes",
      "handPosition" : [0, -4],
      "effects" : [ [
        {
            "effect" : "maxhealthboost20",
            "duration" : 105
        },
        {
            "effect" : "maxenergyboost40",
            "duration" : 105
        },
        {
            "effect" : "wellfed",
            "duration" : 210
        }
      ] ],
      "blockingEffects" : [
        "wellfed"
      ],
      "learnBlueprintsOnPickup" : [ "fruitsalad" ]
    }
    
     
  8. Mackinz

    Mackinz The Waste of Time

    Um... okay. I have no idea why you posted the coding for Ape Grapes here when there isn't even a reference to fire, burning or other such attributes, but okay.
     
  9. Nerva

    Nerva Parsec Taste Tester

    I'm not all that certain, but I'm guessing you'd have to define an effect that provides FireImmunity=1.00 as Grover said, and then insert that effect into the food's list of effects, along with a duration to make it temporary.

    The end result of your food's entry would look something like this, I imagine.

    Code:
    {
      "itemName" : "FireBlockingFood",
      "rarity" : "Common",
      "inventoryIcon" : "apegrapes.png",
      "description" : "Eat this, then go dance on hot coals.",
      "shortdescription" : "Fire Blockin' Food",
      "handPosition" : [0, -4],
      "effects" : [ [
        {
            "effect" : "FireImmunity100",
            "duration" : 105
        }
      ] ],
      "blockingEffects" : [
        "wellfed"
      ],
      "learnBlueprintsOnPickup" : [ "fruitsalad" ]
    }
    Not having a lot of experience with this, I'm not sure where you'd define what the FireImmunity100 effect is. If I'm wrong, here's a hammer, club me with it.
    Ball-peen_hammer_380mm.JPG
     
    Last edited: Feb 28, 2015
  10. GROVER CURES HOUSES

    GROVER CURES HOUSES Void-Bound Voyager

    Alright, so "statusEffects" : [ { "stat" : "fireImmunity", "amount" : 1.0 } ] doesn't crash, but fireImmunity also doesn't have an icon associated with it so I don't really know if it's doing anything. Look at how statuseffects are written, make one that sets fireImmunity to 1.0, add a duration and use that. fireImmunity appears to be a really hacky way to stop monsters from burning to death in hot biomes, so I have no idea how it will interact with players.
     
  11. Mackinz

    Mackinz The Waste of Time

    I have exactly zero experience with LUA thus far so I gotta take this slow.

    I'll start with a file that already exists in the assets (liquidImmunity.lua):

    Code:
    function init()
      effect.addStatModifierGroup({
        {stat = "lavaImmunity", amount = 1},
        {stat = "poisonImmunity", amount = 1},
        {stat = "tarImmunity", amount = 1},
        {stat = "waterImmunity", amount = 1},
      })
    end
    
    function update(dt)
    end
    
    function uninit()
    end
    
    If I copied that file, renamed it, and edited it to the following, would it work?

    Code:
    function init()
      effect.addStatModifierGroup({
        {stat = "lavaImmunity", amount = 0.5},
        {stat = "fireImmunity", amount = 0.5},
      })
    end
    
    function update(dt)
    end
    
    function uninit()
    end
     
  12. The | Suit

    The | Suit Agent S. Forum Moderator

    Stats are custom parameters.
    These are generally added to items which are meant to be kept on the player.

    You want a temporary blocking of an effect you can use blockingEffects instead.

    blockingEffects = This effect will not be applied on the player as long as this - player is currently under the influence of "X" effect.
    Hence the reason I pasted apex grapes.
     
  13. Mackinz

    Mackinz The Waste of Time

    ...

    Well, you could have just said that outright instead of assuming I knew why you were posting easily accessible Ape Grapes coding that is largely the same as other food coding...

    Anyway, I'm not really interested in blocking the effect entirely. I'm more interested in reducing the effect by 50%, and the same for "melting" as applied by lava.
     
  14. GROVER CURES HOUSES

    GROVER CURES HOUSES Void-Bound Voyager

    "statusEffects" : [ { "stat" : "fireImmunity", "amount" : 0.5, "duration" : 10 } ] will get you 50% fire damage reduction for 10s, I think.
     
  15. Mackinz

    Mackinz The Waste of Time

    I'm off to start testing. Wish me luck.
     
  16. GROVER CURES HOUSES

    GROVER CURES HOUSES Void-Bound Voyager

    Burning.lua determines how burn damage is applied and it doesn't check the float at all. It either does no damage in the immunity is active or full damage if it isn't. You could modify it...
     
    The | Suit likes this.
  17. The | Suit

    The | Suit Agent S. Forum Moderator

    Best Answer
    BlockingStat is a binary value. 0 or 1.

    If you want 50% value you will have to change the damage calculation entirely.

    Code:
    damageType = "IgnoresDef",
            damage = math.floor(status.resourceMax("health") * self.tickDamagePercentage) + 1,
    You will need to first modify the burning lua code
    To something like

    Code:
    damageType = "IgnoresDef",
            damage = (math.floor(status.resourceMax("health") * self.tickDamagePercentage) + 1) * status.stat(fireArmor), 
    Though the above formula would require without armor to = 1
    But its just for sake of quick example.

    ==

    My temperature mod deals a lot with this stuff. If you want a better idea
    http://github.com/xxswatelitexx/Starbound_Temperature

    Use the link above so you can see the code without having to download it.
     
  18. Mackinz

    Mackinz The Waste of Time

    Hmm... well, I'm not experienced enough to modify it, but I do have some good test results thus far with setting lavaImmunity to 1 for my new status effect. So, I'll try 0.5 next.

    And that is not what I want to do, xxswatelitexx. I know you're trying to be helpful, but I am trying to make a status effect, not purely block damage.
     
  19. GROVER CURES HOUSES

    GROVER CURES HOUSES Void-Bound Voyager

    But its a floaaaaat (╯°□°)╯︵ ┻━┻
     
  20. The | Suit

    The | Suit Agent S. Forum Moderator

    Ya all stat values are floats.
    But that isn't how damage is calculated.

    Unless they changed something recently that I am not aware of.
     
  21. GROVER CURES HOUSES

    GROVER CURES HOUSES Void-Bound Voyager

    Damage is applied directly by that script, without shenanigans you would end up having to edit it for partial damage reduction no matter what.
     
Thread Status:
Not open for further replies.

Share This Page