[FIXED] bugs.

Mods, guides how to use and install mods go right in here.
Post Reply
User avatar
alesan99
Posts: 2335
Joined: 30 May 2013, 21:42
Contact:

Post » 30 Aug 2013, 00:35

THIS THREAD IS NOT USELESS, I WILL POST BUGS HERE.
This is my first time adding entities to Mari0 so I don't know much.
Sašo wrote:Don't post in help threads if you don't intend to help.
Last edited by alesan99 on 08 Sep 2013, 03:12, edited 6 times in total.

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

Post » 07 Sep 2013, 14:48

First off, if size > 1 and size > 2 then is a pretty terrible line of code.
If size > 2 then should be sufficient, as > 2 infers > 1
size is used as a global variable, but I think you want the player's size.
You would say b.size instead of size as size should be used as a number specific to the player.

User avatar
Automatik
Posts: 1073
Joined: 20 Jul 2012, 17:54
Contact:

Post » 07 Sep 2013, 15:58

Found the first!

Code: Select all

function item(i, x, y, size)
	[...]
	elseif i == "poisonmush" then
		table.insert(objects["poisonmush"], poisonmush:new(-0.5, y-2/16))
	end
end
Should be table.insert(objects["poisonmush"], poisonmush:new(x-0.5, y-2/16))
Will look into the 2nd
Edit:
For the 2nd bug, Use

Code: Select all

function poisonmush:floorcollide(a, b)
	if a == "player" then
		b:die("poisonmush")
		self.active = false
		self.destroy = true
		self.drawable = false
	end	
end
instead.

-you need to give :die() need the reason of the death.(ex, "goomba") or it crash
-:die() will just call :shrink() if it's not a "fell into a pit" death or "ran out of time"
-The "end expected near" error happen when you forget a "end" somewhere.

User avatar
alesan99
Posts: 2335
Joined: 30 May 2013, 21:42
Contact:

Post » 07 Sep 2013, 19:49

Thank you so much!

Post Reply