Inspirited's code requests

This is the place for discussion and support for LunaLua and related modifications and libraries.

Moderator: Userbase Moderators

Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on topic/appropriate?
-Are you posting in the right forum/following the forum rules?
Inspirited
Snifit
Snifit
Posts: 242
Joined: Sun Oct 30, 2016 5:58 pm

Inspirited's code requests

Postby Inspirited » Thu Aug 17, 2017 11:29 am

Hey, I'd like to use this thread to request simple lunalua codes. I could learn to code myself and browse documentations, but aaaah. I admit, I'm lazy.

I use Mario and 1-player only.

Special Star Exit
edit: nevermind

Disable HUD, coins and lives

This goes into my lunaworld.lua file too.

I'd like to
- completely hide the HUD in levels
- disable Mario from having an inventory item in the inventory box (or from using it)
- coins constantly set to 0
- lives constantly set to 3
- don't show lives when restarting a level
- don't show lives and coins in the worldmap (if possible?)

That's all :O


EDIT: Nevermind, I managed to do it myself :D

In case you're interested, here's the code.

Code: Select all

local WhiteImage = Graphics.loadImage(Misc.resolveFile("whitescreen.png"))
local WhiteOut = 0
local MarioFreezeX
local MarioFreezeY

function onStart()
	Graphics.activateHud(false)
end

function onTick()	
	if Level.winState() ~= 0 and WhiteOut == 0 then
		WhiteOut = 0.004
		MarioFreezeX = player.x
		MarioFreezeY = player.y
	end
	if WhiteOut > 0 then
		Graphics.drawImage(WhiteImage, 0, 0, WhiteOut)
		WhiteOut = WhiteOut + 0.004
		if WhiteOut > 1 then
			WhiteOut = 1
		end
	end
end

function onTickEnd()
	mem(0x00B2C5A8, FIELD_WORD, 0) --coins
	mem(0x00B2C5AC, FIELD_FLOAT, 3) --lives
	player.reservePowerup = 0
	
	if WhiteOut > 0 then
		player.x = MarioFreezeX
		player.y = MarioFreezeY
	end
end

Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari