How to make an upwards thrust

whatdoitypehere75

I just exist
Im trying to find a way to thrust the character up, but I dont understand the code. I found A_ZThrust but i dont understand it, and i dont think its lua.
 
Last edited:
does anyone know if is this what i do for A_ZThrust?:
A_ZThrust(MT_PLAYER, (16*65536)+0, (0*65536)+0)
Im confused with the upper and lower 16 values.
 
Last edited:
Ability example:
local function ThrustUp(player)
    P_SetObjectMomZ(player.mo, 12*FRACUNIT, false)
   return true
end

addHook("AbilitySpecial", ThrustUp)

Don't bother with SOC actions when Lua already has a function that does (approximately) the same thing. P_SetObjectMomZ makes the player launch up at a speed of 12 FRACUNITs when they use their ability. You can change the launch speed by changing the number, and whether it'll "add" to your current momentum or replace it by changing the "false" to a true.

https://wiki.srb2.org/wiki/Lua/Functions The wiki page has a detailed explanation on what each function does.

Keep in mind this code will replace EVERY character's ability, so you'll have to make sure player.mo.skin matches first. Or you can just put that line in another hook instead of AbilitySpecial, your call.
 
Ability example:
local function ThrustUp(player)
    P_SetObjectMomZ(player.mo, 12*FRACUNIT, false)
   return true
end

addHook("AbilitySpecial", ThrustUp)

Don't bother with SOC actions when Lua already has a function that does (approximately) the same thing. P_SetObjectMomZ makes the player launch up at a speed of 12 FRACUNITs when they use their ability. You can change the launch speed by changing the number, and whether it'll "add" to your current momentum or replace it by changing the "false" to a true.

https://wiki.srb2.org/wiki/Lua/Functions The wiki page has a detailed explanation on what each function does.

Keep in mind this code will replace EVERY character's ability, so you'll have to make sure player.mo.skin matches first. Or you can just put that line in another hook instead of AbilitySpecial, your call.
Thx for telling me!
Post automatically merged:

This is what i did but its not working

function ThrustUp(player)
P_SetObjectMomZ(player.mo, 12*FRACUNIT, true)
return true
end
if player.mo.skin == "metalsonic" then
addHook("AbilitySpecial", ThrustUp)
end

NVM JUST FIGURED IT OUT MY BAD
 
Last edited:

Who is viewing this thread (Total: 1, Members: 0, Guests: 1)

Back
Top