Jump to content

How to make the Ice Flingomatic fuel bar?

Recommended Posts

Hey guys,


i'm trying to create a machine that uses a similiar fuel indicator as the ice flingomatic (the red bar on the outside). 


I tried to extract the animation files using krane and it looks like the fuel bar is a separate animation. The machine itself doesn't have the bar on it at all. 


So i looked up the prefab script for it (firesuppressor.lua) but i can't really figure out how the bar gets attached to the machine itself and scales/moves with the machine itself.


I though it had something to do with the swap_meter thing in this line: 


inst.AnimState:OverrideSymbol("swap_meter", "firefighter_meter", 10)


but i guess this just swaps out the sprite inside the firefighter_meter animation itself. 


I'd really appreciate any hints to how this is done. 




Link to comment
Share on other sites

Okay so i made some more progress. I realized that the firefighter contains a swap symbol and that it uses the firefighter_meter file to swap out the sprite inside it's animation using the OverrideSymbol method. 


The parameters for that seem to be OverrideSymbol(swapSymbolName, meterFileName, buildName/ID?)


swapSymbolName seems to be the name of a subfolder in the firefighter animation (though when extracting it using krane, it doesn't seem to show up). 


I added the raw files of the meter to my generator sprite (in the exported folder) and placed a dummy/swapsymbol image onto it. 



If i use the "firefighter_meter.zip" file for swapping out the symbol using those parameters:


inst.AnimState:OverrideSymbol("firething", "firefighter_meter", 5)


("firething" being the subfolder, "firefighter_meter" being the zip file for the meter itself)


I tried to make my own bar but it wouldn't show up, it just hides the swap symbol. I read somewhere that the meter file needs to have all the subfolders as the main object, so i'm gonna give that a try. 


I know i'm not explaining this well enough :p But just trying to figure out what it actually needs to swap out symbols. 

Link to comment
Share on other sites

Progress! I sort of got it to work. I'm still not 100% sure what's all required, but i had to move all the different sprites in subfolders and export it as a separate animation. 


However i still have one small problem. It changes the meter correctly and they up properly except for the very last one (number 10). I kinda assume it has to do with the number being sorted differently (it puts it after 1, not after 9) but im not exactly sure..


Here is the meter using frame 9: 




And here is the meter using frame 10: 




As you can see it just removes the meter completely, even though the frame should exist. This is how it's setup in Spriter:




Any idea why it wouldn't show up?




Link to comment
Share on other sites

Don't wanna "bump" the thread too much but still curious if anyone has had experience with something similiar. 


To sum up the current problem:


The Flingomatic has a fuel meter consisting of 11 frames (0..10). Depending on the fuel level, it uses the OverrideSymbol method with the specific value at the end (0..10) to swap out the meter texture. 


I created a custom fuel meter with the same amount of frames. Every except for the last frame work perfectly fine. 

Calling OverrideSymbol("foo", "bar", 5) would set it to the 5th frame. But 10 doesn't work. 


If i use the flingomatic meter files on my custom prefab, it works fine. 


I could include my source files if it would help and if anyone could take a look. I'm not sure why frame 10 doesn't show up, it's not missing in the compiled version or anything. 

Link to comment
Share on other sites


This topic is now archived and is closed to further replies.

Please be aware that the content of this thread may be outdated and no longer applicable.

  • Create New...