Jumping

+
I was wandering if it is possible to make a jump mod for the witcher 2? probably not.


This is the code for jumping forward (depends on the coords system, righthanded?):

var pos : Vector;

pos = thePlayer.GetWorldPosition();
pos.X += 10.f; pos.Y += 10.f; pos.Z += 10.f;
thePlayer.Teleport(pos):

Didn't test this. Code must be "connected" to a jump key.

edit: hmm, script compiles but doesn't work.
Coords are changed (can be seen when debugging in Script Studio) but no jump happens.
Maybe a prob with Teleport().
(There's no function SetWorldPosition())

edit2: well, two lines were missing before the Teleport() fct.:
thePlayer.EnablePhysicalMovement( false );
thePlayer.EnablePathEngineAgent( false );

Then it works. (I used 100.f for pos.Z and Geralt was "walking in the skies".)

But then the game crashed so there's further testing required.

Problem is that Geralt doesn't "fall down" from his new z position even if PhysicalMovement is set to 'true' after teleportation.

Maybe some investigations in havok are required or in the end the game is not designed for a "Jumping Jack" Geralt.:D
 
Last edited:
I'm afraid that implementing jumping would require more than adding velocity to the Player entity. All navigation stuff is working in such way that it snaps player to nav mesh. You should remove this feature, add jumping and rewrite players collision with navmesh (if it is possible to do in witcher script)
 
Top Bottom