Modding Help Custom Monster Not Spawning

Discussion in 'Starbound Modding' started by Rat-Thing, May 8, 2019.

  1. Rat-Thing

    Rat-Thing Phantasmal Quasar

    So I'm trying to make a custom monster for a certain biome, and, obviously, isn't spawning, even through /spawnmonster in the least laggy place i can think of.
    So, upon looking into the log, i spy this;
    But, bizarrely enough, I have that exact key typed out in the .monstertype file, and i have zero idea is going on with the file in the first place.
    {
    "type" : "z4sentrider",
    "shortdescription" : "Sentrider",
    "description" : "An ancient warmech from a bygone era",

    "categories" : [ "z4sentrider" ],
    "parts" : [ "body" ],

    "animation" : "z4sentrider.animation",

    "baseParameters" : {
    "scripts" : [
    "/monsters/monster.lua"
    ],

    "behavior" : "monster",

    "behaviorConfig" : {
    "damageOnTouch" : true,

    "targetQueryRange" : 20,
    "targetOnDamage" : true,
    "keepTargetInSight" : true,
    "keepTargetInRange" : 50,
    "targetOutOfSightTime" : 2.5,

    "foundTargetActions" : [ { "name" : "action-aggrohop" } ],

    "fleeActions" : [],

    "hostileActions" : [
    {
    "name" : "action-fire",
    "cooldown" : 3.0,
    "parameters" : {
    "maximumRange" : 15,
    "minimumRange" : 2,
    "windupState" : "",
    "windupTime" : 0.0,

    "projectileType" : "lightning",
    "fireOffset" : [1.0, 1],
    "aimAtTarget" : true,
    "fireState" : "fire",
    "fireDelay" : 0.2,
    "fireSound" : "",

    "fireArc": true,
    "projectileSpeed": 32,
    "gravityMultiplier": 0.6,

    "winddownState" : "",
    "winddownTime" : 2
    }
    }
    ],

    "periodicActions" : [],

    "approachActions" : [
    {
    "name" : "approach-walk",
    "parameters" : {
    "canJump" : true,
    "maxJumps" : 6,
    "jumpXVelocity" : 12,
    "jumpYVelocity" : 30,
    "jumpXControlForce" : 50,
    "minXRange" : 10
    }
    }
    ],

    "followActions" : [
    {
    "name" : "approach-teleport",
    "parameters" : {
    }
    },
    {
    "name" : "approach-walk",
    "parameters" : {
    "canJump" : true,
    "maxJumps" : 6,
    "jumpXVelocity" : 12,
    "jumpYVelocity" : 30,
    "jumpXControlForce" : 50,
    "minXRange" : 10
    }
    }
    ],

    "wanderActions" : [
    {
    "name" : "wander-walk",
    "cooldown" : 6.0,
    "parameters" : {
    "wanderTime" : [3, 6]
    }
    }
    ]
    },

    "metaBoundBox" : [-2.5, -2.5, 2.5, 2.5],
    "scale" : 1.0,

    "touchDamage" : {
    "poly" : [ [0.0, 1.5], [1.0, 0.5], [1.5, -0.5], [1.0, -1.5], [0.0, -2.5], [-1.0, -1.5], [-1.5, -0.5], [-1.0, 0.5] ],
    "damage" : 15,

    "teamType" : "enemy",
    "damageSourceKind" : "lash",
    "knockback" : 20,
    "statusEffects" : [ ]
    },

    "movementSettings" : {
    "collisionPoly" : [ [0.0, 1.5], [1.0, 0.5], [1.5, -0.5], [1.0, -1.5], [0.0, -2.5], [-1.0, -1.5], [-1.5, -0.5], [-1.0, 0.5] ],

    "mass" : 1.6,
    "walkSpeed" : 2,
    "runSpeed" : 4,
    "flySpeed" : 6,
    "airForce" : 50.0,

    "airJumpProfile" : {
    "jumpSpeed" : 5.0
    }
    },

    "bodyMaterialKind" : "organic",

    "knockoutTime" : 0.3,
    "knockoutAnimationStates" : {
    "damage" : "stunned"
    },
    "knockoutEffect" : "blink",
    "deathParticles" : "deathPoof",

    "statusSettings" : {
    "statusProperties" : {
    "bodyMaterialKind" : "stone",

    "knockoutTime" : 0.3,
    "knockoutAnimationStates" : {
    "damage" : "stunned"
    },
    "deathParticles" : "deathPoof",
    "knockoutEffect" : "",

    "statusSettings" : {
    "statusProperties" : {
    "targetMaterialKind" : "stone"
    },

    "appliesEnvironmentStatusEffects" : false,
    "appliesWeatherStatusEffects" : true,
    "minimumLiquidStatusEffectPercentage" : 0.1,

    "primaryScriptSources" : [
    "/stats/monster_primary.lua"
    ],
    "primaryScriptDelta" : 5,

    "stats" : {
    "knockbackStunTime" : {
    "baseValue" : 0.25
    },
    "knockbackThreshold" : {
    "baseValue" : 9
    },
    "maxHealth" : {
    "baseValue" : 100
    },
    "protection" : {
    "baseValue" : 0.0
    },
    "healthRegen" : {
    "baseValue" : 0.0
    },
    "powerMultiplier" : {
    "baseValue" : 1.0
    },
    "fireStatusImmunity" : {
    "baseValue" : 1.0
    },
    "iceStatusImmunity" : {
    "baseValue" : 1.0
    },
    "electricStatusImmunity" : {
    "baseValue" : 1.0
    },
    "poisonStatusImmunity" : {
    "baseValue" : 1.0
    }
    },
    "resources" : {
    "stunned" : {
    "deltaValue" : -1.0,
    "initialValue" : 0.0
    },
    "health" : {
    "maxStat" : "maxHealth",
    "deltaStat" : "healthRegen",
    "defaultPercentage" : 100
    }
    }
    },
    "capturable" : true,
    "mouthOffset" : [0, 0],
    "feetOffset" : [0, -8]
    }
    }
    }}
     
  2. Sparklink

    Sparklink Ketchup Robot

    At a glance, I think the problem may be that your mouth offset value is set to zero X zero Y. The mouth offset determines where the monster's projectiles come from. The zeroes may be determined as a null value. Let me know how that works out.
     
  3. Rat-Thing

    Rat-Thing Phantasmal Quasar

    After looking through a few other projectile launching monsters, all of them have the same settings for mouthOffset; [0,0]. Every single monster.
    Nothing changed when i tried changing that value, either. Still not spawning.
     
  4. projectmayhem

    projectmayhem Spaceman Spiff

    You have a bracket messed up somewhere. Right now, your mouth offset is inside the statusSettings { } brackets. It should not be so. the game cant see them in there. Once you figure out where your messed up bracket is, everything should work

    Also, posting your code inside the code blocks helps a lot, makes it easier to read errors
     
    Rat-Thing likes this.
  5. projectmayhem

    projectmayhem Spaceman Spiff

    Here, try this out, fixed up the code some, added a default drop pool and stuff. I think it should work for you. I cant tell where the messed up comma is without formatting the whole thing, so i just did it from scratch using your stuff as a guide.

    Code:
    {
      "type" : "z4sentrider",
      "shortdescription" : "Sentrider",
      "description" : "An ancient warmech from a bygone era.",
    
      "categories" : [ "z4sentrider" ],
      "parts" : [ "body" ],
    
      "animation" : "z4sentrider.animation",
    
      "dropPools" : [ { "default" : "basicMonsterTreasure", "bow" : "hunting" } ],
    
      "baseParameters" : {
        "scripts" : [
          "/monsters/monster.lua"
        ],
    
        "behavior" : "monster",
        "deathBehavior" : "monster-death",
    
        "behaviorConfig" : {
          "damageOnTouch" : true,
    
          "targetQueryRange" : 20,
          "targetOnDamage" : true,
          "keepTargetInSight" : true,
          "keepTargetInRange" : 50,
          "targetOutOfSightTime" : 5.0,
    
          "foundTargetActions" : [ { "name" : "action-aggrohop" } ],
    
          "fleeActions" : [],
    
          "hostileActions" : [
            {
              "name" : "action-fire",
              "cooldown" : 3,
              "parameters" : {
                "maximumRange" : 15,
                "minimumRange" : 2,
                "windupState" : "",
                "windupTime" : 0,
    
                "projectileType" : "lightning",
                "fireOffset" : [1, 1],
    
                "aimAtTarget" : true,
                "fireState" : "fire",
                "fireDelay" : 0.2,
                "fireSound" : "",
    
                "fireArc": true,
                "projectileSpeed": 32,
                "gravityMultiplier": 0.6,
    
                "winddownState" : "",
                "winddownTime" : 2
              }
            }
          ],
    
          "periodicActions" : [],
    
          "approachActions" : [
            {
              "name" : "approach-walk",
              "parameters" : {
                "canJump" : false,
                "run" : true
              }
            }
          ],
    
          "followActions" : [
            {
              "name" : "approach-teleport",
              "parameters" : {
              }
            },
            {
              "name" : "approach-walk",
              "parameters" : {
                "canJump" : false
              }
            }
          ],
    
         
          "wanderActions" : [
            {
              "name" : "wander-walk",
              "cooldown" : 6.0,
              "parameters" : {
                "wanderTime" : [0.5, 2.5]
              }
            }
          ]
        },
    
        "touchDamage" : {
          "poly" :  [ [0.0, 1.5], [1.0, 0.5], [1.5, -0.5], [1.0, -1.5], [0.0, -2.5], [-1.0, -1.5], [-1.5, -0.5], [-1.0, 0.5] ],
          "damage" : 15,
    
          "teamType" : "enemy",
          "damageSourceKind" : "slash",
          "knockback" : 20,
          "statusEffects" : [ ]
        },
    
        "metaBoundBox" :[-2.5, -2.5, 2.5, 2.5],
        "scale" : 1.0,
    
        "movementSettings" : {
          "collisionPoly" : [ [0.0, 1.5], [1.0, 0.5], [1.5, -0.5], [1.0, -1.5], [0.0, -2.5], [-1.0, -1.5], [-1.5, -0.5], [-1.0, 0.5] ],
    
          "mass" : 1.0,
          "walkSpeed" : 4,
          "runSpeed" : 6,
    
          "airFriction" : 0,
    
          "airJumpProfile" : {
            "jumpSpeed" : 5.0,
            "jumpInitialPercentage" : 1.0,
            "jumpHoldTime" : 0.0
          }
        },
    
        "bodyMaterialKind" : "organic",
    
        "knockoutTime" : 0.3,
        "knockoutAnimationStates" : {
          "damage" : "stunned"
        },
        "deathParticles" : "deathPoof",
        "knockoutEffect" : "",
    
        "statusSettings" : {
          "statusProperties" : {
            "targetMaterialKind" : "stone"
          },
    
          "appliesEnvironmentStatusEffects" : false,
          "appliesWeatherStatusEffects" : true,
          "minimumLiquidStatusEffectPercentage" : 0.1,
    
          "primaryScriptSources" : [
            "/stats/monster_primary.lua"
          ],
          "primaryScriptDelta" : 5,
    
          "stats" : {
            "knockbackStunTime" : {
              "baseValue" : 0.25
            },
            "knockbackThreshold" : {
              "baseValue" : 9
            },
            "maxHealth" : {
              "baseValue" : 100
            },
            "protection" : {
              "baseValue" : 0.0
            },
            "healthRegen" : {
              "baseValue" : 0.0
            },
            "lavaImmunity" : {
              "baseValue" : 1.0
            },
            "powerMultiplier" : {
              "baseValue" : 1.0
            },
            "physicalResistance" : {
              "baseValue" : 0.0
            },
            "fireResistance" : {
              "baseValue" : 0.5
            },
            "fireStatusImmunity" : {
              "baseValue" : 1.0
            },
            "iceResistance" : {
              "baseValue" : -0.5
            },
            "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]
      }
    }
    
     
  6. Rat-Thing

    Rat-Thing Phantasmal Quasar

    Thanks. I had a feeling it might've been caused by a misplaced bracket.
     

Share This Page