Modding Help Looking for someone to help demystify transformation tech-style status effects

Discussion in 'Starbound Modding' started by Throwaway, Apr 26, 2016.

  1. Throwaway

    Throwaway Void-Bound Voyager

    Statuses got changed to use LUA now and are able to more or less fill the shoes of older techs due to the added flexibility, iirc. What I want to do is make something that's able to change the players abilities like the morphball or old mech tech, and put it on a hat or something. As far as I can tell this should be possible? Unfortunately I don't quite understand the guts of the things you would need to make them work, namely the .animation and .LUA files. It's just really dense and layered and I'm not really sure what does what in there. If somebody has an explanation of what all the parts of an .animation file do or would be willing to walk me through it I'd be really grateful.

    I'm not too well-versed in this sort of thing but if I can get something together that at least works/doesn't crash, I should be able to reverse-engineer whatever I need from there. I just can't get there on my own. Thanks in advance.
     
  2. C0bra5

    C0bra5 Oxygen Tank

    you could try to do use
    status.SetRessource("resourcename", numberValue);
    and
    status.GetRessource("ressourcename");

    this will permanently assign a value to a character.
    then you could override/modify the scripts and .animation to fit you new animations. then you would use logic to get the fake ressource and add set the animation state to a different animation state depending on what was returned.
    note that getting a non existing value will return nil
     
  3. Throwaway

    Throwaway Void-Bound Voyager

    OK, I'm not 100% sure what most of what you just said means, but it sounds way more complicated of a solution than what I'm guessing would actually be needed. The precedent and framework is already there ingame with the morphball and mech/vehicle techs, I just want to find some way to convert it into a status effect rather than a tech for convenience so people don't have to go into their tech menu all the time. I know this sort of thing is possible, because there are mods that have done it like the chocobo mod, XS Mechs, that Megaman X mod. I just want, like, a hat that turns you into a bird or something for as long as you're wearing it.

    Or, to be more precise, an axolotl [​IMG]

    I have all the assets I need, but I don't understand the ordering and significance of all the crap in the .animation file, so I can't get anything going. I posted this thread to see if anyone had any sort of fleshed-out documentation of the .animation and .lua files that a layperson could understand, or if anyone would be willing to walk me through what all the different functions mean. For clarity's sake, I'm talking about an actual mod and not cheat engine stuff or whatever it is that people are always asking about here like "how do i make my character smaller, how do I get godmode armor vanilla etc." I appreciate your answer though, even if I don't understand it.
     
  4. C0bra5

    C0bra5 Oxygen Tank

    The lua documentation is pretty scarce right now, I have my own website but I haven't got the time to properly update it since the last stable update.

    But here is the one I can remember that should be 90% of what you will need, though I think that effect files uses a table called effect instead of animator.


    animator.setAnimationState(string AnimationPart, string State)
    Let's say you have a "body" animation part that has 4 states, IdleLeft, IdleRight, MoveRight, MoveLeft. In your animation you would need to set your animations depending on the character movement since there is no input function in the effect lua files.

    So here is some code that might or not work
    Code:
    function update()
      if mcontroller.facingDirecrion() == -1 then
        if math.abs(mcontroller.xVelocity()) > 5 then
          animator.setAnimationState("Body", "MoveLeft");
        else
          animator.setAnimationState("Body", "IdleLeft");
        end
      else
        If math.abs(mcontroller. xVelocity ()) > 5 then
          animator.setAnimationState(" Body", "MoveRight");
        else
          animator.setAnimationstate(" Body", "IdleRight");
        end
      end
    end
    
    Well j just wrote that on my phone.... Let's hope the autocorrect doesn't break the code
     
  5. BreakingForce

    BreakingForce Big Damn Hero

    well, the xs mechs are vehicles now. perhaps you could do the same and make it a vehicle-type transformation item.
     

Share This Page