MoonFlower

Introduction

This plugin allows you to create ECS (Event Command Scripts), which allow you to mimic

RPGMakerMV event commands through text files containing a set of typed commands.

These commands can be loaded into the game and used like regular MV events

and common events.

From now on they’ll be known as (ECS) Event Command Scripts.

Indentation

Indentation is important when setting up conditional branches.

Indenting by 1 is 4 spaces. Use this when setting up your conditionals.

You can find some examples of this below:

Examples

Here’s an example of a basic script:

comment: This is a comment line cml: This is line 2 of my comment showText: , 2, Window, Bottom text: Hello World this is line 1 of my show text command. script: console.log("Hello World"); changeGold: Direct, 2000 changeGold: Direct, -50 changeItems: 1, Direct, 10 changePartyMem: 1, Add, false :end:

Basic if & Indentation

if: Script, $gameVariables.value(1) === 0 showText: None, None, Window, Bottom text: This is a conditional check. :end:

Simple Dialogue with special commands

//Creates new characters inside the interpreter character: Zack, Actor2, \C[1]Zack\C[0] character: Sam, Actor1, \C[3]Sam\C[0] # Sets up a new conversation conversation: Window, Bottom, Actor1 Zack[0]: How are you doing today? Sam[1]: I'm doing well Zack, thanks. :endConversation: :end:

To help people understand use this new language, I’ve created a scripting reference below to help with learning.

MoonFlower Scripting Reference

Syntax

The syntax of a command takes on the following form on most occassions:

commandName: parameter1, parameter 2, parameter 3, parameter 4

Here’s an example of creating a show text command in the language.

showText: , None, Window, Bottom text: Hello world! text: Line 2 of my show text command. :end:

Commands

Show Text

Creates a show text command for your text information.

showText: ImageName, None, BackgroundType(Window, Dim, Transparent), PositionType(Bottom, Middle, Top)

showText: None, None, Window, Bottom

Text

text: text string

text: Hello World!

Show Choice

Creates a show choice dialog box that you can enter information into

showChoices: Choice1, Choice2, Choice3,... | cancelChoice, defaultChoice, PositionType, backgroundType

showChoices: Yes, No, Maybe | 2, 1, Left, Window showChoices: Yes, No, Maybe | Disallow, None, Right, Transparent

Comment

comment: comment string

comment: This is an RPGMakerMV comment

Conditional Branch

Creates a conditional branch in the code langauge.

Conditional branches are different based on their type, so please

look carefully at the examples.

if: Type,

//Switch if: Switch, SwitchID, onOff if: Switch, 1, On or if: Switch, 1, Off //Self Switch if: SelfSwitch, SelfSwitchLetter, onOff if: SelfSwitch, A, On //Checks if self switch A is on if: SelfSwitch, A, Off //Check if self switch A is off // Variables if: Variable, VariableID, Constant/Variable, Constant/VariableID, Operator if: Variable, 1, Constant, 4, >= //Check if Variable1 is greater than or equal to 4 if: Variable, 1, Variable, 4 >= //Check if Variable1 is greather than or equal to Variable4. //Timer if: Timer, seconds, operator //operator can be: >=, <=, //Actor if: Actor, 1, Condition, Value // Condition can be: InParty, Name, Class, Skill, Weapon, Armor, State. Value: can be a string or number. if Name it's a string, otherwise a number. if: Actor, 1, Name, Tom //Check if Actor 1's name is Tom if: Actor, 1, InParty //Check if actor1 is in party if: Actor, 1, Weapon, 3 //Actor 1 has weapon 3 equipped. //Enemy if: Enemy, 1, State, 1 //Enemy, TroopID, State or Appeared, if state StateID //Character if: Character, Up //Character, direction(Up, Left, Down, Right) //Gold if: Gold, >=, amount if: Gold, <=, amount if: Gold, <, amount //Item if: Item, 1 //Party has item 1 in their inventory //Weapon if: Weapon, 1, true //Party has weapon 1 in inventory, including equipped weapons //Armor if: Armor, 1, true //Party has armor 1 in inventory, inlcluding equipped armor //Button if: Button, up //If button up is pressed //Script if: Script, $gameVariables.value(1) === 0 //Vehicle if: Vehicle, Ship //Returns true if the player is riding in a ship

Else Branch

Creates an else branch in the code.

else:

else: showText: None, None, Window, Bottom text: Hello World! :end:

Loop

Creates a loop in the code.

loop:

loop: showText: None, None, Window, Bottom text: Hello World! repeatAbove:

Repeat Above

Repeats the above commands in the loop (necessary).

repeatAbove:

repeatAbove: or rabove:

Break Loop

Breaks out of the loop.

breakLoop:

breakLoop: or break:

Wait

Waits a certain amount of frames in game.

wait: frames

wait: 60

Show Balloon

Shows a balloon over the specified character’s head.

showBalloon: eventID(player -1, this event 0, eventID), BalloonID, wait

showBalloon: -1, 2, false or showBalloon: 0, 1, true or showBalloon: 3, 1, true

Fade In Screen

Fades in the game screen.

fadeInScreen:

`fadeInScreen:`

Fade Out Screen

Fades out the game screen.

fadeOutScreen:

fadeOutScreen:

Tint Screen

Tints the screen with the specified red, green, blue, and grey values.

Red, green, blue, and grey all range from (-255 to 255).

tintScreen: red, green, blue, grey, duration(frames), wait

tintScreen: 68, 68, 68, 68, 30, true

Show Picture

Shows a picture on the game screen.

showPic: imageID, imageName, Origin(Left, Center), Direct/Variable, x, y, width%, height%, Blend Opacity(cap 255), BlendMode(normal, add, mul, screen

showPic: 1, Translucent, Left, Direct, 200, 200, 100, 100, 255, Normal

Rotate Picture

Rotates the picture at a certain speed for a duration.

rotatePicture: pictureID, rotationSpeed (max90)

rotatePicture: 1, 90

Erase Picture

Erases a picture from the screen.

erasePic: pictureID

erasePicture: 1

Set Weather Effect

Sets the weather effect in your game.

setWeatherEffect: weatherType, power(caps at 9), duration(frames), wait for completion

setWeatherEffect: rain, 5, 60, true or setWeather: snow, 5, 60, false

Input Number

Starts an input number command.

inputNumber: variableID, max Digits( max is 8)

inputNumber: 1, 8

Common Event

Runs a common event inside of RPGMakerMV.

cmmnE: commonEventID

cmmnEvent: commonEventID

commonEvent: commonEventID

commonEvent: 1 or cmmnE: 2 or cmmnEvent: 3

Control Timer

Controls the in game timer for a set period of time.

controlTimer: Start/Stop, seconds

controlTimer: Start, 200 //Starts the timer to tick down for 200 seconds or controlTimer: Stop, 0 //Stops the timer

Show Animation

Shows an animation on the player or an event in the game.

showAnim: number, animationID, wait

showAnim: 1, 3, true // Show animation 3 on event 1 and wait for completion. or showAnim: -1, 3, false //Show animation 3 on the player and don't wait for completion.

Change Window Color

Changes the window color in game.

changeWindowColor: red, green, blue, alpha

changeWindowColor: 255, 255, 255, 0

Change Gold

Changes the gold currently in the player possession.

changeGold: Direct/Variable, amount

changeGold: Direct, 2000 // Adds 2000 gold to the player inventory or changeGold: Variable, 1 // changes gold amount based on game variable 1

Change Items

Changes the items in the player inventory.

changeItems: ItemID, Direct, amount

changeItems: 1, Direct, 3 //Adds 3 of game item 1 to player inventory. or changeItems: 2, Direct, -3 //Removes 3 of game item 2 from player inventory.

Change Weapon

Changes the weapons in the player inventory

changeWeapons: equipID, Direct/Variable, amount, include removing equipment from actors

changeWeapons: 1, Direct, 3, false //Add 3 weapon 1 from the database to player inventory. or changeWeapons: 2, Variable, 3, true //Remove weapon 2 from player inventory based on variable 3.

Change Armor

Changes the armor in the player inventory.

changeArmor: equipID, Direct/Variable, amount, include removing equipment from actors

changeArmor: 1, Direct, 3, false //Add 3 armor 1 from the database to play inventory. or changeArmor 2, Variable, 3, true //Remove armor 2 in database based on variable 3.

Change Party Member

Changes a party member in the game.

changePartyMem: actorID, Add/Remove, Initialize

changePartyMem: 1, Add, false or changePartyMem: 2, Remove, true

Change Battle BGM

Changes the battle background music.

changeBattleBGM: bgmName, volume, pitch (50, 150), pan(-100, 100)

changeBattleBGM: Theme1, 20, 50, 120, 0

Change Vehicle BGM

Changes the vehicle background music.

changeVehicleBGM: vehicleType, bgmName, volume, pitch (50, 150), pan(-100, 100)

changeVehicleBGM: Boat, Theme3, 100, 100, 0 or changeVehicleBGM: Ship, Theme3, 100, 60, -80 or changeVehicleBGM: Airship, Theme2, 100, 80, 120

Change Victory Musical Effect

Changes the victory musical effect.

changeVictoryME: meName, volume, pitch (50, 150), pan(-100, 100)

changeVictoryME: Victory 1, 100, 100, 0

Change Defeat Musical Effect

Changes the defeat musical effect.

changeDefeatME: meName, volume, pitch (50, 150), pan(-100, 100)

changeDefeatME: ME1, 100, 100, -20

Change Formation Access

Enables or disables accessing of the formation menu.

changeFormAcc: On/Off or Enable/Disable

changeFormAcc: On or changeFormAcc: Off or changeFormAcc: Enable or changeFormAcc: Disable

Change Save Access

Enables or disables accessing of the save menu.

changeSaveAcc: On/Off or Enable/Disable

changeSaveAcc: On or changeSaveAcc: Off or changeSaveAcc: Enable or changeSaveAcc: Disable

Change Menu Access

Enables or disables accessing of the main menu.

changeMenuAcc: On/Off or Enable/Disable

changeMenuAcc: On or changeMenuAcc: Off or changeMenuAcc: Enable or changeMenuAcc: Disable

Change Encounter Disable

Disables the encounters temporarily or reenables them.

changeEncDisable: On/Off or Enable/Disable

changeEncDisable: On or changeEncDisable: Off or changeEncDisable: Enable or changeEncDisable: Disable

Scroll Map

Scrolls the map from it’s current position.

scrollMap: Direction, Distance, Speed(1 slowest to 6 fastest)

scrollMap: Left, 3, 4 //normal speed. scrollMap: Down, 3, 6 //Super fast.

Set Movement Route

Creates a movement route for the specified character.

setMoveRoute: characterID, repeat, skippable, wait

characterID: -1 (player), 0(this event), 1 or higher(eventID)

setMoveRoute: -1, false, true, true // Creates a move route that will move the player without repeating the movement.

Move

Follows a set movement route command and decides on the move.

move: moveType parameters...

move: down //Moves the character down. move: left //Moves left. move: right //Moves right. move: up // Moves up. move: lowerLeft //Moves lower left (diagonally). move: lowerRight //Moves lower right (diagonally). move: upperLeft //Moves upper left (diagonally). move: upperRight //Moves upper right (diagonally). move: random //Moves randomly. move: toward //Moves toward the player. move: away //Moves away from the player. move: forward //Moves forward. move: backward //Moves backward. move: jump, x, y //Has the character jump. move: wait frames //Has the character wait in frames. move: turnDown // Turns down. move: turnLeft // Turns left. move: turnRight //Turns right. move: turnUp //Turns up. move: turn90DGR //Turns 90 degrees to the right. move: turn90DGL //Turns 90 degrees to the left. move: turn180DG //Turns 180 degrees. move: turnDGRL //Turns 90 degrees left or right. move: turnRandom //Turns in a random diection. move: turnToward //Turns toward the player. move: turnAway //Turns away from the player. move: switchOn, id //Turns the specified switch ID on. move: switchOff, id //Turns the specified switch ID off. move: changeSpeed, speedID //Changes the speed -- slowest to fastest (1-6) to the specified number. move: changeFreq freqID //Changes the movement frequency (1-5) slowest to fastest. move: walkAnimOn //Turns the walk animation on. move: walkAnimOff //Turns the walk animation off. move: stepAnimOn //Turns the stepping animation on. move: stepAnimOff //Turns the stepping animation off. move: directionFixOn //Turns the direction fix on. move: directionFixOff //Turns the direction fix off. move: throughOn //Turns through on. move: throughOff //Turns through off. move: transparentOn //Turns the character transparent. move: transparentOff //Turns the character visible. move: changeImage, ImageName //Changes the character to the specified imageName. move: changeOpacity number //Adjusts the character's opacity to the specified number (0-255). move: changeBlendMode blendID //Adjusts the character's blend mode to the specified number. Normal(0), Add (1), Multiply (2), Screen, (3). move: playSE SEName, volume, pitch, pan //Plays a sound effect with the given values. move: script, Script Contents //Runs the specified script call. move: end //Ends the move route

Erase Event

Erases the current event.

eraseEvent:

eraseEvent:

Change Transparency

Turns to the main character transparent.

changeTransparency: On/off

changeTrasparency: On or changeTransparency: Off

Change Followers

Enable or disables followers from appearing.

changeFollowers: On/Off

changeFollowers: On or changeFollowers: Off

Gather Followers

Gathers up the players followers.

gatherFollowers:

gatherFollowers:

Fade Out BGM

fadeOutBGM: seconds

fadeOutBGM: 10

Replay BGM

Replays the currrent playing BGM.

replayBGM:

`replayBGM: `

Save Background Music

Saves the background music to be replayed later.

saveBGM:

saveBGM:

Play Background Sound

playBGS: bgsName, volume, pitch, pan(-100, 100)

playBGS: rain, 100, 100, 0

Fade Out Background Sound

Fades out the background sound.

fadeoOutBGS: seconds

fadeOutBGS: 20

Play Musical Effect

playME: meName, volume, pitch, pan(-100, 100)

playME: Spark, 100, 100, 0

play Sound Effect

playSE: seName, volume, pitch, pan(-100, 100)

playSE: Bark, 100, 100, 0

Stop Sound Effect

Stops any playing sound effect.

stopSE:

stopSE:

Play Movie

Plays a movie file.

playMovie: MovieFileName

playMovie: MyTitleMovie

Change Map Name

Disables the map name display box on moving into a map.

changeMapName: Enable/Disable

changeMapName: Enable or changeMapName: Disable

Change Tileset

Changes the tilset to match the tileset id.

changeTileset: tilesetID

changeTileset: 3

Change BattleBack

Changes the battle back of the current map.

changeBattleback: BattleBack1Name, BattleBack2Name

changeBattleBack: Castl3, Castle2

Name Input

Starts a name input window on the scene.

nameInput: actorID, max characters (caps at 16)

nameInput: 1, 16

Change HP

Changes the HP of the specified actor or the entire party.

changeHP: Direct/Variable, ID, Direct/Variable, ID/Value, allowKnockOut

changeHP: Direct, 1, Direct, 200, false //Adds 200 HP to actor 1 changeHP: Direct, 0, Direct, 400, false //Adds 200 HP to the entire party changeHP: Direct, 0, Variable, 3, false //Adds variable 3 value to the entire party's HP changeHP: Variable, 1, Variable, 3, false //Uses variable 1 to substitute for an actor ID, then adds variable 3 value to the actor HP changeHP: Direct, 1, Direct, -99999, true //Takes away 99999 hp from actor 1 and will kill him.

Change MP

Changes the MP of the specified actor or the entire party.

changeMP: Direct/Variable, ID, Direct/Variable, ID/Value

changeMP: Direct, 1, Direct, 200 //Adds 200 MP to actor 1 changeMP: Direct, 0, Direct, 400 //Adds 200 MP to the entire party changeMP: Direct, 0, Variable, 3 //Adds variable 3 value to the entire party's MP changeMP: Variable, 1, Variable, 3//Uses variable 1 to substitute for an actor ID, then adds variable 3 value to the actor MP changeMP: Direct, 1, Direct, -99999 //Takes away 99999 MP from actor 1

Change TP

Changes the TP of the specified actor or the entire party.

changeTP: Direct/Variable, ID, Direct/Variable, ID/Value

changeTP: Direct, 1, Direct, 200 //Adds 200 TP to actor 1 changeTP: Direct, 0, Direct, 400 //Adds 200 TP to the entire party changeTP: Direct, 0, Variable, 3 //Adds variable 3 value to the entire party's TP changeTP: Variable, 1, Variable, 3//Uses variable 1 to substitute for an actor ID, then adds variable 3 value to the actor TP changeTP: Direct, 1, Direct, -99999 //Takes away 99999 MP from actor 1

Change Name

Changes the name of the specified actor.

changeName: actorID, actor name

changeName: 1, Tim

Change Nickname

changeNickname: actorID, actor nickname

changeNickname: 1, My new actor nickname

Change Equip

changeEquip: ActorID, EquipSlotType, equipID

changeEquip: 1, Head, 1 //Equips armor 1 on equip ID.

Change Actor Image

Changes the specified actor’s images based on the entered parameters.

changeActorImage: actorID, Walk Sprite, WalkSpriteIndex, FaceImage, FaceIndex, BattlerImage

changeActorImage: 1, Actor1, 0, Actor1, 0, Actor1_1

Change Vehicle Image

Changes the specified vehicle image of the select vehicle.

changeVehicleImage: VehicleType, VehicleImage, VehicleImageIndex

changeVehicleImage: Boat, Vehicle, 1 or changeVehicleImage: Ship, Vehicle, 2 or changeVehicleImage: Airship, Vehicle, 3

Change Profile

changeProfile: actorID, profileText

changeProfile: 1, This is my profile description.

abortBattle

Aborts a battle.

abortBattle:

Open Save Menu

Opens the save menu.

openSave:

Open Menu

Opens the main menu.

openMenu:

Game Over

Triggers a game over event.

gameOver:

Return To Title

Returns to the title screen.

returnToTitle:

Script Call

Performs a script call.

script: console.log("Hello World");

Script Line

Added after a script call command if it spawns multiple lines.

scrl: Line 2 of a script call.

Plugin Command

Runs a plugin command.

pCommand: mfRun 1 or pluginCommand: mfRun 1

Custom Commands

Kill party

Kills the entire game party.

killParty:

Character

Creates a character for a dialoge/conversation sequence.

When the character name is used, it will be replaced with a

macro. This is case sensitive.

character: Name, FaceImage, Macro

character: Zack, Actor1, \C[1]Zack\C[0] //Zack's name will be replaced \C[1]Zack\C[0] in text strings.

Conversation

Creates a conversation object for long streams of dialogue.

conversation: WindowType, PositionType, FaceImageName(optional)

conversation: Window, Bottom

Example Conversation

character: Zack, Left, \C[1]Zack\C[0] character: Sam, Left, \C[3]Sam\C[0] conversation: Window, Bottom, Actor1 Zack[0]: How are you doing today? Sam[1]: I'm doing well Zack, thanks. :endConversation:

Say Command

Used in a conversation object for displaying a character

that was created for the string. This only works in text

strings.

Name[faceIndex]: text string