New Enemies Guide - GoonHouse/Marin0SE GitHub Wiki
Note
A majority of this content is wholesale lifted from Trosh's Mari0 SE Documentation, we're just "forking" it so that we can patch in the undocumented content.
Introduction
When creating Mari0:SE mappacks, you can add custom enemies. The files used for those must be added in the folder mappack/enemies/
For each enemy, which can go from a plant to a full-fledged missile pumping helicopter (I guess), you need one enemy.json file and you can have one enemy.png which will correspond to the graphics of this enemy.
On windows, Right click > new > text document to create a new file. Make sure to disable Hide file extension for known file types in folder settings, otherwise you might be editing a useless enemy.json_.txt_ file.
This is how you write the parameters for the enemy: enemies/enemy.json
base=enemyname_to_inherit_from
{
"string_parameter": "stringvalue",
"integer_parameter": 1,
"boolean_parameter": false,
"decimal_parameter": 19.93,
"array_parameter": ["arrays can contain any data type", 300, true, 0.2],
"_comment": "If you need to leave a comment, just use this parameter name.",
"_comment": "Duplicate parameters over-write the previous value by that name.",
"object_parameter": {
"sub_parameter": 4,
"_comment": "You can put more json as a value to have more named parameters as children to an attribute.",
"_comment": "Object parameters are not utilized anywhere at the moment, though.",
"string_parameter": "This won't overwrite the value 'stringvalue' above because it's nested in object_parameter"
},
"_comment": "The last value in a json node, unlike lua, cannot have a comma after it."
}
You only need to specify base at the beginning if your enemy is to inherit all the properties of another enemy and manually overwrite other attributes. Overwriting existing enemies in your mappack may have unforeseen consequences. Once you have edited the .json file and reloaded the mappack, the enemy will be displayed in editor > tiles > enemies. If your .json is causing crashes, try using this json validator to find what's wrong. Make sure you leave out the base=value when validating or it will instantly cause an error.
Graphics
The magic happens in enemy.json: this is where the entity goes from useless picture to interacting enemy. For a start make sure the image is used correctly; place the frames you need side by side in enemy.png, with the exact same width. You must use the QuadCount parameter if your enemy.png is made up of several sprites. enemy.json: "quadcount": n
So if your picture is 100px wide and you have four frames, set n to 4 and four 25px-wide frames will be loaded. Use the animation parameters to control how the images(s) is/are displayed. mirror and none animationtypes require only one image for normal-state animation. Examples
- QuadCount
integerNumber of frames in enemy.png. Defaults to 1 - NoSpriteSets
booleanGraphic will not be vertically split for the 4 spritesets. Defaults to false, this means that your image will be goofed up if you don't set it to true or provide four rows of graphics. - AnimationType
textType of animation.frames- AnimationStart
integerFirst 1-indexed frame from the quads used in normal-state animation - AnimationFrames
integerNumber of frames used in normal-state animation - AnimationSpeed
decimal (seconds/frame)frame duration in seconds
- AnimationStart
mirror- AnimationSpeed
decimal (seconds)Time between each mirror of the image - QuadNo
integerFrame to use. Defaults to 1
- AnimationSpeed
none- QuadNo
integerFrame to use. Defaults to 1
- QuadNo
- DontMirror
booleanGraphic will not get mirrored when moving left
Positioning

- SpawnOffsetX
decimal (blocks)X-offset from block (in-editor spawn placement or center of ancestor) - SpawnOffsetY
decimal (blocks)Y-offset from block (in-editor spawn placement or center of ancestor) - Width
decimal (blocks)Width of the entity box. This allows collisions to happen correctly. Default is 1. - Height
decimal (blocks)Height of the entity box. This allows collisions to happen correctly. Default is 1. - OffsetX
decimal (pixels)X-Offset for the image - OffsetY
decimal (pixels)Y-Offset for the image - QuadCenterX
decimal (pixels)X-Center of quads for rotation - QuadCenterY
decimal (pixels)Y-Center of quads for rotation - CustomScissor
decimal array (blocks)Only draw parts of an enemy. The coordinates are set from top-left of the enemy's block and in blocks. Ex:[X start, Y start, width, height]CustomScissor Example
Interaction
- SpeedX
decimal (blocks/second)Horizontal speed. Default is 0. - SpeedY
decimal (blocks/second)Vertical speed. Default is 0. - Gravity
decimal (blocks/second^2)Negative vertical acceleration. Default is a mystery. - Lifetime
decimal (seconds)Lifetime before this enemy is killed - Static
booleanObject won't move or be affected by gravity (better performance) - SpawnSound
stringSound that gets played when this enemy is created - NotKilledFromBlocksBelow
booleanWill not die if on a block that gets hit by Mario from below - JumpsFromBlocksBelow
booleanWill jump if on a block that is hit by Mario from below - MakesMarioStar
booleanMakes Mario starred on contact - RemoveOnMarioContact
booleanWill get removed when Mario touches it - DontMirror
booleanGraphic will not get mirrored when moving left
Collision
- Active
booleanObject is updated and can collide (Usually true!) - Category
integerExisting categories:
1 == *ALWAYS NOT COLLIDE*
2 == WORLD
3 == MARIO
4 == GOOMBA
5 == KOOPA
6 == MUSHROOM/ONEUP/FLOWER/STAR
7 == GEL DISPENSER
8 == GEL
9 == BOX
10 == SCREENBOUNDARIES
11 == BULLETBILL
12 == PORTALWALLS
13 == FIREBALLS
14 == HAMMERS
15 == PLATFORMS/SEESAWS
16 == BOWSER
17 == FIRE
18 == VINE
19 == SPRING
20 == HAMMERBROS
21 == LAKITO
22 == BUTTON --Not used anymore
23 == CASTLEFIRE
24 == CHEEP
25 == DOOR
26 == FAITHPLATE
27 == FLYINGFISH
28 == LIGHTBRIDGE
29 == PLANT
30 == SQUID
31 == UPFIRE
-
Mask
boolean arrayArray of categories masked with this enemy. If enemy.mask[otherenemy.category] is true, these 2 won't collide. The indexes correspond to the above list. -
Portalable
booleanWhether the enemy goes through portals. Defaults to true -
Kills
booleanWhether Mario dies upon any contact with this enemy's entity box -
KillsOnSides
booleanWhether Mario dies upon contact with the sides of this enemy's entity box -
KillsOnBottom
booleanWhether Mario dies upon contact with the bottom of this enemy's entity box -
KillsOnTop
booleanWhether Mario dies upon contact with the top of this enemy's entity box -
KillsEnemies
booleanKills other enemies on contact -
KillsEnemiesAfterPortal
booleanTurns on KillsEnemies after going through a portal -
NoCollideStops
booleanWhether this enemy continues motion after collision (useful with bullets for example) -
EmancipateCheck
booleanWhether this enemy is emancipated by emancipation grills -
AutoDelete
booleanEnemy will be auto deleted if too low or behind the screen -
LaserResistant
booleanMakes this enemy immune to lasers -
ResistsFire
booleanMakes this enemy immune to Mario's fireballs -
ResistsStar
booleanMakes this enemy immune to starred Mario -
Rideable
booleanMario can ride on top of Enemy -
ResistsSpikes
booleanMakes this enemy immune to spikes (tile property) -
Bounces
booleanWhether this enemy will bounce every time it hits the floor -
BounceForce
decimal (blocks/second)How strong each bounce will make the enemy fly up -
doesntflyawayonfireball
booleanDoesn't do the death animation when hit with a fireball. -
breaksblocks
boolean -
breakblockside
stringWhat side(s) to break. -
customtimer
arrayPut arrays in the array, the first slot is the delay, the second one is the action, the third one are the arguments ACTIONSbounceplaysoundsetframeset[PARAMETER HERE]reverse[PARAMETER HERE](turns positive to negative and negative to positive)add[PARAMETER HERE]multiply[PARAMETER HERE]
Stomp
- StompComboSuppressor
booleanThese enemies won't add to the player's combo of jumping on top of many enemies in a row - Stompable
booleanWhether this enemy can be stomped- StompAnimation
booleanWhether the enemy changes to stompedframe when stomped - StompAnimationTime
decimalDuration of StompedFrame - StompedFrame 'integer` 1-indexed frame used when stomped
- KilledByBoxes
booleanMakes this enemy stompable by cubes (doesn't require Stompable to be true)
- StompAnimation
Shell
- ShellAnimal
booleanWhether this enemy can retract into a shell: - SmallMovement
textWhen stomped and a ShellAnimal, enemy will change to this enemy type - SmallSpeed
decimal (blocks/second)Speed when getting kicked or changing directions
Transformations
- transforms
booleanWhether this enemy can transform into something else or not. - transformsinto
stringThe destination enemy of this transformation. - tranformtriggers
arrayrightcollideleftcollideceilcollideglobalcollidecollidedeathshotlifetimeplayernearplayernotnearseennotSeen - transformsintorandoms
array - transformpassedparameters
arrayParameters that get passed on once the enemy transforms. - transformtriggerobjectcollide
stringTransforms when it collides with an object. - transformtriggerenemycollide
stringTransforms when it collides with an enemy. - playerneardist
integerEnemy will transform when player is this near (horizontal). - playerneardist
arraySame as above, but you can select a region. set up array like this: [x, y, width, height]
Spawning
- SpawnsEnemy
textIf this has a value, then this enemy will spawn that enemy according to the following parameters: - SpawnsEnemyRandoms 'array' Spawns a random enemy.
- SpawnEnemyDelays
decimal array (seconds)A list of delays from which a random one is chosen every time - ThrowQuadOffset
integerHow much to add to the used quad (If your usual cycle is 1-2-1-2 and you want it to be 3-4-3-4 for the throwing, this is 2!) - this means the throw animation is of the same format as the normal animation - ThrowPrepareTime
decimalAmount of time before the actual throw that the throwquad is used
Possible ways to set the speed of spawned enemies
- Simple speed
- SpawnEnemySpeedX
decimal (blocks/second)X-Speed of spawned enemies - SpawnEnemySpeedY
decimal (blocks/second)Y-Speed of spawned enemies
- SpawnEnemySpeedX
- Random speed (Can be random for hor and simple for ver for example)
- SpawnEnemySpeedXRandomStart
decimal (blocks/second)Minimum value of horizontal speed (negative for left) - SpawnEnemySpeedYRandomStart
decimal (blocks/second)Minimum value of vertical speed - SpawnEnemySpeedXRandomEnd
decimal (blocks/second)Maximum value of horizontal speed - SpawnEnemySpeedYRandomEnd
decimal (blocks/second)Maximum value of vertical speed
- SpawnEnemySpeedXRandomStart
- Towards nearest player
- SpawnEnemyTowardsPlayer
booleanOverride child SpeedX and SpeedY - SpawnEnemySpeed
decimal (blocks/second)Set child SpeedX and SpeedY accordingly
- SpawnEnemyTowardsPlayer
Movement
- Movement
textMovement type- chasetime
decimalTime it takes before an enemy - chasespeed 'decimal' Speed that enemy travels after the above is met.
- chasetime
- MovementRandoms
text arrayMovement types of which a random one is chosen (Overrides Movement)nonetruffleshuffleMoves left and right. Think Goombas.- TurnAroundOnCliff
booleanWhether horizontal speed is reversed upon arrival on cliff - TruffleshuffleSpeed
decimal (blocks/second)Speed of horizontal movement - TruffleshuffleAcceleration
decimal (blocks/second^2 ???)Acceleration of horizontal movement. I'm not sure why there are question marks but I'm gonna assume this needs to be investigated.
- TurnAroundOnCliff
pistonGoes out and in and out and in. Think piranha plants.- PistonDistX
decimalHorizontal displacement of piston in blocks - PistonDistY
decimalVertical displacement of piston in blocks - PistonSpeedX
decimalHorizontal speed - PistonSpeedY
decimalVertical speed - PistonExtendTime
decimalSelf explanatory Is it the time it stays extended or the time that it extends within?! - PistonRetractedTime
decimalSelf explanatory - DontPistonNearPlayer
booleanSelf explanatory - DontPistonDist
decimalPiston won't extend (but retract!) if player is this near - InactiveOnRetracted
booleanWhether the enemy loses spawn and kill properties while retracted
- PistonDistX
followFollows Mario. Think Lakitu.- followspace
decimal (blocks)The enemy will try to stay inside this many blocks from the player - followspeed
decimalHow fast the enemy will follow you(if movement is set to "follow") - DistanceTime
decimalMultiplied with the player speed to estimate where the player will be in this many seconds, that position is actually used then - nofollowspeedup
booleanEnemy the enemy's movement is "follow" it won't speed up when the player is far.
- followspace
shellSlides all over the place. Think stomped Koopas.- WakesUp
booleanWhether this enemy returns to initial state - ResetTime
decimal (seconds)How long until this enemy wakes up from its shell - WiggleTime
decimal (seconds)How long before waking up the enemy will wiggle - WiggleDelay
decimal (seconds)Time between each wiggler - ChaseMarioOnWakeup
booleanWhether the enemy might walk right if Mario is to its right on wake up
- WakesUp
squidMoves down first, then towards player and up. Bloopers showcase this movement.- SquidFallSpeed
decimalSpeed at which this enemy moves down (Phase 1) - SquidXSpeed
decimalSpeed at which this enemy moves right and left (Phase 2) - SquidUpSpeed
decimalSpeed at which this enemy moves up (Phase 2) - SquidAcceleration
decimal (blocks/second2)How fast the enemy accelerates - SquidDownDistance
blocksHow far the enemy falls down - SquidHorDistance
blocksHow far the enemy goes left/right
- SquidFallSpeed
rocketShoots up, falls down, repeat. Think those fire things in the castle.- RocketDistance
blocksHow high this enemy will get shot up every time
- RocketDistance
verticalwiggleGoes up and down within a margin. Think Cheep Cheep.- VerticalWiggleDistance
blocksHow far this enemy will wiggle downwards - VerticalWiggleSpeed
decimal (blocks/second)How fast this enemy wiggles up and down
- VerticalWiggleDistance
flytimeSmoothly moves from end to end like a patrolling Koopa Paratroopa.- flyingtime
blocksHow long it'll take to go the distance. - flyingdisx
blocksHow far this enemy will fly from origin horizontally. - flyingdisy
blocksHow far this enemy will fly from origin vertically.
- flyingtime
#Sort
- chasemarioonwakeup boolean,
- jumps
booleanMakes the enemy jump. - jumptime
valueHow much time it takes before it jumps. - jumpforce
valueHow high enemy the will jump. - jumpforcedown
valueSomething to do with jumping through the ground. Lower = Dropping, Higher = No dropping - doesdamagetype
value
#Unsorted Additional Properties
- health
integerHealth, decreased when shot or stomped. - shothealth
integerHealth, shot exclusive. - stomphealth
integerHealth, stomp exclusive. - staticIfSeen
booleanBecomes static when player faces the enemy. - staticIfNotSeen
booleanOpposite of above. - rotatetowardsplayer
booleanFaces player in all directions. - givecoinwhenstomped
booleanAdds a coin directly to the player's coin count when stomped. - givecoinwhenshot
booleanAdds a coin directly to the player's coin count when shot. - shotjumpforce
decimalShot jumpforce - shotspeedx
decimalShot speedx - fallswhenstomped
booleanFalls when stomped, even if it has a stomped frame.