Textblox is Throwing an Error. I never even loaded it.

Description: Official subforum for LunaLua - an extension framework for SMBX Engine Version 1.3 (which a core of SMBX 2.0). Share your creations that require the use of LunaLUA. You may also share info/tutorials on how to use LunaLUA.
Moderator: Moderators

Sambo M
Topic author, Count
Count
Avatar
Sambo M
Topic author, Count
Count
Age: 20
Reputation: 13
Posts: 264
Joined: 27 Jun 2014

Post #1by Sambo » 24 Dec 2016, 3:53

Textblox is giving me the following error when I talk to an NPC:
textblox.PNG

What I really don't understand is that I never loaded Textblox, so why is it even running? I checked all the APIs I have loaded, and none of them load Textblox.

I have LunaLua v. 0.7.3.1, which is the same as the LunaLua for SMBX 2.0, as I understand. Does SMBX 2.0 always load the Textblox API?
Image
Current Project:
Image

Kevsoft M
Angry developer
Angry developer
Avatar
Kevsoft M
Angry developer
Angry developer
Age: 19
Reputation: 77
Posts: 376
Joined: 26 Apr 2014
Location: Austria

Post #2by Kevsoft » 24 Dec 2016, 18:19

Mhh weird. This should not happen.

First of all: LunaLua with SMBX 2.0 and LunaLua without SMBX 2.0 do behave a bit different. SMBX 2.0 does preload some additional APIs.
Textblox should not preload for LunaLua without SMBX 2.0.

Please check if you have the following file: "LuaScriptsLib/basegame/lunabase.lua" (This is the file where SMBX 2.0 loads those additional APIs).

EDIT: I found out that warn.lua tries to preload textblox. warn.lua is a core API which preloads when LunaLua loads.

EDIT 2: It seems that there are conflicts with versions of APIs. I recommend updating textblox or removing it if nothing helps.
▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.start() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬
Image
Wohlstand in interview:
Spoiler
Image

▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬ Signature.end() ▬▬▬▬▬▬▬▬▬▬ஜ۩۞۩ஜ▬▬▬▬▬▬▬▬

Rockythechao M
Contributor
Contributor
Avatar
Rockythechao M
Contributor
Contributor
Age: 24
Reputation: 0
Posts: 2
Joined: 17 Oct 2014
YouTube

Post #3by Rockythechao » 24 Dec 2016, 20:48

Creator of textblox here. That's most likely textblox's message box override functionality acting up.
I don't recommend removing the library because some other APIs do make use of it. What I do suggest is loading it in your episode or level code to create a local reference to the already-loaded API and then using that reference to disable override mode.

Code: Select all

local textblox = API.load("textblox")
textblox.overrideMode = textblox.OVERRIDE_VANILLA


Please let me know where you got your copy of textblox from, Sambo, because having that on by default was a mistake on my part. Apologies for the trouble!

EDIT:
I just remembered a better solution.

Code: Select all

local textblox = API.load("textblox")
textblox.overrideMessageBox = false

Sambo M
Topic author, Count
Count
Avatar
Sambo M
Topic author, Count
Count
Age: 20
Reputation: 13
Posts: 264
Joined: 27 Jun 2014

Post #4by Sambo » 26 Dec 2016, 22:04

I just downloaded the newest version from your GitHub repo, and it works now. It seems that the message box override is enabled by default in this version.

Also, it isn't displaying message boxes quite right:
2016-12-26_11_13_12.png

The text is overlapping the borders. It looks kinda funky.

Edit: How do I get a newline? The "enter" key just displays 2 spaces, and "\n" just displays "\n"

Also, can I make a suggestion for this API? You should make it so different message box settings can be used depending on the NPC you're talking to. (for example, making signs display a different style of message box from the other NPCs. Maybe this could be set depending on the NPC's ID or with npcParse tags.)
Image
Current Project:
Image

Rockythechao M
Contributor
Contributor
Avatar
Rockythechao M
Contributor
Contributor
Age: 24
Reputation: 0
Posts: 2
Joined: 17 Oct 2014
YouTube

Post #5by Rockythechao » 10 Feb 2017, 2:48

oh jeez oh jeez I really need to start checking this forum more frequently

I forget if we've since discussed this on discodehaus or some other platform. If so, apologies for forgetting and repeating myself! If not, apologies for the extremely delayed response.

textblox is getting a successor. There's a bug with the Text Block class (and thus with the override modes) that causes the game to lock up for several minutes under certain circumstances and it can't be fixed without optimizing the auto-wrapping, and that, frustratingly enough, requires completely overhauling the way the library parses and manages text. And since I'll be redoing a big portion of the API I figured I might as well rebuild it from the ground up, leave out features that could be handled by other APIs to keep the scope more focused and manageable and address some limitations of the original Font class.

That being said, progress on the new library (textplus) is slow so I have been going back to fix up some issues with blox in the meantime. They're limited to the SMBX 2.0 source for the time being, though.

Sambo wrote:Also, it isn't displaying message boxes quite right:
2016-12-26_11_13_12.png

The text is overlapping the borders. It looks kinda funky.

That's something I've been trying to fix but it's a stubborn bug; every time I think I've got it the margins break in other cases.

Edit: How do I get a newline? The "enter" key just displays 2 spaces, and "\n" just displays "\n"

The <br> tag.

Also, can I make a suggestion for this API? You should make it so different message box settings can be used depending on the NPC you're talking to. (for example, making signs display a different style of message box from the other NPCs. Maybe this could be set depending on the NPC's ID or with npcParse tags.)

It actually already is set up to do that with an advanced override mode -- events trigger the vanilla-style messages of the basic override mode, signs have their own style and all other NPCs default to word bubbles, though you can change the preset for each NPC ID or, yes, specify one for a given NPC through an npcParse tag. I even implemented a <page> tag to split text up into multiple pages of the same message box so folks wouldn't have to use events for additional dialogue. Unfortunately, the NPC detection for the advanced override mode is still wonky and I can't do much better without the LunaLua core devs implementing a version of the onMessageBox event that passes in an NPC/event reference... and it's on the wishlist, but they have much bigger priorities. And again, there's the freezing bug with the Text Block class.

So overall, I really don't recommend using the override functionality... you can technically use it without any freezing or odd behavior but it'd require working around the limits of the NPC detection and manually wrapping every bit of text with <br>, and if your episode has a lot of text the latter will probably get incredibly tedious.


Return to “LunaLua - Extension Framework”

Who is online (over the past 5 minutes)

Users browsing this forum: 1 guest