Double Jumping

Post » Fri Feb 18, 2011 7:37 pm

I'm making a mod and I would like to incorporate a double jump feature. Any way how to?
User avatar
Alba Casas
 
Posts: 3478
Joined: Tue Dec 12, 2006 2:31 pm

Post » Sat Feb 19, 2011 9:20 am

There's a problem with jumping too high - you'll hit this invisible ledge on the way back down. I found a fix for it though. If you walk off of something high up, you'll fall smoothly to the ground, but if you jump equally high, you hit the hangup. So I've got some code in my Powered Power Armor mod that spawns an object under your feet at the top of your jump. You land for a frame or two, then it deletes it and you fall to the ground like you just walked off of a ledge - uninterrupted.

The timing would be tricky, but I think if you did something similar - spawned something under the player's feet - they'd be able to jump off of it. Maybe continuously spawn and delete objects as long as the player is on the way up (zPosCurrent - zPosLast > 0).

I was thinking of splitting that code out of my mod into a separate module - a number of mods could benefit from it, but it only needs to be included once in a load order, not with every mod that needs it.
User avatar
WYatt REed
 
Posts: 3409
Joined: Mon Jun 18, 2007 3:06 pm

Post » Fri Feb 18, 2011 11:11 pm

You could also detect for a second space key tap and spawn the ledge a little below the player at that time.

The Imp's workaround would be required at the top of the jump of course :)
User avatar
X(S.a.R.a.H)X
 
Posts: 3413
Joined: Tue Feb 20, 2007 2:38 pm

Post » Sat Feb 19, 2011 8:24 am

I'm a little shakey when it comes down to advanced FOSE scripting so I'm going to need some help. Here's what I've got so far:
scn DblJumpshort iControlPressedBegin GameMode	if iControlPressed != IsControlPressed 12		if jumped == 0			TapControl 13			set jumped to 1		endif		if jumped == 1                   ;i'd imagine some advanced stuff going here, right?              endif      endifend

User avatar
Lucky Girl
 
Posts: 3486
Joined: Wed Jun 06, 2007 4:14 pm

Post » Sat Feb 19, 2011 5:13 am

There's a problem with jumping too high - you'll hit this invisible ledge on the way back down.

Care to explain this bit?
User avatar
Miranda Taylor
 
Posts: 3406
Joined: Sat Feb 24, 2007 3:39 pm

Post » Fri Feb 18, 2011 11:31 pm

I have no idea why it happens. Jumping high worked fine in Oblivion, so its a change made to the engine in between then and Fallout. It seems to be based on time spent in the air - if you jump off of something high up, you'll hit the invisible ledge on the way down even if you don't normally hit it when jumping on flat ground.

I really wish I knew what Bethesda changed and why - it sort of broke some cool potential mods, though my workaround helps. Even with it, I think you'll still have some sort of a hiccup if you set your jump height high enough that you're still heading up at the point in time when you'd normally hit the ledge.
User avatar
Eric Hayes
 
Posts: 3392
Joined: Mon Oct 29, 2007 1:57 am


Return to Fallout 3