Modding Discussion monsterspawner.object - Maximum out at once? (Not "stock")

Discussion in 'Starbound Modding' started by Symphony, Apr 21, 2017.

  1. Symphony

    Symphony Existential Complex

    An object called the 'monsterspawner', and many others like it, are very useful for spawning custom & vanilla mobs alike for populating a scene & making it lively!

    Unfortunately, it appears that there is no parameter(amazingly enough) for setting a 'maximum mobs spawned at once' per spawner item. This is ... frankly, absurb.

    There is a 'stock' parameter, but that is not at all what's needed here. (before anyone points to it.) Stock is essentially just 'ammo'. How many mobs a spawner can spawn before it's rendered useless & needs to be replaced.

    The primary objective here would be to create a spawner that can produce mobs infinitely over time, but only allows a specified number (5, for example) under it's wing at once.

    I'm actually a bit surprised that this functionality doesn't exist. It seems like mobspawning 101. Either I'm missing something and it's hidden beneath the crust, or it needs to be integrated asap!

    I've taken a peek within the spawner lua, and it certainly doesn't bother to stash NPC instances in a nested array of any sort.



    If anyone knows of a way to do what I've discussed, I'd love to hear it! Otherwise, I'm starting this thread for CF to see it and hopefully add a maximum spawn limit parameter onto their spawner objects.

    For the moment ... I'll look into modding things lua side. (I just think it should be vanilla!)
     
  2. Cyel

    Cyel Zero Gravity Genie

    I just stumbled upon that old item http://starbounder.org/Robot_Factory which has the property that "Only 4 spawned robots may be active at one time" and it made me think of that post, so I decided to give it a go, retrieved it, stole a few lines, and here you go.
    /spawnitem monsterspawnerwithmaxatonce

    I've added some parameters:
    "maxAtOnce" : 5, //total number of spawns at once, -1 for infinite (I'm not responsible for what you're doing)
    "killMonstersWhenBroken" : true,
    "showDebugLine" : false //shows a line between spawns and the spawner (might nag a bit more resources)

    I probably could make it store spawned monsters between loads / unloads but I was lazy, so if you want feel free to ask and I'll do it later

    I'm also kinda tempted to make an in-game GUI to change it's settings, but as said I'm l a z y
     

    Attached Files:

Share This Page