An in-depth look at customizing NPCs.

In SMBX, it's possible to customize NPCs through the use of different graphics and text documents. This article covers all the flags the program allows you to change and what exactly they do.

To make these work, you place them in a .txt file in a folder with the same name as the level you want them to affect. Putting them in the world's folder will have them affect every level in the game. The text file's name must match that of the NPC it's altering.

So, let's say you wanted to change the way Goombas behave in a level called 'Plain Plains'. You'd make a folder called 'Plain Plains' and create a text file inside. 'npc-1' is the file name of the Goomba, so you'd name the text file 'npc-1'. If you wanted all the Goombas in the game to have this alteration, you'd put it outside the 'Plain Plains' folder instead.

To make most of these flags work, you set them to '0' for false or '1' for true, like this:


Next, we'll cover the different flags specifically.

'grabtop' and 'grabside'

These two flags affect if/how the player can pick up an NPC. Grabtop lets them pick up an NPC while standing on it. Grabside lets them pick it up when standing next to it. They can also be used together.

However, grabtop doesn't work if you can't stand on the NPC in question. Likewise, grabside doesn't work if colliding with the enemy would cause damage to Mario. More on this a little later.


Setting this to true will cause Mario to take damage when he jumps on an enemy. If you set it to false, enemies will be safe to jump on. Sometimes, this lets Mario kill enemies he couldn't otherwise stomp, but it depends on the NPC. Small things like Spinies typically die, but bigger foes like Thwomps are unharmed.

This flag does NOT affect spin jumps.

'playerblock' and 'playerblocktop'

These two flags make the NPC behave like a solid object in regards to the player. Turning playerblock on will prevent the player from walking through the NPC. Using playerblocktop will let them stand on and ride the NPC. This flag works in conjunction with grabtop. However, if the NPC is unsafe to jump on, they player will take damage while standing on it.

'npcblock' and 'npcblocktop'

Like the previous two flags, these make NPCs behave likes solids in regards to each other. npcblock will make them act like a wall when other NPCs touch them, and npcblocktop lets them ride on top of each other.


This flag lets the NPC pass through solid objects. If the NPC is affected by gravity, they'll fall right off the stage. Another flag later on can help with this.


If a ground-bound NPC is walking and has this flag turned on, they'll turn away from cliffs instead of wandering off them. Simple.


With this flag on, the NPC can cause no damage to the player. They can still be killed themselves, though, and any projectiles they fire may still be harmful. Sometimes it's safer to just click the 'Friendly' button in the NPC window instead of using this flag.

'noyoshi', 'nofireball', and 'noiceball'

These three flags affect enemy resistances to Mario's various power-ups. The thing to keep in mind with these is that they are precluded with 'no'. The question isn't "can this monster be killed by fire?", but "is this monster immune to fire?" For example, if you set noyoshi=0, the NPC can be eaten by Yoshi even though the flag says false.

Please also notice that there aren't any 'nohammer', 'notail', or 'nospinjump' flags. It's impossible to change enemy resistances to these abilities, so choose which NPC you replace carefully.


With this on, the NPC will never fall down. It works well with noblockcollision. It works poorly with NPCs that jump, as their upward momentum never slows.


This changes the speed the NPC moves by percentages. speed=1 means the NPC goes 100% of its normal speed. speed=2 would be 200%, speed=.5 would be 50%, and so on. It's important to note that speeds with decimals can cause SMBX to crash on some computers. It's inconvenient, but it's best to stick with whole numbers for this reason.


This flag lets you change the number of points the player receives for defeating the NPC. Values range from 0 to 13 as follows:

0 - 0 pts.
1 - 10 pts.
2 - 100 pts.
3 - 200 pts.
4 - 400 pts.
5 - 800 pts.
6 - 1000 pts.
7 - 2000 pts.
8 - 4000 pts.
9 - 8000 pts.
10 - 1-Up
11 - 2-Up
12 - 3-Up
13 - 5-Up

Anything higher than 13 continues giving 5-Up.


This flag will put the NPC in front of everything else on-screen. Setting if false will put the NPC on the same layer as the rest.

'frames', 'framespeed', 'framestyle', 'gfxoffsetx', 'gfxoffsety', 'width', 'height', 'gfxheight', and 'gfxwidth'

These flags all pertain to an NPC's graphics, and that topic is so large and extensive that it warrants its own article.


These are all the flags you can use to customize NPCs. There are NO OTHERS. They won't work if you spell them incorrectly, either.

However, some NPCs have these flags hard-coded to them in SMBX. Even if you set the custom flags correctly, they still won't change the way you specified. One example is the Spike Top NPC. These are always unaffected by fireballs, no matter how you set their 'nofireball' flag. Most of the time, this isn't a problem, but it's something to keep in mind. Unfortunately, SMBX isn't the most reliable program.

This technical stuff may seem daunting, but it's relatively simple to work with. When making a custom NPC, just look down the list of flags and compare them to the properties of the NPC you're replacing. The text document doesn't need every flag set, so just leave out the ones you aren't changing.

Use the info in this guide to set up your custom NPCs just right!


Pages: 1
If anyone's interested, I've actually made a program allowing for you to edit these NPC codes sort of visually simply my checking off what you want the NPC to do and saving it in the format SMBX Supports. You can also see a preview of your custom NPC if you'd like and open existing files. Check it out on the official forums
Pages: 1