Jump to content

Play Animation Crashing for Custom Instrument (Possibly Client Side Issue)


Recommended Posts

Hi,
So I gave my character a guitar which he plays as a regular instrument. I did this by editing the action handler for ACTIONS.PLAY to play the strum animation for my guitar (i reskinned the trident to be my guitar).
It works just fine on the server side (when I'm playing in the world I hosted myself), I can play the guitar and other instruments, but when I play in another person's world the game disconnects if any of us try to play any other instrument besides the guitar. The client_log doesn't say why either, just that the world disconnected.

This is what I currently have for my wilson and wilson_client action handler. Am I missing something in any of these? Thanks.
 

_G = GLOBAL
local ACTIONS = _G.ACTIONS
local ActionHandler = _G.ActionHandler

AddStategraphActionHandler("wilson", ActionHandler(ACTIONS.PLAY,
        function(inst, action)
            if action.invobject ~= nil then
                return (action.invobject:HasTag("flute") and "play_flute")
                    or (action.invobject:HasTag("horn") and "play_horn")
                    or (action.invobject:HasTag("bell") and "play_bell")
                    or (action.invobject:HasTag("whistle") and "play_whistle")
            or (action.invobject:HasTag("myguitar") and "play_strum")
                    or nil
            end
    end)
)

AddStategraphActionHandler("wilson_client", ActionHandler(ACTIONS.PLAY, 
    function(inst, action)
    return action.invobject ~= nil 
    and (action.invobject:HasTag("myguitar") and "play_strum")
    or "play"
    end)
)

Edited by headofmarimo
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
  • Create New...