How do i make flight in lua ?
If you want to use the game's flight, set the player's
charability to
CA_FLY, then adjust
actionspd as neccesary.
If you don't want to use the native way, just set the player object's
momz to something positive to send the player upwards.
How do i disable super color and make super form not drain rings
Natively, you can't prevent super color nor disable the ring cost.
You can fake it by force setting the player object's color to something and giving one ring to the player on the following condition:
player.powers[pw_super] > 0 and player.powers[pw_super] % TICRATE == 0
Otherwise, you can fake super.
How do i add a cap to an energy bar
(assuming "player.energy" holds the player's energy, and "cap" is the maximum value it can reach...)
Just prevent it from increasing once your energy variable is past some value.
if player.energy < cap should do the trick.
You can also use the
min function to clamp the value if it goes past the limit, like so:
player.energy = min($, cap)
How do i make an ability to charge the energy bar
Uh... that one is very open ended. There are multiple ways to get what you want and lots of factors I don't know.
Just increase your energy variable when something happens?
Lastly how do i make so flight drains said energy bar
If using native flight,
if player.panim == PA_ABILITY then player.energy = $-(some value) end
Change the check if that's not the case.
Make sure to keep an eye to
the Lua section of the SRB2 Wiki and
this Lua tutorial.