Proper State Toggling?

Need help with any SMBX game-related issues? Ask your questions here.
Forum rules
Before you make a topic/post, consider the following:
-Is there a topic for this already?
-Is your post on-topic/appropriate?
-Are you posting in the right forum/following the forum rules?
User avatar
MegaCDFan235
Bit
Bit
Posts: 134
Joined: Sun Nov 15, 2015 5:33 pm
Current Project: SMBX: Around the World (A Typical SMBX Episode is being put on hold)
Contact:

Proper State Toggling?

Postby MegaCDFan235 » Mon Jun 18, 2018 8:18 pm

Let's say that I wanted to create a custom NPC that has two states; still and fire.
Still is when the NPC doesn't do any action.
Fire is when the NPC decides to fire at you.
Let's try this with the basics first; events.
Image
See? It seems to work fine.
However, when you defeat one of the states....
Image
...that happens. One state will still activate even when you defeat the other.
So okay, I'm kind of an expert on these events. I know how to fix this, right?....
Image
....wrong. Sort of. The NPC doesn't completely keep activating, but it still does show up for a split second before disappearing.
Image
This isn't just a cosmetic thing either, it actually harms the player.
I want to know how I can have this effect without anything going wrong. And yes, I am aware of the fact that this probably cannot be done in the raw SMBX engine, rather, is it possible to make this perfect with Lua? I've tried it before but it never worked, so I just gave up on it (I deleted the original code for this because it didn't ever work, or seem to work). But now I am interested again, so I really want this question answered.
SMBX Stuff: show

Image
Image Image

CANCELLED:

Image

MARIO 5: BETWEEN UNIVERSES NOTICE: show
Mario 5: Between Universes has been canceled, and certain sections of the levels that survived through screenshots will be reused in some levels in SMBX: Around the World and will also be getting sort of a remake in either one of the episodes I'm working on. I'm really sorry for any inconveniences this causes.
Image
Image
Image
Image

Return to “Help and Support”

Who is online

Users browsing this forum: Bing [Bot], Electriking and 8 guests