Wolf_EX Posted March 17, 2019 Share Posted March 17, 2019 I am having the same issue as the last post on this thread I added a fuel bar to my item and the fuel bar disappears when the fuel is maxed. I use this code to change the meter but when new = 10 it just disappears. I have the image/folder for 10 in the chest_meter anim so I'm am not sure why it isn't showing up. local function OnFuelSectionChange(new, old, inst) if inst._fuellevel ~= new then inst._fuellevel = new inst.AnimState:OverrideSymbol("swap_meter", "chest_meter", tostring(new)) end end I can upload the mod if you need it. Link to comment https://forums.kleientertainment.com/forums/topic/103973-fuel-bar-disappearing-when-maxed/ Share on other sites More sharing options...
Wolf_EX Posted March 18, 2019 Author Share Posted March 18, 2019 I came up with a solution of having the swap_meter as the full bar and just using ClearOverrideSymbol to remove the OverrideSymbol. This seems like a hack to my issue but don't think there will be any issues with it. local function OnFuelSectionChange(new, old, inst) if inst._fuellevel ~= new then inst._fuellevel = new if inst._fuellevel == 10 then inst.AnimState:ClearOverrideSymbol("swap_meter") else inst.AnimState:OverrideSymbol("swap_meter", "chest_meter", tostring(new)) end end end Link to comment https://forums.kleientertainment.com/forums/topic/103973-fuel-bar-disappearing-when-maxed/#findComment-1166581 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