Wonderlarr Posted February 16, 2021 Share Posted February 16, 2021 (edited) I am attempting to have my character go into a pseodo-frozen state when an ability is triggered, essentially just frozen visually, the problem I'm facing is whenever my character is moving while this frozen state is triggered, she doesn't properly freeze, instead just changing the color of her tint. Here is a visual example. Still: Moving: As you can see, the moving one is a bit wrong. I have no idea where this problem is rooted, as the ability automatically stops my character from moving right before putting them into the frozen state. This is the code I'm using for the weird half-frozen state I made local function FakeFreeze(inst) --This is essentially just modified freezable:freeze code, along with modified frozen stategraph code local owner = inst.components.inventoryitem.owner if owner.components.pinnable ~= nil and owner.components.pinnable:IsStuck() then owner.components.pinnable:Unstick() end if owner.components.inventory:IsHeavyLifting() then owner.components.inventory:DropItem( owner.components.inventory:Unequip(EQUIPSLOTS.BODY), true, true) end owner.components.locomotor:Stop() owner:ClearBufferedAction() owner.AnimState:OverrideSymbol("swap_frozen", "frozen", "frozen") owner.AnimState:PlayAnimation("frozen") owner.components.inventory:Hide() owner:PushEvent("ms_closepopups") if owner.components.playercontroller ~= nil then owner.components.playercontroller:EnableMapControls(false) owner.components.playercontroller:Enable(false) end UpdateTint(inst) end How can I fix this, if it's even possible? Edited February 16, 2021 by TheSkylarr Link to comment Share on other sites More sharing options...
Combustiblemon Posted February 17, 2021 Share Posted February 17, 2021 I think it is because you're still pressing 's' button, so game recognizes input is there so anim doesn't appear. I've searched through SGwilson, I guess this is sort of 'ignore inputs for some time' command: inst.sg:SetTimeout(FRAMES) So I think this should work: make ignore your input for 2 frames so anim will 'blink' while no inputs are active. local function FakeFreeze(inst) --This is essentially just modified freezable:freeze code, along with modified frozen stategraph code local owner = inst.components.inventoryitem.owner if owner.components.pinnable ~= nil and owner.components.pinnable:IsStuck() then owner.components.pinnable:Unstick() end if owner.components.inventory:IsHeavyLifting() then owner.components.inventory:DropItem( owner.components.inventory:Unequip(EQUIPSLOTS.BODY), true, true) end owner.components.locomotor:Stop() owner:ClearBufferedAction() owner.sg:SetTimeout(2 * FRAMES) owner.AnimState:OverrideSymbol("swap_frozen", "frozen", "frozen") owner.AnimState:PlayAnimation("frozen") owner.components.inventory:Hide() owner:PushEvent("ms_closepopups") if owner.components.playercontroller ~= nil then owner.components.playercontroller:EnableMapControls(false) owner.components.playercontroller:Enable(false) end UpdateTint(inst) end but this is pure guess, and I can't test codes now, so it maybe will not work. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now