Modding Help Require help with LUA modding (stuck?)

Discussion in 'Starbound Modding' started by Random_NPC1996, Jan 25, 2018.

  1. Random_NPC1996

    Random_NPC1996 Phantasmal Quasar

    Would like if someone could help me with this... just started messing with .lua stuffs not long ago crashed almost when object is placed.

    what I was I trying: creating something that when placed, disapears in 5 seconds or on interaction (object.smash?)

    what is happening: crashes when I put that object down

    Could someone help me with that?

    Errorlog:
    Code:
    [Error] WorldServerThread exception caught handling incoming packets for client 1: (JsonException) Json not an array of size 2 in jsonToVec2F
    [0] 7ff6d9137153 Star::captureStack
    [1] 7ff6d9135ede Star::StarException::StarException
    [2] 7ff6d90e6be2 Star::jsonToVec2F
    [3] 7ff6d93d6bd7 Star::Object::init
    [4] 7ff6d96e22fe Star::WorldServer::addEntity
    [5] 7ff6d96efd14 Star::WorldServer::handleIncomingPackets
    [6] 7ff6d9704a3b Star::WorldServerThread::update
    [7] 7ff6d9704558 Star::WorldServerThread::run
    [8] 7ff6d9133c5e Star::ThreadImpl::runThread
    [9] 7fffccde1fe4 BaseThreadInitThunk
    [10] 7fffcd60efb1 RtlUserThreadStart
    [22:04:02.977]
    (*This is only partial of the log)

    These are the codes in .lua file:
    Code:
    function init()
       object.setInteractive(true)
       animator.setAnimationState("switchState","off")
       self.triggerTimer = 0
    end
    
    function onInteraction()
       animator.setAnimationState("switchState","on")
       animator.playSound("on")
       object.smash()
    end
    
    function update(dt)
       if self.triggerTimer >= 5 then
         animator.setAnimationState("switchState","on")
         animator.playSound("on")
         object.smash()
       else
         self.triggerTimer = self.triggerTimer + 1
       end
    end
    Thank you in advance if you can help me out.

    p/s: by the way anyway to change to topic thingy to modding help? I chose the wrong one by accident...
    p/s: I found the topic thingy, never mind about the p/s above...
     
    Last edited: Jan 25, 2018
  2. bk3k

    bk3k Oxygen Tank

    I think there might be small issues with your code there - only guessing at your intent - but nothing that should trigger that error. Vect2F stands for a 2 vector array using float numbers(rather than integers). I think the issue is actually data in your object. Typically this is for [x. y] coordinates, offsets, etc.

    The rest of the log(also use code insert) might shed some light. Your object and animation file also might.
     
    Random_NPC1996 likes this.
  3. Random_NPC1996

    Random_NPC1996 Phantasmal Quasar

    Thanks mate... I just found out I made a small mistake there... works now... problem at the animationPosition I only have 1 value instead of to as to x and y, much appreciation =D
     

Share This Page