Page 1 of 1

How to make custom NPC visible?

Posted: Wed Mar 08, 2023 4:09 pm
by vladimirdog2021
I have a custom NPC that I want to use in my SMBX2 level but I can't make it visible. Help?

Re: How to make custom NPC visible?

Posted: Wed Mar 08, 2023 8:27 pm
by Emral
NPCs are visible by default. Can you share more information about your custom NPC? Spritesheet, lua file setup, editor ini...

Re: How to make custom NPC visible?

Posted: Thu Mar 09, 2023 6:13 am
by vladimirdog2021
Emral wrote:
Wed Mar 08, 2023 8:27 pm
Can you share more information about your custom NPC?
This custom NPC was created by me and it's invisible by default in SMBX2.

Maybe I set it up incorrectly? :roll:

Re: How to make custom NPC visible?

Posted: Thu Mar 09, 2023 8:52 am
by Emral
vladimirdog2021 wrote:
Thu Mar 09, 2023 6:13 am
Emral wrote:
Wed Mar 08, 2023 8:27 pm
Can you share more information about your custom NPC?
This custom NPC was created by me and it's invisible by default in SMBX2.

Maybe I set it up incorrectly? :roll:
The default state of NPCs is visible. Unless you messed up somewhere, NPCs have no reason to be invisible, which is why I requested more information, so that I can maybe take a look over the relevant files and find the thing that causes it to be invisible.

Re: How to make custom NPC visible?

Posted: Thu Mar 09, 2023 9:14 am
by vladimirdog2021
Does changing the name of the custom NPC to "npc-751.png" probably fix this?

Re: How to make custom NPC visible?

Posted: Thu Mar 09, 2023 9:55 am
by Emral
vladimirdog2021 wrote:
Thu Mar 09, 2023 9:14 am
Does changing the name of the custom NPC to "npc-751.png" probably fix this?
Just upload the files and I take a look and tell you where the issue is. Guesswork takes too long.

Re: How to make custom NPC visible?

Posted: Thu Mar 09, 2023 10:22 am
by vladimirdog2021
SMBX2 decided to recognize my custom NPC and make it visible.

EDIT: For some reason, the custom NPC is jumping nonstop, IDK why.

Re: How to make custom NPC visible?

Posted: Thu Mar 09, 2023 11:38 am
by deice
vladimirdog2021 wrote:
Thu Mar 09, 2023 10:22 am
EDIT: For some reason, the custom NPC is jumping nonstop, IDK why.
that's just what the placeholder ai script does. the npc's behavior can be changed by editing its .lua file.

Re: How to make custom NPC visible?

Posted: Thu Mar 09, 2023 11:51 am
by vladimirdog2021
deice wrote:
Thu Mar 09, 2023 11:38 am
npc's behavior can be changed by editing its .lua file
I opened the .lua file, and where's the jumping script and where to disable this?

Re: How to make custom NPC visible?

Posted: Thu Mar 09, 2023 4:14 pm
by Emral
vladimirdog2021 wrote:
Thu Mar 09, 2023 11:51 am
deice wrote:
Thu Mar 09, 2023 11:38 am
npc's behavior can be changed by editing its .lua file
I opened the .lua file, and where's the jumping script and where to disable this?
Scroll down to the comment that reads that the default behaviour is jumping. The lines below that comment are the jump behaviour and can be commented out or removed to disable the jumping.

Re: How to make custom NPC visible?

Posted: Fri Mar 10, 2023 3:03 am
by vladimirdog2021
What are the NPC jumping script names?

EDIT: I just tried removing the NPC jumping script and nothing's changed.

Re: How to make custom NPC visible?

Posted: Sat Mar 11, 2023 2:49 pm
by deice
vladimirdog2021 wrote:
Fri Mar 10, 2023 3:03 am
EDIT: I just tried removing the NPC jumping script and nothing's changed.
the part you're supposed to remove is:

Code: Select all

if v.collidesBlockBottom then
	v.speedY = -6
end
though i think it's worth noting (and i don't mean to sound condescending) that if you don't know how to do this, you're probably better off not messing with lua files yet.

Re: How to make custom NPC visible?

Posted: Sun Mar 12, 2023 4:55 am
by vladimirdog2021
Does it remove the "--Execute main AI. This template just jumps when it touches the ground."?

Edit: The custom NPC doesn't jump anymore.

Re: How to make custom NPC visible?

Posted: Sun Mar 12, 2023 7:51 am
by vladimirdog2021
How do I make the event start when the player enters the trigger?