Modding Help [SOLVED]Monster not spawning

Discussion in 'Starbound Modding' started by Omeruin, Mar 25, 2019.

  1. Omeruin

    Omeruin Void-Bound Voyager

    Ugh. I feel like I'm making a stupid mistake and I'm just NOT seeing it at the moment.
    ---
    So, I'm adding a ton to my race mod, including Monsters.
    However, before I change the sprite or anything, I wanna make sure the monster actually spawns, and of course it doesn't.
    ---
    I have made a monster mod before with spawners and everything, so I just copied from that and my memory. For some reason though, it's just not working. Is it because I have my other monster mod enabled or something?
    ---
    I want the monster to spawn only at night, at most/all biomes.
    smallfiredemon.monstertype code:
    Code:
    {
      "type" : "smallfiredemon",
      "shortdescription" : "Small Fire Demon",
      "description" : "This small Fire Demon only spawns at night, to avoid Angels.",
    
      "categories" : [ "smallfiredemon" ],
      "parts" : [ "body" ],
    
      "animation" : "smallfiredemon.animation",
    
      "dropPools" : [ { "default" : "fennixTreasure", "bow" : "fennixHunting" } ],
    
      "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-leap",
              "cooldown" : 0.5,
              "parameters" : {
                "minimumRange" : 0,
                "maximumRange" : 20,
                "maxXRange" : 4,
                "windupTime" : 0.3,
                "windupState" : "idle",
    
                "leapVelocity" : 25,
                "collisionCheck" : true,
                "highArc" : false,
                "leapState" : "jump",
                "fallState" : "fall",
    
                "winddownState" : "",
                "winddownTime" : 0.2
              }
            },
            {
              "name" : "action-fire",
              "cooldown" : 3.0,
              "parameters" : {
                "requireLineOfSight" : true,
                "maxYRange" : 2,
                "maximumRange" : 15,
                "minimumRange" : 2,
                "windupState" : "firewindup",
                "windupTime" : 0.4,
    
                "projectileType" : "flame",
                "fireOffset" : [1, 0.35],
                "projectileCount" : 6,
                "projectileInterval" : 0.01,
                "aimDirection" : [1, 0],
                "aimAtTarget" : false,
                "fireSound" : "fire",
                "fireState" : "fire",
    
                "winddownState" : "",
                "winddownTime" : 0.3
              }
            }
          ],
    
          "periodicActions" : [],
    
          "approachActions" : [
            {
              "name" : "approach-walk",
              "parameters" : {
                "canJump" : true,
                "maxJumps" : 6,
                "jumpXVelocity" : 12,
                "jumpYVelocity" : 30,
                "jumpXControlForce" : 50,
                "minXRange" : 10,
                "run" : true
              }
            }
          ],
    
          "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" : [5, 15]
              }
            }
          ]
        },
    
        "touchDamage" : {
          "poly" : [ [0.3125, 1.25], [0.8125, 0.75],  [0.8125, -0.1], [0.3125, -0.6],  [-0.3125, -0.6], [-0.8125, -0.1],  [-0.8125, 0.75], [-0.3125, 1.25] ],
          "damage" : 1.0,
    
          "teamType" : "enemy",
          "damageSourceKind" : "slash",
          "knockback" : 20,
          "statusEffects" : [ ]
        },
    
        "metaBoundBox" : [-4, -4, 4, 4],
        "scale" : 1.0,
    
        "movementSettings" : {
          "collisionPoly" : [ [0.3125, 1.25], [0.8125, 0.75],  [0.8125, -0.1], [0.3125, -0.6],  [-0.3125, -0.6], [-0.8125, -0.1],  [-0.8125, 0.75], [-0.3125, 1.25] ],
    
          "mass" : 1.0,
          "walkSpeed" : 5,
          "runSpeed" : 8,
    
          "airFriction" : 0,
    
          "airJumpProfile" : {
            "jumpSpeed" : 45.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" : 50
            },
            "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],
        "captureCollectables" : { "monsters" : "smallfiredemon" }
      }
    }
    
    uniques.spawntypes.patch code:
    Code:
    [
        {   
            "op":"add",
            "path":"/-",
            "value":{
                "name" : "smallfiredemon",
    
                "spawnParameters" : {
                    "area" : "surface",
                    "region" : "all",
                    "time" : "night"
                },
               
                "groupSize" : [1, 1],
                "spawnChance" : 0.09,
                "monsterType" : "smallfiredemon",
                "monsterParameters" : {
                    "aggressive" : true
                }
            }
        }
    ]
    example garden.biome.patch (garden, where Gleaps spawn, so I know I'm in the right biome):
    Code:
    [
        {
            "op":"add",
            "path":"/spawnProfile/groups/-",
            "value":{
                "select":2,
                "pool":[
                    [1,"smallfiredemon"]
                ]
            }
        }
    ]
    and the monster.collection.patch, if that matters:
    Code:
    [
      {
        "op": "add",
        "path": "/collectables/smallfiredemon",
        "value": {
          "order": 68,
          "monsterType": "smallfiredemon",
          "icon": "/monsters/walkers/smallfiredemon/smallfiredemon.png:idle.1"
        }
      }
    ]
    Sorry if it feels like I'm spamming this forum. I've just been frustrated with this because I need it to work so that 2+ other things can happen for my mod (custom item drops from monster > custom new wings / custom wing crafting station).
    Cheers.
     
  2. projectmayhem

    projectmayhem Spaceman Spiff

    Maybe try this code below for your biome patch. I think that your code above is correct, but I *think* you are just giving it too small of a chance to be chosen for spawning. I could be wrong

    Code:
    [
      {
        "op": "add",
        "path": "/spawnProfile/groups/0/pool/-",
        "value": [
          1,
          "smallfiredemon"
        ]
      }
    ]
     
    Omeruin likes this.
  3. Omeruin

    Omeruin Void-Bound Voyager

    Maybe this is what fixed it, finally!!
    But I also traveled to a different lush planet on a DIFFERENT character and suddenly they started spawning.
    Definitely weird, because I've tested monster spawning on the same character on the same planet and it would work..but ya know.. Guess the game is silly sometimes.
    Thank you so much for helping me! This was really bugging me. Now I can finally edit the sprite and work on other things!
    Cheers!



    P.S. The spawn chance was at 95.00(%?) before I lowered it. Walking around was hilariously sad, seeing so many of them spawn after having them not spawn for the past day(ish) of coding.
    [​IMG]
     
  4. projectmayhem

    projectmayhem Spaceman Spiff

    no problem.
     

Share This Page