Mario jump height?

Mods, guides how to use and install mods go right in here.
Post Reply
User avatar
cavejohnson99
Posts: 185
Joined: 09 May 2012, 08:37

Post » 21 Aug 2012, 09:42

Which file and where do find how high Mario jumps? And is there a way I can make it that the default jump height is lower than usual, but jumps the current height if he's walking on repulsion gel?
Thanks.

User avatar
TripleXero
Posts: 892
Joined: 08 Aug 2012, 00:23
Contact:

Post » 21 Aug 2012, 09:54

variables.lua has gravity and speeds and points for killing enemies and all of that stuff in it. I don't know about the other question, but one of Turtle95's new Gels contains one that makes you jump lower, you could probably edit it for what you're trying to do

User avatar
Turtle95
Posts: 1246
Joined: 21 Mar 2012, 21:48
Contact:

Post » 21 Aug 2012, 15:30

TripleXero wrote:variables.lua has gravity and speeds and points for killing enemies and all of that stuff in it. I don't know about the other question, but one of Turtle95's new Gels contains one that makes you jump lower, you could probably edit it for what you're trying to do
It's gel number 7.

Code: Select all

if self.jumping == true then
		--bottom on grid
		if math.mod(self.y+self.height, 1) == 0 then
			local x = round(self.x+self.width/2+.5)
			local y = self.y+self.height+1
			--x and y in map
			if inmap(x, y) then
				--top of block orange
				if map[x][y]["gels"]["top"] == 7 then
					local force = -jumpforce - (math.abs(self.speedx) / maxrunspeed)*jumpforceadd
					force = math.max(-jumpforce - jumpforceadd, force)
					self.speedy = force / 2
					playsound(stickypaint)
				end
			end
		end
	end
However, you want it to apply to him in general? There's a specific line. This code however, makes Mario jump half his height.

Code: Select all

function mario:jump()
	if not noupdate and self.controlsenabled then
		if not underwater then
			if self.spring then
				self.springhigh = true
				return
			end
			
			if self.falling == false then
				if self.size == 1 then
					playsound(jumpsound)
				else
					playsound(jumpbigsound)
				end
				
				local force = -jumpforce - (math.abs(self.speedx) / maxrunspeed)*jumpforceadd
				force = math.max(-jumpforce - jumpforceadd, force)
				
				self.speedy = force
				self.jumping = true
				self.animationstate = "jumping"
				self:setquad()
			end
		else
			if self.ducking then
				self:duck(false)
			end
			playsound(swimsound)
			
			self.speedy = -uwjumpforce - (math.abs(self.speedx) / maxrunspeed)*uwjumpforceadd
			self.jumping = true
			self.animationstate = "jumping"
			self:setquad()
		end
	end
end

User avatar
BobTheLawyer
Posts: 2232
Joined: 01 May 2012, 21:00

Post » 21 Aug 2012, 18:11

cavejohnson99 wrote:Which file and where do find how high Mario jumps? And is there a way I can make it that the default jump height is lower than usual, but jumps the current height if he's walking on repulsion gel?
Thanks.
For the first question, variables.lua line 38.
The other question, use Turtle's code.

Post Reply