Undertale Battle System – MV Plugin

      23 Comments on Undertale Battle System – MV Plugin

This is a plugin that replicates the Bullet-hell system from Undertale.

Look at the code or download the Plugin:

Undertale Battle System

This is a plugin that replicates the Bullet-hell system from Undertale.

Skill Notetags

Place these notetags into the notebox of a Skill to customize the qualities
of the UTB attack!


For a Skill to use the Undertale Battle System, place this notetag in it:

<Use Undertale Attack>


<UTB Duration: x>

Set this to the amount of frames the UTB attack will last.
60 frames = 1 second.


<UTB Mode: 0>
Set’s this Skill to use the default mode.

<UTB Mode: 1>
Set’s this Skill to use the blue mode (gravity mode).
Can also use:
1.2 = Gravity to the left
1.3 = Gravity to the right
1.4 = Gravity to the up

<UTB Mode: 2>
Set’s this Skill to use green mode (shield mode).

<UTB Mode: 3>
Set’s this Skill to use purple mode (trap mode).

<UTB Mode: 4>
Set’s this Skill to use yellow mode (shooter mode).


<UTB Invincibility: x>

Set this to the amount of frames of invincibility that the player should
get when they’re hit with an attack.
60 frames = 1 second.


<UTB Delete Outside Frame>

If this Notetag is in the Notebox of the Skill, then the “attacks” will
be deleted if they exit the battle frame.

If this isn’t present, then attacks will be seen everywhere.


<UTB Code>
</UTB Code>

This allows you to customize JavaScript code for the overall Skill.
You can use ‘f’ and ‘p’ which are variables representing the current frame
and player object respectively.

Here’s some examples:

– How to change Player’s mode to 1 at frame 100:
<UTB Code>
if(f === 100) {
</UTB Code>

– How to show a message at frame 300:
<UTB Code>
if(f === 300) {
this.message(“Hello \\!This is a message.”);
</UTB Code>

– How to have a 1 in 100 chance for an instance of Attack 1 to
spawn every frame:
<UTB Code>
if(Math.randomInt(100) === 1) {
</UTB Code>


<UTB Initial Code>
</UTB Initial Code>

This is code that is run once at the start of the Skill.
It is mainly used to initialize variables and spawn preparation attacks
if it is necessary.

Here’s some examples:

– Creates a number variable called “count”:
<UTB Initial Code>
this._count = 0;
</UTB Initial Code>

– Spawns Attack 1 on the first frame only:
<UTB Initial Code>
</UTB Initial Code>

– Sets the frame’s Width to 500 and substract 50 from the frame’s X:
<UTB Initial Code>
this.window.width = 500;
this.window.x -= 50;
</UTB Initial Code>


<UTB Attack x>
</UTB Attack x>

Now, each Skill can have 9 individual “UTB attacks”.
You can customize one of them by using the tags above.
Then, you can customize the qualities of the attack by
using notetags inside of the UTB attack tags.

You may have to use this online tool to make the creation convenient:

For example:

<UTB Attack 1>
Initial X: this.x + 220
Initial Y: this.y + 5
Collision Type: Rect
Width: 160
Height: 20
X Speed: 0
Y Speed: 0.5
X Accel: 0
Y Accel: 0
Color: green
Spawn Rate: 100
Spawn Delay: 0
</UTB Attack 1>

<UTB Attack 2>
Initial X: this.x
Initial Y: this.y
X Speed: 1
Y Speed: 1
X Accel: 0
Y Accel: 0
Collision Type: circle
Radius: 15
Spawn Rate: 100
Spawn Delay: 20
Delete Distance: 50
Destructible: true
<Direct Code>
if(this.x > width) this.xspeed = -1;
</Direct Code>
</UTB Attack 2>

Actor Notetags

Use these to customize the Image and Collision of the Actor:

<UTB Sprite: filename>

Use this to set the file of the image of what you want the Actor to look
like. The image must be stored in img/SumRndmDde/utb/

Example: <UTB Sprite: heart>


<UTB Speed: speed>

Set this to the speed the Actor should move in the frame.

Simply set this to a number.

Example: <UTB Speed: 4>
<UTB Speed: 6>


<UTB Shape: shape>

Set this to the shape of this Actor’s collision box.

You can use: “circle” or “rect”.

Example: <UTB Shape: circle>
<UTB Shape: rect>


In order to customize the size of the shapes, use:

<UTB Radius: number>
For the “circle” collision.

<UTB Width: number>
<UTB Height: number>
For the “rect” collision.

Misc JavaScript Eval Info

Undertale Attack Evals

Here are the following variables for Undertale Attacks to be used in
“Direct Code”:

Image – this.image
Animation Frames – this.aniFrames
Animation Speed – this.aniSpeed
Type – this.type
Initial X – this.x
Initial Y – this.y
Collision Type – this.shape
Radius – this.radius
Width – this._mywidth
Height – this._myheight
X Speed – this.xspeed
Y Speed – this.yspeed
X Accel – this.xaccel
Y Accel – this.yaccel
X Scale – this.scale.x
Y Scale – this.scale.y
Opacity – this.opacity
Rotation – this.rotation
Visibility – this.visibility
Color – this.color
Delete Distance – this.deleteDistance
Destructible – this.destructible
Direct Code – this.directCode
Initial Code – this.iniCode
Window – this.window

Window Frame Evals

For the “Direct Code” and “UTB Code” notetags, you can use the this.window
variable to reference various positions on the frame.

this.window.x – The X position of the Window
this.window.y – The Y position of the Window
this.window.width – The width of the Window
this.window.height – The height of the Window
this.window.left – The X position of the left side of the Window
this.window.right – The X position of the right side of the Window
this.window.top – The Y position of the top side of the Window
this.window.bottom – The Y position of the bottom side of the Window
this.window.x_middle – The X position of the middle of the Window
this.window.y_middle – The Y position of the middle of the Window

Message Bubble Text Save

In order to “save” text to be shown in the next Undertale attack, use
the following Script Call:

$gameMessageBubble.saveText(`Insert the text
you wish to use
in here!`);




Detailed Changelog (do I still need this?)

Version 1.00
– Everything else (lol)

Version Beta 1.50
– Added TRAP (Purple) Mode
– Added Blue and Orange attacks
– Added Player rotation effect
– Added X/Y Scale, Opacity, Rotation attributes to UTB Attacks

Version Beta 1.40
– Rewrote the entire plugin from scratch D:
– Converted Bitmap-oriented system to a Sprite-oriented system
– Added “Defaults” system
– Tons of new Parameters added!

Version Beta 1.30
– Added the ability to customize the image used for each Actor
– Added the ability to customize the collision of each Actor
– Attacks can now exist outside of the Battle Box
<UTB Draw Outside Box> can be used to draw the attacks outside of the Battle Box
– Can now call “Initial Code” <UTB Initial Code>…</UTB Initial Code>
– Removed Dynamic Speed and Set
– Added more Parameters for customizing hue and opacity

Version Beta 1.20
– Damage is now based odd the damage a Skill would normally do as opposed to consistently doing 50 damage.
– “Delete Distance” can be used to specify a specific distance outside the box an attack may go before it is deleted.
– Added YELLOW mode. It let’s you shoot bullets when pushing “Z”. Use <UTB Mode: 4> to set the Skill to have YELLOW mode.

Version Beta 1.10
– Added “message” function to be used in UTB Code (this.message(“message”))
– Added “createAttack” function to be used in UTB Code (this.createAttack(id))
– Added JavaScript Code Notetag for Code that will
be called every frame the Skill is Active (<UTB Code>…</UTB Code>)
– Fixed Compatbility Issue with YEP Battle Engine Core
– Upgraded the Attack Deletion System
– Preload Face Images

Version Beta 1.00
– Added Parameters for various customization
– Fixed various bugs
– Created an individual class for the Player
– Beta Plugin Released at this version

Version Alpha 1.40
– Added the ability to give objects custom images
– Added “modes” to the Player
– Added the ability to customize “mode” per attack
– Added “blue mode” aka. gravity game
– Demo Created at this version

Version Alpha 1.30
– Added Custom Spawn Rates
– Added Spawn Delay
– Custom Color
– Added the ability to have 9 desperate UTB objects per attack
– Further improved upon collision system

Version Alpha 1.20
– Improved upon collision system
– Made collisions cusomizable per UTB attack object
– Added the ability to view collision masks of objects

Version Alpha 1.10
– Build UTB Attacks based on Skills used by Enemy
– Added Notetag system for customizing UTB attacks
– Added customizable durations for the UTB attacks
– Added “Dynamic” and “Static” movement

Version Alpha 1.00
– Initial reveal version
– Created the basic system with hard-coded attacks for each enemy
– Demo Created at this version

23 thoughts on “Undertale Battle System – MV Plugin

    1. Remix

      Maybe you have other plugins that causes that to happen, try creating a new project and put that as the only plugin, see if it still works, maybe you just need to update? or maybe you can try changing the order of your plugins, try doing a battle with a different enemy. if none works, then I can’t help you so consider me useless or yourself boned… No undertale puns intended.

  1. Jumpcommon

    I have a qustion ,This plugin version can add MessageBubble in battle event?
    I want to set turn enemy talk.

  2. Salem Nightlark

    I’m running in to two problems both are probably my own fault but is there a way to enlarge the main sprite that you control and turn off the hue coloring.

    Specifically I’m trying to make the side view sprite stand in the center and use the shield to block incoming attacks but the sprite is too small to see right and the colors are wrong from the hue adjuster I’ve watched your how to video several times trying to find answers. Everything else works wonderful and I’m probably looking ion the wrong place or trying to use it outside of its intended use but any help on the matter would be appreciated


    I’m going to want this to be played on Android, I think it will be difficult, so … no matter, this is a great addition!

  4. partyplayz

    i am haveing an issue, whenever i try to start a battle with any enemy that has the undertale battle skill it fades and transitions like its going to start a battle but then presents me with a black screen that says “TypeError cannot read property ‘blurfilter’ of undefined”

  5. Jenny Maridowe

    Hey! I’m loving the plugin, but I wanted to ask when your online battle generator updated? So far your plugin is in beta 1.51 and the battle creator is still in Beta 1.0. When I try to use the battle creator I keep getting errors, specifically (Box undefined) errors.

  6. Samual Buckley

    Are there any good poetry sites that you know of so that I can have an account that has lots of space to type out stories/poems on? Or do you know of any writing sites at all that I could post blogs on, sort of like having a whole website to myself?.

  7. Iron Kanabo

    Anyone know how to change the player’s initial starting position in the box? I’d like to have the character start a bit higher up.

  8. Iron Kanabo

    Also, is there a way to do “grey attacks,” or just have a message appear in the text box like in the Nabsterblook/Mettaton fights?

    1. Maly

      I’ve asked a similar question. As long as the assets (graphics, audio, story, text, etc) is completley your own creation…having the same battle mechanic as undertale is OK. Do not copy the attack patterns from undertale but make your own unique version

  9. Adrián

    I am unable to damage in battle. I have tried to change attack values and that kind of things, but it always make 0 points. What should I do?

  10. Salem Nightlark

    Are there any other mods in use? I would try running the mod solo if you are and see if it works then if it does then the load order may be at fault if it still doesn’t work then there’s an issue with the mod programming and may need to be adjusted

  11. Jason Micheals

    I have gotten everything to work up until and including the spareable. I just can’t complete the battle by actually sparing.


Leave a Reply

Your email address will not be published. Required fields are marked *