Jump to content

Unable to use character action while moving


Recommended Posts

Like it says on the tin, occasionally performing certain actions (like picking grass) will cause my character Warfarin to be unable to use their dash ability while moving via direct input (holding WASD or mouse 1, clicking to move is fine - only holding the buttons stops it). Relogging also seems to break it. I've noticed Wortox has the same issue even with no mods installed but Warfarin seems to break alot more frequently. Even when I directly copied all of his code into Warfarin's.

I've spent a good month or so trying to troubleshoot this, and all I've came out with is:

A) It's not a stategraph issue as it doesn't even trigger the pre-act state;

B) It doesn't seem to be the test of whether Warf meets the criteria to dash at that moment (IE, doesn't have the "nodash" tag);

C) Forcing the character to double-check they've abandoned any failed/succeeded actions doesn't work

D) It's really annoying.

 

If any smarter folk than I could pitch any ideas to work around this bug - because it has to be a bug if it's affecting an official character - I'd be much appreciative!

And of course, the mod will be attached below. Please excuse some of the sloppy remnants to try and fix the issue littered around the place I may have missed during cleanup.

Warfarin.zip

Link to comment
Share on other sites

33 minutes ago, Mr. Tiddles said:

[snip]

So, I think I fixed it?

 

local function GetPointSpecialActions(inst, pos, useitem, right)
    if right and useitem == nil and inst:HasTag("candash") then
        local rider = inst.replica.rider
	local sailor = inst.replica.sailor
        if (rider == nil or not rider:IsRiding()) and (sailor == nil or not sailor:IsSailing()) then
            return { ACTIONS.WARFARINDASH }
        end
    end
    return {}
end
local function GetPointSpecialActions(inst, pos, useitem, right)
    if right --[[and useitem == nil]] and inst:HasTag("candash") then
        local rider = inst.replica.rider
	local sailor = inst.replica.sailor
        if (rider == nil or not rider:IsRiding()) and (sailor == nil or not sailor:IsSailing()) then
            return { ACTIONS.WARFARINDASH }
        end
    end
    return {}
end

I commented out "and useitem == nil" and it just seems to work for me, try that out and see how it works for you.

Also, I love your characters examinations and abilities so much, They're very unique
 

image.png

Link to comment
Share on other sites

3 minutes ago, Hornete said:

-big snip-

Really? That was a recent addition and it was happening then. Let me try...

And was it working specifically on predictive or even on none?

Edited by Mr. Tiddles
Link to comment
Share on other sites

Just now, Mr. Tiddles said:

And was it working specifically on predictive or even on none?

With the previous code (I thought I explained this in my post, but I guess it got deleted somehow)

The dash would work fine without lag compensation enabled, but when it was enabled. That's when the bug randomly started happening. I removed the useitem part and it just seemed to work 100% of the time.

Link to comment
Share on other sites

3 hours ago, Hornete said:

With the previous code (I thought I explained this in my post, but I guess it got deleted somehow)

The dash would work fine without lag compensation enabled, but when it was enabled. That's when the bug randomly started happening. I removed the useitem part and it just seemed to work 100% of the time.

Ah- that would explain it! Changing lag compensation causes the ability to be lost as well, as does relogging into the game. Which sadly, it's still happening.

There's also a strange thing that happens - if I have "inst:AddTag("candash") into the OnSetOwner function, you're able to dash after spawning but not after relogging, but the opposite is true if the "inst:AddTag" is in the common_postinit. Regardless that only makes it more stable as picking grass can randomly break it still, but it gives that initial stability.

Adding "inst:AddTag("candash")" to both the common_postinit and the OnSetOwner did make it work on both fresh spawns and relogging! Though sustained stability still needs to be adressed. It's an improvement at least. the game was making it seem like it helped to mess with my head.

Edited by Mr. Tiddles
Meant common_postinit. Always get that confused with master_postinit
Link to comment
Share on other sites

A possible workaround may be to add another function that's triggered on any right mouse input and makes sure if Warf should be able to dash, but doesn't, it forces them to. My only problem there is figuring out how to check for that specific input as this is newish territory for me.

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...