Modding Help How do I spawn a captured pod inside the player inventory?

Discussion in 'Starbound Modding' started by telles0808, Feb 7, 2014.

  1. telles0808

    telles0808 Cosmic Narwhal

    Hello,

    Starbound is so awesome, complete and complex! I'm loving learn about mods in this part of the Community.

    I would like ask you if is possible to spawn a captured pod inside the player inventory?

    That's something like "give the player a pet".

    I need it because I'm doing some quests, where the player will earn a pet. So, I did the pet without problem, using a system like the boss, where an object spawn it.

    But, this way, the pet will not follow me, will not return when died, etc.

    So, if I use a capture pod on the pet after creating it, he will return to my inventory as a real pet.

    To short the process, I would like be able to spawn this last object (the captured pet) inside the player inventory directly.

    So, learning more about the capturepod.lua and the capturepod.thrownitem I was unable to figure out how it should work.

    The answer may surround the capturepod.lua script, giving it arguments and emulating the exactly hour where you capture a pet, but how?

    ---------------
    Edited: I'm stuck, after many hours of scripting, learning and trying, I get stuck, and can't reverse this looping issue.

    I did the mod, it's ready, but the pet is nothing more than a random monster in the map.

    To make it improved, I could use the capture pod system, but, I don't know how to spawn a wild monster like the map do.

    And, to be able to capture it, the monster essentially need to be a ground monster, except the Boss type, what I used as template for my mod.

    The boss type don't share some of the essential scripts of the ground monsters, like capturepod and groundmonster.lua

    So, I'm asking for help to figure it out.

    Do you know how to spawn a monster with the same characteristics of a pet inside the captured pod?

    Please, feel free to look inside the scripts and see what you can do with it. This is essential for the mod and I think it will help a lot everybody!

    Thank you Magus of Mods!!!
     

    Attached Files:

    Last edited: Feb 8, 2014
  2. JellyGem

    JellyGem Starship Captain

    Sorry to ask you a question when you're looking for an answer yourself but how did you get the pet to stop following you? Because I actually want to get that to do that, but I can't. xD Sorry I can't help, but I'll try to dig around a bit.
     
  3. telles0808

    telles0808 Cosmic Narwhal

    Hi @JellyGem, I did a Slime (Green Jelly Pet), spawned it as a monster and gave to the player some capture pods, so, when the player capture the monster and respawn it, it will use the "behavior" of a pet, following you, etc.

    Slimes2.png
     
  4. BobdaBiscuit

    BobdaBiscuit Big Damn Hero

    I'll have a look.
    Edit, it seems you have made the mob fine, but have not included any of the required properties that captured mobs have, using the small/tiny biped/quadruped as a reference should help.
     
  5. telles0808

    telles0808 Cosmic Narwhal

    @BobdaBiscuit, I can't figure out how to implement the capturingpod and captive states on the mob.

    Anyone can help? Please!
     
  6. capizma

    capizma Cosmic Narwhal

    Unfortunately, you can't.
    Code:
        world.spawnItem("filledcapturepod", entity.toAbsolutePosition({ 0, 4 }), 1, {
          projectileConfig = {
            speed = 70,
            level = 7,
            actionOnReap = {
              {
                action = "spawnmonster",
                offset = { 0, 2 },
                type = entity.type(),
                arguments = parameters
              }
            }
    
    entity.type() will only spawn the previously captured entity.
    Sorry~
     
  7. dpc

    dpc Void-Bound Voyager

    Maybe you can force the behavior through the item thrown, I use that to spawn custom monster that have and give different statusEffects with custom size, friendly/ennemy, damage and health at my will... so maybe you can make them behave ? I didn't tried it yet though, maybe tomorrow... all I know is that when I spawn smallbiped, they follow and drop their capture pod, otherwise they live their lifes, very useful to be used as city guard that are pretty much immortals and kills everything in seconds and can't harm players... or ravage cities of players...or a little demon the size of a shoe that strip people naked ;)

    Ps : sorry for grammar and syntax mistakes, I'm not exactly fluent with english... though I somehow sense that I made a lot here...
     
    Last edited: Jun 7, 2014
  8. capizma

    capizma Cosmic Narwhal

    You could create a duplicate script and capture pod item and change entity.type to world.EntityName
     
  9. dpc

    dpc Void-Bound Voyager

    I'm more thinking about using inateState to give him the behavior of a tinyquadruped but I can't try it now T.T no more PC, my dog stuck his tail in the wind blowing thing, he panicked and pretty much destroyed my computer... I'm using my smartphone right now...
    Though you might want to add "ownerUuid" : //your uuid//
     

Share This Page