Modding Help monstertype files and capture pods

Discussion in 'Starbound Modding' started by trubyas, Dec 30, 2016.

  1. trubyas

    trubyas Big Damn Hero

    Long story short I just want to know how exactly i go about changing a monster from uncapturable to capturable, ive been digging around a bit and found a few old threads, one explaining I need to add in the capturepod lua script into the monsters parameters, but again, it was an old thread from the beta so would this still need to be done? I already know i need to change "capturable" : false to true but that does nothing.
     
  2. Dekadrachm

    Dekadrachm Heliosphere

    If I'm not mistaken, this should be fairly easy. First off find the monster you won't to allow to be capture-able.
    There should be a bit of code that goes like this:
    Code:
        "capturable" : true/false
    
    If it is set to false, change it to true.
    If the creature you want to capture does not have those parameters, add them under the:
    Code:
        "mouthOffset" : [0, 0],
        "feetOffset" : [0, -8],
    The end result should look something like this:
    Code:
        "mouthOffset" : [0, 0], -- varies on creature, just showing you that you place the code under these lines
        "feetOffset" : [0, -8], next three lines should be placed under these two lines, all creatures should have mouth and feet offset, so place the following lines under them if they don't have them:
    
        "capturable" : true, determines if it's capture-able
        "captureHealthFraction" : 0.5, Self explanatory
        "nametagColor" : [64, 200, 255] Self explanatory
    I think that is all you would need, it would also have to be a patch to avoid all conflict so it would be something like this:

    Code:
    [
      {
        "op": "add",
        "path": "/baseParameters/capturable",
        "value": true
      },
      {
        "op": "add",
        "path": "/baseParameters/captureHealthFraction",
        "value": 0.5
      },
      {
        "op": "add",
        "path": "/baseParameters/nametagColor",
        "value": [
          64,
          200,
          255
        ]
      }
    ]
     
  3. Dekadrachm

    Dekadrachm Heliosphere

    I have no idea if it will work, but basically try that patch, find the monster you want to make capture-able, make a new text document and name it: thenameofthemonster.monstertype.patch after that, open it and paste the patch I provided you into it. May work :rofl: idk
     
  4. trubyas

    trubyas Big Damn Hero

    Awesome, I'll try that first thing tomorrow, just making sure but I just simply put the new patch file in with the monster file itself correct?
     
  5. Dekadrachm

    Dekadrachm Heliosphere

    You would need to make it a mod so the game can read your changes. So in your mods folder create a new folder and go into to it and keep adding folders until you get to the path of the creature you wanted to edit so something like this mods>modname>monsters>monstertype>monstername
    so that means in your mod you should have multiple folders leading to the location of the monster you want to edit. Here you copy/paste the patch, but be sure to name it: whateverthemonstersnameis.monsterpart.patch and inside of it copy and paste the code. Once you start the game, it should read your mod and the patch and add the contents from the patch to your actual game.
     
  6. trubyas

    trubyas Big Damn Hero

    well it worked partially? the creature (ive been testing this on the kluex totem miniboss since im too impatient to look for a po golem and i know those are uncapturable as well) upon being weakened and coming in contact with the capture pod simply dies and drops its normal loot you wouldn't happen to know a way around this so it drops a filled capture pod as well would you?
     
  7. Dekadrachm

    Dekadrachm Heliosphere

    hmmm, maybe the capture pod has it's own treasure pool or something, I'll have to check
     
  8. Dekadrachm

    Dekadrachm Heliosphere

    So it just dies? check to see if there is an error in your starbound.log
     
  9. trubyas

    trubyas Big Damn Hero

    I actually did find something hope it helps shed some light

    [Error] Exception while invoking lua message handler for message 'pet.attemptCapture'. (LuaException) Error code 2, [string "/scripts/companions/capturable.lua"]:160: (MapException) Key 'captureParticles' not found in OrderedMap::get()
     
  10. Dekadrachm

    Dekadrachm Heliosphere

    ill loook
     
  11. Dekadrachm

    Dekadrachm Heliosphere

    looks like it couldn't find captureParticles when searching, I'm not exactly a lua expert, but I can see what I can do.
     
  12. Dekadrachm

    Dekadrachm Heliosphere

    Okay, try this:
    Code:
    Add this to the monster's animation file:
    
    "captureParticles" : { "particles" : [ { "particle" : "monstercapture" } ] },
    "releaseParticles" : { "particles" : [ { "particle" : "monsterrelease" } ] },
    Basically adds the needed particle to the animation in the hopes of removing the lua error.
     
  13. trubyas

    trubyas Big Damn Hero

    hmm same result but a new error has appeared along with the old one, cant tell if its one big error or just 2 different ones but heres the new one i got out of the log
    [C]: in field 'burstParticleEmitter'
    [string "/scripts/companions/capturable.lua"]:160: in field 'recall'
    [string "/scripts/companions/capturable.lua"]:200: in function <[string "/scripts/companions/capturable.lua"]:190>
    (...tail calls...)

    and then heres the entire thing starting at the old error and ending at the new one

    Code:
    [Error] Exception while invoking lua message handler for message 'pet.attemptCapture'. (LuaException) Error code 2, [string "/scripts/companions/capturable.lua"]:160: (MapException) Key 'captureParticles' not found in OrderedMap::get()
    [0] 7ff6b3073ee3 Star::captureStack
    [1] 7ff6b3072c6e Star::StarException::StarException
    [2] 7ff6b32a81b9 Star::OrderedMapWrapper<std::unordered_map,Star::String,Star::NetworkedAnimator::ParticleEmitter,std::allocator<std::pair<Star::String const ,Star::NetworkedAnimator::ParticleEmitter> >,Star::hash<Star::String,void>,std::equal_to<Star::String> >::get
    [3] 7ff6b32a5b60 Star::NetworkedAnimator::burstParticleEmitter
    [4] 7ff6b367b48f <lambda_48e99f625873d4c2d26e4e1df28656f8>::operator()
    [5] 7ff6b367732f std::_Invoker_functor::_Call<<lambda_48e99f625873d4c2d26e4e1df28656f8> & __ptr64,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>
    [6] 7ff6b3678700 std::invoke<<lambda_48e99f625873d4c2d26e4e1df28656f8> & __ptr64,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>
    [7] 7ff6b3677f5e std::_Invoke_ret<Star::Variant<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData>,Star::LuaVariadic<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> > >,<lambda_48e99f625873d4c2d26e4e1df28656f8> & __ptr64,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>
    [8] 7ff6b367cadb std::_Func_impl<<lambda_48e99f625873d4c2d26e4e1df28656f8>,std::allocator<int>,Star::Variant<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData>,Star::LuaVariadic<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> > >,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>::_Do_call
    [9] 7ff6b304227d std::_Func_class<Star::Variant<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData>,Star::LuaVariadic<Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> > >,Star::LuaEngine & __ptr64,unsigned __int64,Star::Variant<Star::Empty,bool,__int64,double,Star::String,Star::LuaTable,Star::LuaFunction,Star::LuaThread,Star::LuaUserData> * __ptr64>::operator()
    [10] 7ff6b3041314 <lambda_a03bcae4599b53751a446949639a4d5e>::operator()
    [11] 7ff6b2fcb158 luaD_precall
    [12] 7ff6b2fe3f01 luaV_execute
    [13] 7ff6b2fcac63 luaD_call
    [14] 7ff6b2fcb43b luaD_rawrunprotected
    [15] 7ff6b2fcae70 luaD_pcall
    [16] 7ff6b2fc1384 lua_pcallk
    [17] 7ff6b30492c0 Star::LuaEngine::pcallWithTraceback
    [18] 7ff6b321606c Star::LuaEngine::callFunction<Star::String,bool,Star::LuaVariadic<Star::Json> >
    [19] 7ff6b32199e9 Star::LuaFunction::invoke<Star::Json,Star::String,bool,Star::LuaVariadic<Star::Json> >
    [20] 7ff6b32441e8 Star::LuaMessageHandlingComponent<Star::LuaStorableComponent<Star::LuaActorMovementComponent<Star::LuaUpdatableComponent<Star::LuaWorldComponent<Star::LuaBaseComponent> > > > >::handleMessage
    [21] 7ff6b324b4bf Star::Monster::receiveMessage
    [22] 7ff6b35c2a25 Star::WorldServer::handleIncomingPackets
    [23] 7ff6b35d609b Star::WorldServerThread::update
    [24] 7ff6b35d5c18 Star::WorldServerThread::run
    [25] 7ff6b3070a0e Star::ThreadImpl::runThread
    [26] 7fff170e13d2 BaseThreadInitThunk
    [27] 7fff17df54e4 RtlUserThreadStart
    stack traceback:
        [C]: in ?
        [C]: in field 'burstParticleEmitter'
        [string "/scripts/companions/capturable.lua"]:160: in field 'recall'
        [string "/scripts/companions/capturable.lua"]:200: in function <[string "/scripts/companions/capturable.lua"]:190>
        (...tail calls...)
    not sure if any of that has anything to do with it and sorry if this is getting annoying but seriously thanks for all the help so far.

     
  14. Dekadrachm

    Dekadrachm Heliosphere

    Lol these error's are annoying :rofl:, try comparing the animation files of already captureable creatures to those that aren't. The capture particles are apart of the animation file.
     
  15. trubyas

    trubyas Big Damn Hero

    cant tell if this is good or bad, on one hand i realized i stupidly forgot to make changes to the mod we made a while back which i think means the game was reading the monster files from that and not the original that i had been making changes to for a while now, on a whim i decided to take the mod out to see if anything changed when it read from the original/my edited files, lo and behold, the game wont even load the temple mission itself! just spits me back onto my ship, im going to backtrack and redo a few things to see if i can get it to make any new errors show up or better realize it could have been fixed a few steps ago
     
  16. Dekadrachm

    Dekadrachm Heliosphere

    Okay, next time it throws you out of the game post your log file.
     

Share This Page