Modding Help Help with Custom Spell Cooldown

Discussion in 'Starbound Modding' started by SophieKitty, Nov 14, 2019.

  1. SophieKitty

    SophieKitty Void-Bound Voyager

    Hey I'm modding again after a few years (finally).

    Let me get straight to the issue:

    I made a summoning spell out of the Element Portal base, the Summon itself is correct, but the projectiles it spawns are all rotated in random directions and its annoying, I've been trying to fix this for quite a bit of time now but I don't know how.
    Seems like the code part from the other spells like "orientationLocked" : true, doesnt seem to work.


    20191114044409_1.jpg

    Below for current issue:

    -----Edit-----
    Oh also I just noticed that changing the weapon back and forth skips the 30 second cooldown........ which is also really bad, any way to get around that?

    ----Edit-14.11.2019-15.25----
    I found the issue, I edited a LUA file that controls it, it works fine now for the rotation.

    BUT the cooldown issue is still there, not sure if that can be done though
     
    Last edited: Nov 15, 2019
  2. Zaakari

    Zaakari Pangalactic Porcupine

    Welcome back.

    I'm just thinking here, but would you be able to add a status effect to the character upon the spell cast (that lasts for 30 seconds)?
    And then add a section to the spell cast's "init()" that checks for the presence of said status effect, either allowing the ability to be cast, or preventing it.
     
  3. SophieKitty

    SophieKitty Void-Bound Voyager

    1. The spell hits only enemies and objects, is it even possible to set a status on self with that?
    2. Lua is a bit confusing, i had a look through that stuff, thought of copying the shield-cooldowntimer but Lua has so many rules i dont know about

    3.
    thanks!
     
  4. Zaakari

    Zaakari Pangalactic Porcupine

    I believe you should be able to check for (or apply) the status effect in either the ability's "init" or "update" functions (or any function, really; but I think you'd want either of those).

    If you take a look at my last answer in this post I did something similar.
    Now in that post, I had applied a flag-like status effect through the bleeding effect that was attached to a sword.
    However, you should be able to apply the effect the same way within any Lua file attached to a ".weaponability" file.

    (I hope that didn't come out too confusing)
     

Share This Page