Instant Forward momentum & Scaling to the player's current size problem...

Status
Not open for further replies.

SSG3

Oh, THAT Youtuber...
I've got a problem with getting momentum under control. My "Metroid Sonic" has a screw attack that, when custom 2 is pressed after a jump, is supposed to bring him upward AND forward at the same time. Currently it only makes him go upwards. What variable should I use?

Here's an extract of the code:
Code:
if not (P_IsObjectOnGround(player.mo)) and (player.jumping)
			and (player.canscrew ~= 2)
			and (player.isscrewing ~= 2)
			and (player.screwjumps ~= 5)
			and (player.screwjumping)
			and not (player.spectator)
			and not (player.pflags & PF_NIGHTSMODE)
			and not (player.mo.tracer and player.mo.tracer.type == MT_TUBEWAYPOINT)
			and not (player.mo.state == S_PLAY_DIE) then
				if (player.mo.eflags & MFE_UNDERWATER)
					P_SetObjectMomZ(player.mo, 5*FRACUNIT, false)
				else
					P_SetObjectMomZ(player.mo, 10*FRACUNIT, false)
					end
				S_StartSound(player.mo, sfx_fre800)
				player.screwjumps = $1 + 1
				player.isscrewing = 1
				if player.screwjumps >= 5
					player.canscrew = 2
					player.isscrewing = 2
				end
				player.stillscrewing = true
			end
			
			if (player.stillscrewing == true)
				P_SpawnGhostMobj(player.mo)
			end

If P_INSTATHRUST has to be used and I want it to make the player, at whatever speed or momentum they've gained, go at 20 FASTS/H constantly, where should I place it at?

Any answers would be very helpful.
 
P_InstaThurst can make your player go forward, P_Thrust does it too.
Check on the wiki, but as far as I remember, P_InstaThrust(player.mo, <value>*FRACUNIT) should work.

EDIT: My bad, I didn't read the whole thing.
Place it right under (or over) the thing that makes it goes upward, I guess.
 
Last edited:
Check on the wiki, but as far as I remember, P_InstaThrust(player.mo, <value>*FRACUNIT) should work.

Close, but not quite. In this case it should be P_InstaThrust(player.mo, player.mo.angle, x*FRACUNIT).
 
Status
Not open for further replies.

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

Back
Top