I spent a few minutes looking at this but didn't quite crack it. It would be cool to create Quake-style jump pads for multiplayer arenas. Sadly, the Forceplayer (y,f) command only works in the horizontal (y = angle, f = force).
The closest I got was using the JetpackThrust command, but it only lifts the player very slowly and can't be set to more than 1.0.
function jumppad_init(e)
end
function jumppad_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 100 then SetGamePlayerControlJetpackThrust(1.0)
end
end
Then there's this variations that temporarily changes the jump height of the player, but they physically have to jump:
function jumppad_init(e)
end
function jumppad_main(e)
PlayerDist = GetPlayerDistance(e)
if PlayerDist < 80 then
SetGamePlayerControlJumpmax(800)
else SetGamePlayerControlJumpmax(215)
end
end
I can't seem to forcibly fire the jump command using SetGamePlayerControlJumpMode(1), presumably because it clashes with a command in gameplayercontrol.lua that means you
have to press space to jump at all times.
AE