[NPC Pack] Urchins

Share and discuss custom LunaLua code and content packs for SMBX2.
Enjl
Cute Yoshi Egg
Cute Yoshi Egg
Posts: 8729
Joined: Mon Jan 20, 2014 12:58 pm
Flair: Orphion Egamalenitar Osmos IV, Esq.

[NPC Pack] Urchins

Postby Enjl » Thu Jun 27, 2019 1:56 pm

I can't believe Core beat me to uploading an Urchin script. Now you have two to choose from! Pick whichever you like more.

A download link can be found here:
https://drive.google.com/file/d/11SP1-f ... sp=sharing

Demo:
https://www.youtube.com/watch?v=iuFO-R_ISsY
1:20

Installation instructions can be found in the handbook or in my thread.

Modifications and adaptations of the code is permitted. If you use this particular code as a basis for an enhanced version of these NPCs, please give credit.

Movement guided by:
Straight redirectors
Diagonal redirectors
Terminus (Sets speed to 0)
Toggle (Inverts speed)

NPC codes:
waittime: Time the urchin waits at each redirector. Defaults to 65 for the purple urchin and 0 for the pink urchin.
Ideas are useless if you can't make them real.
Image

User avatar
55jedat555
Fighter Fly
Fighter Fly
Posts: 61
Joined: Sat Feb 28, 2015 11:35 am
Flair: flare
Current Project: it's some kaizo thing
Chat Username: 55jedat555
Contact:

Re: [NPC Pack] Urchins

Postby 55jedat555 » Sun Jul 07, 2019 9:14 am

Just want to point out that the Urchins ignore redirectors/togglers/terminuses (except the initial one) when placed underwater. It's fixed by setting nowaterphysics to true though.
My YouTube channel: jedat555
Check out my levels!
"Don't trust your eyes, trust mine."
Image
I support:
Spoiler: show
Image
Image
Image
Image
Image
Image

User avatar
Teemster2
Volcano Lotus
Volcano Lotus
Posts: 518
Joined: Sat Jan 18, 2014 11:56 am

Re: [NPC Pack] Urchins

Postby Teemster2 » Sun Jul 07, 2019 6:26 pm

Wow. One of my all time favorite npcs. This is a great addition to the roster. Thanks everyone for keeping this alive.
I want to say thank you to God for every day he gives me on this planet and for the chance to be in a better place when I die.

Rakel0123
Shy Guy
Shy Guy
Posts: 9
Joined: Sat Jan 18, 2020 4:54 am

Re: [NPC Pack] Urchins

Postby Rakel0123 » Mon Mar 02, 2020 2:49 pm

Yeah I have some bugs with the urchins too (with redirectors, especially underwater). Otherwise, thank you for your big job !

User avatar
Teemster2
Volcano Lotus
Volcano Lotus
Posts: 518
Joined: Sat Jan 18, 2014 11:56 am

Re: [NPC Pack] Urchins

Postby Teemster2 » Thu Mar 05, 2020 12:40 pm

Rakel0123 wrote:
Mon Mar 02, 2020 2:49 pm
Yeah I have some bugs with the urchins too (with redirectors, especially underwater). Otherwise, thank you for your big job !
What kind of bugs? Please provide details.
I want to say thank you to God for every day he gives me on this planet and for the chance to be in a better place when I die.

Rakel0123
Shy Guy
Shy Guy
Posts: 9
Joined: Sat Jan 18, 2020 4:54 am

Re: [NPC Pack] Urchins

Postby Rakel0123 » Thu Mar 05, 2020 2:46 pm

No, it's all fixed. I reinstalled the pack and I set nowaterphysics to true too so now it's ok ^^

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

Re: [NPC Pack] Urchins

Postby JamesR624 » Mon Jul 06, 2020 9:36 am

Odd...

Code: Select all

==> ...\Mario\SMBX2 Beta 4\data/scripts/base/engine/require.lua:146: Error: worlds/test/npc-840.lua:44: '}' expected (to close '{' at line 40) near '['
=============
stack traceback:
	...\Mario\SMBX2 Beta 4\data/scripts/base/engine/require.lua:146: 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 tried fixing this but I can't seem to find any unclosed brackets in the lua file.

Sorry, I did forget to mention that I did change the NPC ID to a free slot. I also replaced the instances of 802 with 840 to reflect the changes, though I dunno why changing that ID would make the game complain about a missing bracket.

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

Re: [NPC Pack] Urchins

Postby Enjl » Mon Jul 06, 2020 10:21 am

That is pretty odd. I presume you renamed the file to npc-840 yourself? Just to double-check, make sure the registerHarmTypes call looks exactly like this:

Code: Select all

npcManager.registerHarmTypes(npcID,
	{
		HARM_TYPE_NPC,
		HARM_TYPE_PROJECTILE_USED,
		HARM_TYPE_HELD,
		HARM_TYPE_LAVA,
	}, 
	{
		[HARM_TYPE_NPC]=801,
		[HARM_TYPE_PROJECTILE_USED]=801,
		[HARM_TYPE_HELD]=801,
		[HARM_TYPE_LAVA]={id=13, xoffset=0.5, xoffsetBack = 0, yoffset=1, yoffsetBack = 1.5},
	}
);
Please post the file to hastebin.com and link it here if the error remains unsolved, so I can take a look if anything's different as well.
Ideas are useless if you can't make them real.
Image

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

Re: [NPC Pack] Urchins

Postby JamesR624 » Mon Jul 06, 2020 10:39 am

Okay, this is really strange. After being severely frustrated, I just re-installed the NPC completely, dumped my world and put in a backup I have from before the installation. Did the exact same procedure and it seems to work fine now. I am guessing I may have misclicked and added something.

Quick during typing edit: I did a compare of the broken LUA file with the new one I JUST NOW modded that is working and it seems I accidentially deleted a comma after one of the ID numbers around line 43. Due to, I am guessing, how LUA works, the error complaining about line 44 is what threw me off and made me ignore the ACTUAL error in line 43. Oops. Anyway, they work great now, thank you!

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

Re: [NPC Pack] Urchins

Postby Enjl » Mon Jul 06, 2020 11:05 am

Glad to hear it works now! Yeah, the line numbers are where the compiler notices something is wrong. Often that means the surrounding lines are relevant, too.
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 7 guests