[NPC Pack] FFB.Lua

Share and discuss custom LunaLua code and content packs for SMBX2.
User avatar
MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6302
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Current Project: http://www.supermariobrosx.org/forums/v ... 9&start=10
Chat Username: 鬼人 正邪
Contact:

[NPC Pack] FFB.Lua

Postby MECHDRAGON777 » Thu Jun 27, 2019 10:43 am

Image
  • Image - Credit to Witchking666 for this graphic
  • Image

ImageImageImage
Image

Image

GOD_SAMA
Rex
Rex
Posts: 94
Joined: Fri May 31, 2019 12:04 pm
Flair: just a roaming hylian
Chat Username: GOD_SAMA

Re: [NPC Pack] FFB.Lua

Postby GOD_SAMA » Thu Jun 27, 2019 11:46 am

amazing
Image

User avatar
Cedur
Toad
Toad
Posts: 6477
Joined: Tue Jun 28, 2016 10:14 am

Re: [NPC Pack] FFB.Lua

Postby Cedur » Thu Jun 27, 2019 12:25 pm

What kind of object is this? Why was the shot on the top right corner not recognized?
Image
More Supports: show

Image
Image

Still using the legacy editor? Get SMBX2 and PGE, it will improve your experience significantly. Here's why. And remember, Yoshis are tools to be used and discarded.

ShadowStarX (06/14/18) wrote: South Korea is easy deal

User avatar
MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6302
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Current Project: http://www.supermariobrosx.org/forums/v ... 9&start=10
Chat Username: 鬼人 正邪
Contact:

Re: [NPC Pack] FFB.Lua

Postby MECHDRAGON777 » Thu Jun 27, 2019 1:47 pm

Cedur wrote:
Thu Jun 27, 2019 12:25 pm
What kind of object is this? Why was the shot on the top right corner not recognized?
That was due to the Toad block. If this has any bugs, please do report them though.

ImageImageImage
Image

Image

JamesR624
Cheep-Cheep
Cheep-Cheep
Posts: 18
Joined: Wed Aug 09, 2017 4:24 pm
Chat Username: JamesR624

Re: [NPC Pack] FFB.Lua

Postby JamesR624 » Sun Jul 12, 2020 3:20 pm

Found a MAJOR bug.

Upon exiting of game, the log produces this warning

Code: Select all

0t - Warning: Improperly calling NPC.get before onStart
stack traceback:
	scripts/base/engine/ffi_utils.lua:28: in function 'get'
	worlds/Maker Mario World/AI/FFB.lua:9: in function 'func'
	...Beta 4/scripts/base/engine/require.lua:150: in function 'require'
	worlds/test/npc-861.lua:4: in function 'func'
	...Beta 4/scripts/base/engine/require.lua:150: in function 'customNpcRequire'
	scripts/base/npcManager.lua:239: in function 'loadNpcCode'
	scripts/base/game/lunabase.lua:196: in function 'codeFile'
	main.lua:732: in function 'loadCodeFile'
	main.lua:875: in function <main.lua:782>
	[C]: in function '__xpcall'
	main.lua:782: in function <main.lua:781>

User avatar
MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6302
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Current Project: http://www.supermariobrosx.org/forums/v ... 9&start=10
Chat Username: 鬼人 正邪
Contact:

Re: [NPC Pack] FFB.Lua

Postby MECHDRAGON777 » Mon Jul 13, 2020 5:56 pm

JamesR624 wrote:
Sun Jul 12, 2020 3:20 pm
Found a MAJOR bug.

Upon exiting of game, the log produces this warning

Code: Select all

0t - Warning: Improperly calling NPC.get before onStart
stack traceback:
	scripts/base/engine/ffi_utils.lua:28: in function 'get'
	worlds/Maker Mario World/AI/FFB.lua:9: in function 'func'
	...Beta 4/scripts/base/engine/require.lua:150: in function 'require'
	worlds/test/npc-861.lua:4: in function 'func'
	...Beta 4/scripts/base/engine/require.lua:150: in function 'customNpcRequire'
	scripts/base/npcManager.lua:239: in function 'loadNpcCode'
	scripts/base/game/lunabase.lua:196: in function 'codeFile'
	main.lua:732: in function 'loadCodeFile'
	main.lua:875: in function <main.lua:782>
	[C]: in function '__xpcall'
	main.lua:782: in function <main.lua:781>
I will look into this over the coming week. Might be a good way to have a friend teach me how to make NPCs properly.

Edit: Since this exact NPC was used in my MaGLX3 entry, I would recommend waiting for that only in that I believe the team for the episode is fixing stuff as well. If they have fixed it, then it might be better to release that as an update when it is time.

ImageImageImage
Image

Image

Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8723
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

Re: [NPC Pack] FFB.Lua

Postby Enjl » Tue Jul 14, 2020 12:52 am

MECHDRAGON777 wrote:
Mon Jul 13, 2020 5:56 pm
JamesR624 wrote:
Sun Jul 12, 2020 3:20 pm
I will look into this over the coming week. Might be a good way to have a friend teach me how to make NPCs properly.

Edit: Since this exact NPC was used in my MaGLX3 entry, I would recommend waiting for that only in that I believe the team for the episode is fixing stuff as well. If they have fixed it, then it might be better to release that as an update when it is time.
This particular warning, saying "Improperly calling NPC.get before onStart" happens if NPC.get is called onStart. Just like all other warnings, it only appears in the editor and doesn't have a bearing on the functionality of the lua script. However, what it does point out is something that's either deprecated or code that may explain why certain things don't work as the writer of the code intended.
In this case, it's the latter. Calling NPC.get() or other functions that access SMBX objects (like players) before onStart never worked, since the level is still being loaded by then.
The solution is to not do that, but instead to use onStart for whatever you needed that NPC.get() call for, or to refactor the code in such a way that that NPC.get isn't necessary (which might already be the case if the NPC has previously worked with the faulty NPC.get in place, in which case you just have to remove the lines. Shouldn't make a difference.).
Ideas are useless if you can't make them real.
Image


Return to “LunaLua”

Who is online

Users browsing this forum: No registered users and 3 guests