[NPC Pack] FFB.Lua

Share and discuss custom LunaLua code and content packs for SMBX2.

Moderator: Userbase Moderators

MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6422
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
Contact:

[NPC Pack] FFB.Lua

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

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

GOD_SAMA
Buster Beetle
Buster Beetle
Posts: 94
Joined: Fri May 31, 2019 12:04 pm
Flair: just a roaming hylian

Re: [NPC Pack] FFB.Lua

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

amazing

Cedur
Link
Link
Posts: 7073
Joined: Tue Jun 28, 2016 10:14 am
Flair: I'm gone, for chess and minesweeper
Pronouns: he/him

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?

MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6422
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
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.

JamesR624
Spiny
Spiny
Posts: 29
Joined: Wed Aug 09, 2017 4:24 pm

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>

MECHDRAGON777
Pink Yoshi Egg
Pink Yoshi Egg
Posts: 6422
Joined: Fri Dec 20, 2013 6:40 pm
Flair: Nuclear Queen of Reversion.
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.

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

Re: [NPC Pack] FFB.Lua

Postby Emral » 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.).


Return to “LunaLua”

Who is online

Users browsing this forum: ShineBlaster and 1 guest

SMWCentralTalkhausMario Fan Games GalaxyKafukaMarioWikiSMBXEquipoEstelari