Modding Help Monster Flee States?

Discussion in 'Starbound Modding' started by EclipticWulf, Aug 31, 2017.

  1. EclipticWulf

    EclipticWulf Scruffy Nerf-Herder

    Does anyone know how to make a flee state? I want to make wild farmables that flee upon being attacked.
     
  2. SpazDiesFirst360.0

    SpazDiesFirst360.0 Phantasmal Quasar

    Cool idea. Don't know where somebody would start though.
     
  3. EclipticWulf

    EclipticWulf Scruffy Nerf-Herder

    ...you start with the empty "fleeActions" : [] array seen in some monster files.

    For example, the adultpoptop file
    Code:
    {
      "type" : "adultpoptop",
      "shortdescription" : "Adult Poptop",
      "description" : "It's huge...",
    
      "categories" : [ "adultpoptop" ],
      "parts" : [ "body" ],
    
      "animation" : "adultpoptop.animation",
    
      "dropPools" : [ { "default" : "adultpoptopTreasure", "bow" : "adultpoptopHunting" } ],
    
      "baseParameters" : {
        "scripts" : [
          "/monsters/monster.lua"
        ],
    
        "behavior" : "monster",
    
        "behaviorConfig" : {
          "damageOnTouch" : true,
    
          "targetQueryRange" : 20,
          "targetOnDamage" : true,
          "keepTargetInSight" : true,
          "keepTargetInRange" : 50,
          "targetOutOfSightTime" : 2.5,
          "hurtTime": 0.10,
          "hurtWaitForGround": false,
          "hurtWaitForGroundTime": 0.1,
    
          "foundTargetActions" : [  ],
    
          "fleeActions" : [],
    
          "hostileActions" : [
            {
              "name" : "action-animate",
              "cooldown" : 15,
              "parameters" : {
                "stateType" : "body",
                "state" : "roar",
                "animationTime" : 0.53
              }
            },
            {
              "name" : "action-charge",
              "cooldown" : 6.0,
              "parameters" : {
                "maximumRange" : 15,
                "windupState" : "chargewindup",
                "windupTime" : 0.3,
    
                "chargeTime" : 0.1,
                "chargeSpeed" : 30,
                "chargeControlForce" : 1000,
                "chargeState" : "charge",
                "wallCrashSound" : "",
                "wallCrashEmitter" : "",
    
                "winddownTime" : 0.05,
                "winddownStopForce" : 1000,
                "winddownState" : "chargewinddown"
              }
            }
          ],
    
          "periodicActions" : [],
    
          "approachActions" : [
            {
              "name" : "approach-walk",
              "parameters" : {
                "canJump" : true,
                "maxJumps" : 5,
                "jumpXVelocity" : 12,
                "jumpYVelocity" : 30,
                "jumpXControlForce" : 50,
                "minXRange" : 10
              }
            }
          ],
    
          "followActions" : [
            {
              "name" : "approach-teleport",
              "parameters" : {
              }
            },
            {
              "name" : "approach-walk",
              "parameters" : {
                "canJump" : true,
                "maxJumps" : 5,
                "jumpXVelocity" : 12,
                "jumpYVelocity" : 30,
                "jumpXControlForce" : 50,
                "minXRange" : 10
              }
            }
          ],
    
          "wanderActions" : [
            {
              "name" : "wander-walk",
              "cooldown" : 6.0,
              "parameters" : {
                "wanderTime" : [5, 15]
              }
            }
          ]
        },
    
        "damageParts" : {
          "body" : {
            "damage" : 13,
    
            "teamType" : "enemy",
            "damageSourceKind" : "slash",
            "knockback" : 20,
            "statusEffects" : [ ]
          }
        },
    
        "touchDamage" : {
          "poly" : [ [1.75, 2.55], [2.25, 2.05],  [2.75, -3.55], [2.25, -3.95],  [-2.25, -3.95], [-2.75, -3.55],  [-2.25, 2.05], [-1.75, 2.55] ],
          "damage" : 13,
    
          "teamType" : "enemy",
          "damageSourceKind" : "slash",
          "knockback" : 20,
          "statusEffects" : [ ]
        },
    
        "metaBoundBox" : [-4, -4, 4, 4],
        "scale" : 1.0,
    
        "movementSettings" : {
          "collisionPoly" : [ [1.75, 2.55], [2.25, 2.05],  [2.75, -3.55], [2.25, -3.95],  [-2.25, -3.95], [-2.75, -3.55],  [-2.25, 2.05], [-1.75, 2.55] ],
    
          "mass" : 2.5,
          "walkSpeed" : 2,
          "runSpeed" : 3,
    
          "airFriction" : 0,
    
          "airJumpProfile" : {
            "jumpSpeed" : 35.0,
            "jumpInitialPercentage" : 1.0,
            "jumpHoldTime" : 0.0
          }
        },
    
        "bodyMaterialKind" : "organic",
    
        "knockoutTime" : 0.3,
        "knockoutAnimationStates" : {
          "damage" : "stunned"
        },
        "deathParticles" : "deathPoof",
        "knockoutEffect" : "",
    
        "statusSettings" : {
          "statusProperties" : {
            "targetMaterialKind" : "organic"
          },
    
          "appliesEnvironmentStatusEffects" : false,
          "appliesWeatherStatusEffects" : true,
          "minimumLiquidStatusEffectPercentage" : 0.1,
    
          "primaryScriptSources" : [
            "/stats/monster_primary.lua"
          ],
          "primaryScriptDelta" : 5,
    
          "stats" : {
            "knockbackStunTime" : {
              "baseValue" : 0.25
            },
            "knockbackThreshold" : {
              "baseValue" : 9
            },
            "maxHealth" : {
              "baseValue" : 180
            },
            "protection" : {
              "baseValue" : 0.0
            },
            "healthRegen" : {
              "baseValue" : 0.0
            },
            "powerMultiplier" : {
              "baseValue" : 1.0
            },
            "physicalResistance" : {
              "baseValue" : 0.0
            },
            "fireResistance" : {
              "baseValue" : 0.0
            },
            "fireStatusImmunity" : {
              "baseValue" : 0.0
            },
            "iceResistance" : {
              "baseValue" : 0.0
            },
            "iceStatusImmunity" : {
              "baseValue" : 0.0
            },
            "electricResistance" : {
              "baseValue" : 0.0
            },
            "electricStatusImmunity" : {
              "baseValue" : 0.0
            },
            "poisonResistance" : {
              "baseValue" : 0.0
            },
            "poisonStatusImmunity" : {
              "baseValue" : 0.0
            }
          },
    
          "resources" : {
            "stunned" : {
              "deltaValue" : -1.0,
              "initialValue" : 0.0
            },
            "health" : {
              "maxStat" : "maxHealth",
              "deltaStat" : "healthRegen",
              "defaultPercentage" : 100
            }
          }
        },
    
        "mouthOffset" : [0, 0],
        "feetOffset" : [0, -8],
        "capturable" : true,
        "captureHealthFraction" : 0.5,
        "nametagColor" : [64, 200, 255],
        "captureCollectables" : { "monsters" : "adultpoptop" }
      }
    }
    

    Also if anyone knows of any place besides the forums or reddit that can help with modding, please let me know. A discord perhaps? I'm not sure if anything exists. But I have a lot of questions and most I have submitted never got an answer, so it would help.
     
  4. SpazDiesFirst360.0

    SpazDiesFirst360.0 Phantasmal Quasar

    I know there's a discord server for Starbound, bu it's been over 2 months since I last logged in, so I may not be able to create an invite. There's also an FU discord, joined via an invite on the wiki main page.
     
    EclipticWulf likes this.

Share This Page