S'CUSE ME?

This is the place for discussion and support for LunaLua and related modifications and libraries.
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?
BananaCat
Swooper
Swooper
Posts: 50
Joined: Fri Dec 30, 2016 6:20 pm

S'CUSE ME?

Postby BananaCat » Mon Feb 06, 2017 4:09 pm

OKay, this is not nice:

Code: Select all

local customData = Data(Data.DATA_WORLD, true)
customData:set("cardboardCoin",0)


function onTick()
	Text.print(customData:get("cardboardCoin"),0,0)
end

function onMessageBox(eventObj, msgStr)
	if msgStr == "mysteryToadTalk" then
		eventObj.cancelled = true
		Text.showMessageBox("Hey, I'm known as Russ T. in these parts, but I can lend you some useful information if you lend me a cardboard coin.")
		if customData:get("cardboardCoin") > 0 then
			Text.showMessageBox("Huh, you dont got any cardboard coins on you?")
			Text.showMessageBox("Well! We gotta teach you a lesson!")
			Text.showMessageBox("Cardboard coins are what makes the world go 'round! They seem useless, but they are worth a fortune!")
			Text.showMessageBox("There is five coins in each level, so they are easy money.")
			Text.showMessageBox("They respawn so its easy to farm as well!")
		end
		Text.showMessageBox("So maybe I could have one? (Press X to lend a cardboard coin)")
		if customData:get("cardboardCoin") == true then
			if customData:get("cardboardCoin") > 0 then
				customData:set("cardboardCoin",customData:get("cardboardCoin") - 1)
				Text.showMessageBox("Thank you!")
				-- here is supposed to be some code that tells different things after you progressively finish each level
			else
				Text.showMessageBox("Oh come on! Stop playing me, you dont have any cardboard coins!")
			end
		end
	end
end
So, the error is in line two (the debugger wasn't that helpful.) Anything?

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9722
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: S'CUSE ME?

Postby Emral » Mon Feb 06, 2017 4:37 pm

I'd ask you to show me "the error" but I can already tell it's because the unencrypted data class only accepts strings. Change the 0 to a "0" or encrypt your data class.
In the future, please provide the error message, too. I'll be the judge of whether or not it's helpful.

BananaCat
Swooper
Swooper
Posts: 50
Joined: Fri Dec 30, 2016 6:20 pm

Re: S'CUSE ME?

Postby BananaCat » Mon Feb 06, 2017 4:41 pm

Enjl wrote:I'd ask you to show me "the error" but I can already tell it's because the unencrypted data class only accepts strings. Change the 0 to a "0" or encrypt your data class.
In the future, please provide the error message, too. I'll be the judge of whether or not it's helpful.
I didnt actually get a error message, I got a debug message that said there was a error in line 2

Emral
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 9722
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Phoenix

Re: S'CUSE ME?

Postby Emral » Mon Feb 06, 2017 5:01 pm

That's what we call an error message.

Hoeloe
Foo
Foo
Posts: 1463
Joined: Sat Oct 03, 2015 6:18 pm
Flair: The Codehaus Girl
Pronouns: she/her

Re: S'CUSE ME?

Postby Hoeloe » Mon Feb 06, 2017 6:39 pm

BananaCat wrote:
Enjl wrote:I'd ask you to show me "the error" but I can already tell it's because the unencrypted data class only accepts strings. Change the 0 to a "0" or encrypt your data class.
In the future, please provide the error message, too. I'll be the judge of whether or not it's helpful.
I didnt actually get a error message, I got a debug message that said there was a error in line 2
It will have also contained information relevant to the cause of the problem. You may not have understood it, but that does not mean it wasn't there.

Also Enjl is right, the Data class does not accept numbers, only strings.


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 2 guests

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari