Jump to content

Recommended Posts

Hi all,

Having trouble with a teleporter component, from what I observe the action to "jump in" seems to cut off every time the animation of the object comes to an end. Most if not all animations are handled by a custom stategraph and there is no disabling of the component mentioned in the file.

This is just my observation however, the reality could be different.

Visual of the object:

WdoLBmcm.png

As seen above, the object(Undefinable Void) is successfully highlighted but will lose focus/highlighting whilst being hovered over(both static and mobile cursors), it'll lose focus approximately every 1-2 seconds and return back to focus promptly after half a second.

Object's function:

The object allows a user to port to another rift location which occasionally moves location every "x" seconds (8 by testing default). The secondary rift never actually disappears or gets removed - only moves around and changes animation.

The visual is a swirling effect (perhaps the white graphic is cutting out selection somehow?).

Stategraph code

  Hide contents

require("stategraphs/commonstates")

local actionhandlers=
{

}

local events=
{

}

local states=
{
    State{
        name = "idle",
        tags = {"idle", "open"},
        onenter = function(inst)
            inst.AnimState:PlayAnimation("Idle", true)
        end,

    },

    State{
        name = "growing",
        tags = {"idle", "open"},
        onenter = function(inst)
            inst.AnimState:PlayAnimation("Grow")
            -- since we can jump right to the open state, retrigger this sound.
            inst.SoundEmitter:PlaySound("dontstarve/common/teleportworm/idle", "wormhole_open")
        end,

        onexit = function(inst)
            inst.SoundEmitter:KillSound("wormhole_open")
        end,
        
        events=
        {
            EventHandler("animover", function(inst)
                inst.sg:GoToState("idle")
            end),
        },
    },
        
    State{
        name = "closing",
        tags = {"busy"},
        onenter = function(inst)
            inst.AnimState:PlayAnimation("Shrink")
            inst.SoundEmitter:PlaySound("dontstarve/common/teleportworm/close")
        end,
    },
}

return StateGraph("SGshadowportal", states, events, "growing", actionhandlers)

 

Additional code can be provided on request for further investigation.

I'll keep cracking at it for a solution myself but if anyone has encountered this or has a fix/method of approach, I'd appreciate any advice. ^^

Edit: disabling the animation looping and having it as a static graphic no longer incurs the problem - suggesting the animation looping process is at fault; but how does the default wormhole overcome this? (it's animated on being near and far)

 

Edited by MorickClive
Link to comment
https://forums.kleientertainment.com/forums/topic/80135-action-hover-issue/
Share on other sites

Sorry to bring this up again although it might be useful to others.

I've not fixed it - but rigorously tested it, Spriter animations with full looping rotation seems to cause issue with the collision detection for the mouse/UI interaction. In addition to this, opacity does not tween either. Currently I'm testing with the free provided version, so just a warning to y'all.

If anyone knows of any alternative methods of approach, I'm totally happy for any assistance - but my code isn't at fault; I've thoroughly analysed the differences, discrepancies and only found the issue is directly affect by the animation itself. I would have analysed AnimStates further if I could find it (to determine if I'm breaking any rules there), but all I've been able to find is the definable for SoundEmitter (debugsound.lua).

Bleh; time to make a expanding/contracting portal I think (maybe something sand related).

Edited by MorickClive

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
×
  • Create New...