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
integer
Number of frames in enemy.png. Defaults to 1 - NoSpriteSets
boolean
Graphic 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
text
Type of animation.frames
- AnimationStart
integer
First 1-indexed frame from the quads used in normal-state animation - AnimationFrames
integer
Number 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
integer
Frame to use. Defaults to 1
- AnimationSpeed
none
- QuadNo
integer
Frame to use. Defaults to 1
- QuadNo
- DontMirror
boolean
Graphic 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
boolean
Object won't move or be affected by gravity (better performance) - SpawnSound
string
Sound that gets played when this enemy is created - NotKilledFromBlocksBelow
boolean
Will not die if on a block that gets hit by Mario from below - JumpsFromBlocksBelow
boolean
Will jump if on a block that is hit by Mario from below - MakesMarioStar
boolean
Makes Mario starred on contact - RemoveOnMarioContact
boolean
Will get removed when Mario touches it - DontMirror
boolean
Graphic will not get mirrored when moving left
Collision
- Active
boolean
Object is updated and can collide (Usually true!) - Category
integer
Existing 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 array
Array 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
boolean
Whether the enemy goes through portals. Defaults to true -
Kills
boolean
Whether Mario dies upon any contact with this enemy's entity box -
KillsOnSides
boolean
Whether Mario dies upon contact with the sides of this enemy's entity box -
KillsOnBottom
boolean
Whether Mario dies upon contact with the bottom of this enemy's entity box -
KillsOnTop
boolean
Whether Mario dies upon contact with the top of this enemy's entity box -
KillsEnemies
boolean
Kills other enemies on contact -
KillsEnemiesAfterPortal
boolean
Turns on KillsEnemies after going through a portal -
NoCollideStops
boolean
Whether this enemy continues motion after collision (useful with bullets for example) -
EmancipateCheck
boolean
Whether this enemy is emancipated by emancipation grills -
AutoDelete
boolean
Enemy will be auto deleted if too low or behind the screen -
LaserResistant
boolean
Makes this enemy immune to lasers -
ResistsFire
boolean
Makes this enemy immune to Mario's fireballs -
ResistsStar
boolean
Makes this enemy immune to starred Mario -
Rideable
boolean
Mario can ride on top of Enemy -
ResistsSpikes
boolean
Makes this enemy immune to spikes (tile property) -
Bounces
boolean
Whether 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
boolean
Doesn't do the death animation when hit with a fireball. -
breaksblocks
boolean
-
breakblockside
string
What side(s) to break. -
customtimer
array
Put arrays in the array, the first slot is the delay, the second one is the action, the third one are the arguments ACTIONSbounce
playsound
setframe
set[PARAMETER HERE]
reverse[PARAMETER HERE]
(turns positive to negative and negative to positive)add[PARAMETER HERE]
multiply[PARAMETER HERE]
Stomp
- StompComboSuppressor
boolean
These enemies won't add to the player's combo of jumping on top of many enemies in a row - Stompable
boolean
Whether this enemy can be stomped- StompAnimation
boolean
Whether the enemy changes to stompedframe when stomped - StompAnimationTime
decimal
Duration of StompedFrame - StompedFrame 'integer` 1-indexed frame used when stomped
- KilledByBoxes
boolean
Makes this enemy stompable by cubes (doesn't require Stompable to be true)
- StompAnimation
Shell
- ShellAnimal
boolean
Whether this enemy can retract into a shell: - SmallMovement
text
When stomped and a ShellAnimal, enemy will change to this enemy type - SmallSpeed
decimal (blocks/second)
Speed when getting kicked or changing directions
Transformations
- transforms
boolean
Whether this enemy can transform into something else or not. - transformsinto
string
The destination enemy of this transformation. - tranformtriggers
array
rightcollide
leftcollide
ceilcollide
globalcollide
collide
death
shot
lifetime
playernear
playernotnear
seen
notSeen
- transformsintorandoms
array
- transformpassedparameters
array
Parameters that get passed on once the enemy transforms. - transformtriggerobjectcollide
string
Transforms when it collides with an object. - transformtriggerenemycollide
string
Transforms when it collides with an enemy. - playerneardist
integer
Enemy will transform when player is this near (horizontal). - playerneardist
array
Same as above, but you can select a region. set up array like this: [x, y, width, height]
Spawning
- SpawnsEnemy
text
If 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
integer
How 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
decimal
Amount 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
boolean
Override child SpeedX and SpeedY - SpawnEnemySpeed
decimal (blocks/second)
Set child SpeedX and SpeedY accordingly
- SpawnEnemyTowardsPlayer
Movement
- Movement
text
Movement type- chasetime
decimal
Time it takes before an enemy - chasespeed 'decimal' Speed that enemy travels after the above is met.
- chasetime
- MovementRandoms
text array
Movement types of which a random one is chosen (Overrides Movement)none
truffleshuffle
Moves left and right. Think Goombas.- TurnAroundOnCliff
boolean
Whether 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
piston
Goes out and in and out and in. Think piranha plants.- PistonDistX
decimal
Horizontal displacement of piston in blocks - PistonDistY
decimal
Vertical displacement of piston in blocks - PistonSpeedX
decimal
Horizontal speed - PistonSpeedY
decimal
Vertical speed - PistonExtendTime
decimal
Self explanatory Is it the time it stays extended or the time that it extends within?! - PistonRetractedTime
decimal
Self explanatory - DontPistonNearPlayer
boolean
Self explanatory - DontPistonDist
decimal
Piston won't extend (but retract!) if player is this near - InactiveOnRetracted
boolean
Whether the enemy loses spawn and kill properties while retracted
- PistonDistX
follow
Follows Mario. Think Lakitu.- followspace
decimal (blocks)
The enemy will try to stay inside this many blocks from the player - followspeed
decimal
How fast the enemy will follow you(if movement is set to "follow") - DistanceTime
decimal
Multiplied with the player speed to estimate where the player will be in this many seconds, that position is actually used then - nofollowspeedup
boolean
Enemy the enemy's movement is "follow" it won't speed up when the player is far.
- followspace
shell
Slides all over the place. Think stomped Koopas.- WakesUp
boolean
Whether 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
boolean
Whether the enemy might walk right if Mario is to its right on wake up
- WakesUp
squid
Moves down first, then towards player and up. Bloopers showcase this movement.- SquidFallSpeed
decimal
Speed at which this enemy moves down (Phase 1) - SquidXSpeed
decimal
Speed at which this enemy moves right and left (Phase 2) - SquidUpSpeed
decimal
Speed at which this enemy moves up (Phase 2) - SquidAcceleration
decimal (blocks/second2)
How fast the enemy accelerates - SquidDownDistance
blocks
How far the enemy falls down - SquidHorDistance
blocks
How far the enemy goes left/right
- SquidFallSpeed
rocket
Shoots up, falls down, repeat. Think those fire things in the castle.- RocketDistance
blocks
How high this enemy will get shot up every time
- RocketDistance
verticalwiggle
Goes up and down within a margin. Think Cheep Cheep.- VerticalWiggleDistance
blocks
How far this enemy will wiggle downwards - VerticalWiggleSpeed
decimal (blocks/second)
How fast this enemy wiggles up and down
- VerticalWiggleDistance
flytime
Smoothly moves from end to end like a patrolling Koopa Paratroopa.- flyingtime
blocks
How long it'll take to go the distance. - flyingdisx
blocks
How far this enemy will fly from origin horizontally. - flyingdisy
blocks
How far this enemy will fly from origin vertically.
- flyingtime
#Sort
- chasemarioonwakeup boolean,
- jumps
boolean
Makes the enemy jump. - jumptime
value
How much time it takes before it jumps. - jumpforce
value
How high enemy the will jump. - jumpforcedown
value
Something to do with jumping through the ground. Lower = Dropping, Higher = No dropping - doesdamagetype
value
#Unsorted Additional Properties
- health
integer
Health, decreased when shot or stomped. - shothealth
integer
Health, shot exclusive. - stomphealth
integer
Health, stomp exclusive. - staticIfSeen
boolean
Becomes static when player faces the enemy. - staticIfNotSeen
boolean
Opposite of above. - rotatetowardsplayer
boolean
Faces player in all directions. - givecoinwhenstomped
boolean
Adds a coin directly to the player's coin count when stomped. - givecoinwhenshot
boolean
Adds a coin directly to the player's coin count when shot. - shotjumpforce
decimal
Shot jumpforce - shotspeedx
decimal
Shot speedx - fallswhenstomped
boolean
Falls when stomped, even if it has a stomped frame.