Modding Help Back again, need more help re: status effects. Please read and advise.

Discussion in 'Starbound Modding' started by @lias, Apr 16, 2017.

  1. @lias

    @lias Void-Bound Voyager

    I have confirmed it is possible to use status effects to change a player's collisionpoly on the fly. This leaves only the issue of personal arm rotation to solve before I can get back to work on my mod.

    Please look over the following information and advise.

    Looking through the status effects, I found swimboost.
    Here's swimboost.statuseffect:
    Code:
    {
      "name" : "swimboost",
      "effectConfig" : {
        "movementParameters" : {
          "liquidImpedance" : 0.1,
          "liquidForce" : 150,
          "liquidJumpProfile" : {
            "jumpSpeed" : 150.0
          }
        }
      },
      "defaultDuration" : 5,
    
      "scripts" : [
        "swimboost.lua"
      ]
    }
    
    And swimboost.lua:
    Code:
    function init()
      self.movementParameters = config.getParameter("movementParameters", {})
    end
    
    function update(dt)
      mcontroller.controlParameters(self.movementParameters)
    end
    
    function uninit()
    end
    
    You will note that movementParameters in swimboost.statuseffect and some of its constituent parameters are identical to the movementParameters listed in the player.config. Here's the relevant part of the player.config.
    Code:
      "movementParameters" : {
        "standingPoly" : [ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, 0.65], [0.35, 1.22], [-0.35, 1.22], [-0.75, 0.65] ],
        "crouchingPoly" : [ [-0.75, -2.0], [-0.35, -2.5], [0.35, -2.5], [0.75, -2.0], [0.75, -1], [0.35, -0.5], [-0.35, -0.5], [-0.75, -1] ],
        "mass" : 1.6,
    
        // should keep the player from teleporting through walls
        "maximumCorrection" : 3,
        "maxMovementPerStep" : 0.4,
    
        "liquidFriction" : 13.0,
        "normalGroundFriction" : 35.0,
    
        "groundForce" : 250.0,
        "airForce" : 50.0,
        "liquidForce" : 80.0
    
    Note that the player's collision poly is also listed under these parameters.
    Replacing the parameters relating to liquid movement with collision poly information, example below;
    Code:
    {
      "name" : "testo",
      "effectConfig" : {
        "movementParameters" : {
          "standingPoly" : [ [-1, -2.5], [-1, -0.5], [1, -0.5], [1, -2.5] ],
          "crouchingPoly" : [ [-1, -2.5], [-1, -1.5], [1, -1.5], [1, -2.5] ]
        }
      },
      "defaultDuration" : 5,
    
      "scripts" : [
        "testo.lua"
      ]
    }
    
    results in a status effect that gives the player a 2x2 block hitbox while standing, and a 2x1 block hitbox while crouching.

    I tried to do the same thing with the arm rotation parameters, but those seem to be under the jurisdiction of something other than the mcontroller, and it didn't work.

    For reference, these are the parameters in the humanoid.config that relate to arm rotation, offset and hand anchoring.
    Code:
      "frontArmRotationCenter" : [-4, -1],
      "backArmRotationCenter" : [-3, 0],
      // The anchor for items held in the front hand
      "frontHandPosition" : [8, -3],
    
      // The pixel difference between the front and back arms, all data for the
      // back arm is calculated by adding this offset to the front arm values.
      "backArmOffset" : [3, 0],
    
    Bottom line: What controller governs player arm rotation, is there an existing status effect I could piggyback off of as I did for the collision poly, and if none exist what would I have to do in order to change it as easily, quickly, and cleanly as this?

    Please advise, thanks in advance.
     
  2. @lias

    @lias Void-Bound Voyager

    Because I don't have as much time to work on mods as I used to, I'd also like to offer up a fun bounty in hopes of expediting an answer.
    The bounty is $30 worth of steam games of your choice, gifted to the first person who produces a verifiable solution to this problem. Verifiable in this case meaning that it works, can be replicated, and doesn't cause any game-destroying errors. If there end up being multiple people(a maximum of 3) who come forward with similar but separately-reached solutions within the same day or so, they'll also be awarded the bounty in appreciation of their time and effort.

    This is really important to me, as it represents the last hurdle between what I want to do and what I can feasibly do with my mod, and I'd really like to clear it as soon as possible so I can finally start taking it and other projects to their full potential.

    Thanks!
     

Share This Page