RMMV Script Calls PDF
RMMV Script Calls PDF
VXA Version:
https://docs.google.com/spreadsheets/d/1SPWPqSZ3I_LgilZse2I2sDPq-QyNQphb4T3i5aWMQic/edit?
Discussion Thread:
UPDATED (10/10/2019, GMT+8:30) usp=drive_web&ouid=112741546968112756440
If you have any suggestions, just go here.
- Updated Show Animation with better Instructions http://forums.rpgmakerweb.com/index.php?/topic/25759-script-call-collection-for-vxace/
https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mv-script-call-list.46456/
http://forums.rpgmakerweb.com/index.php?/topic/46456-rpg-maker-mv-script-call-list/&page=1
Event Page 1
Message
$gameMessage.setFaceImage('Actor1',0)
$gameMessage.setBackground(1)
Show Text
$gameMessage.setPositionType(1)
$gameMessage.add("Show Text Script Call")
choices = []; params = [];
$gameMessage.setChoices(choices, 0)
choices.push("I love you1");choices.push("I love you2");
Show Choices choices.push("I love you3");choices.push("I love you4");
choices.push("I love you5");choices.push("I love you6");
choices.push("I love you7");choices.push("I love you8");
params.push()
Input Number $gameMessage.setNumberInput(var, digits);
Select Key Item $gameMessage.setItemChoice(var, n); n = 1 for regular items, 2 for key items, 3 for Hidden A, 4 for Hidden B
$gameMessage.setScroll(scrolling_speed, no_fast_forward);
scrolling speed should be a number e.g. 2, fast_forward should be true or false
Show Scrolling Text $gameMessage.add("Text");
you need this line for each line of text individually
Party
Change Gold $gameParty.gainGold(n);
$gameParty.gainItem($dataItems[itemId], n);
Change Items
$gameParty.loseItem($dataItems[ID], amount);
Change Weapons $gameParty.gainItem($dataWeapons[weaponId], n, true/false *note); *note if decreasing, true will mean it will include already equipped weapons.
Change Armor $gameParty.gainItem($dataArmors[armorId], n, true/false *note); *note if decreasing, true will mean it will include already equipped armors.
$dataItems.forEach(function(item) {$gameParty.gainItem(item,99,false);});
Get All Items $dataArmors.forEach(function(armor){ $gameParty.gainItem(armor,99,false);});
$dataWeapons.forEach(function(weapon){ $gameParty.gainItem(weapon,99,false);});
$dataItems.forEach(function(item) {if (item && item.name) {$gameParty.gainItem(item,99,false);}});
Get All Items (unless the name is empty) $dataArmors.forEach(function(armor) {if (armor && armor.name) {$gameParty.gainItem(armor,99,false);}});
$dataWeapons.forEach(function(weapon) {if (weapon && weapon.name) {$gameParty.gainItem(weapon,99,false);}});
$gameParty.addActor(n);
Change Party Member To initialize: $gameActors.actor(actorId).setup(actorId);
$gameParty.removeActor(n);
Check Party Leader $gameParty.leader().actorId() == ID Replace ID with the ID of the actor you want to check.
Check Party Size $gameParty.members().length
Replace ACTORID with the ID of the actor you want to check
Check Party Index of a Character $gameParty.members().indexOf($gameActors.actor(ACTORID)) You can also use it like this: $gameParty.members().indexOf($gameActors.actor(1))
== 0
Game Progression
If you want to use in a condition's script condition with multiple switches to check:
Control Switches $gameSwitches.setValue(num, true/false); ($gameSwitches.value(1) == true) && ($gameSwitches.value(2) == true) &&
($gameSwitches.value(3) == true)
Example Randomized Variable Value:
Math.random()
It's from 0.0 to 1.0
// set variable 1 to an array of numbers
$gameVariables.setValue(1, [1, 2, 3]);
// Access variable 1, and index into the second element and set it to 10
$gameVariables.value(1)[1] = 10;
// print out variable 1, which is the array, which should now be [1, 10, 3]
console.log($gameVariables.value(1))
$gameMap._mapId
var key = [mapId, eventId, A-D]
Control Self Switch
$gameSelfSwitches.setValue(key, true); to check the current map id instead of manually inputting numbers.
Example:
var mapid = $gameMap._mapId;
var key = [mapid, 2, 'A'];
$gameSelfSwitches.setValue(key, true);
Flow Control
Conditional Branch if (code) { stuff } else { stuff }
Loop while (;;) { stuff }
Break Loop break;
Exit Event Processing $gameInterpreter._index = $gameInterpreter._list.length;
Exit Game SceneManager.exit();
$gameTemp.reserveCommonEvent(n);
Common Event
$gameTemp.clearCommonEvent(n);
Label
Jump to Label
// For Single Lines
// Is good for only a small chunk of code.
/* item */ is good if you want to batch comment.
Comment /* For
Multiple lines like this.
Not super useful for script calls though due to 210 line limit.
*/
Actor
Also allow using party member index: $gameParty.members()[index].gainHp(n)
Example Uses:
var m = $gameActors.actor(id)
-- Decrease Actor ID #1 by 70%
var d = damage
Change HP var m = $gameActors.actor(1)
var KO = true/false
var d = Math.round(-0.7*m.mhp)
Game_Interpreter.prototype.changeHp.call(this, m, d, KO);
var KO = true
Game_Interpreter.prototype.changeHp.call(this, m, d, KO);
$gameParty.members().forEach(function(m){
$gameParty.members().forEach(function(m){
m.gainHp(Math.round(1*(m.mhp)));
m.recoverAll();
m.gainMp(Math.round(1*(m.mmp)));
Recover All });
});
You can also use something like this for battle to include reserved members.
$gameParty.battleMembers().forEach(function(member){member.gainHp
(your_formula_here)})
Change EXP $gameActors.actor(actorId).gainExp(n); Negative n if you want the actor to lose Exp.
Change Level $gameActors.actor(actorId).changeLevel(n, true/false); n = level the actor will become. true/false to show level up.
Negative n if you wish the actor to lose stats. Params: 0-MaxHP, 1-MaxMP, 2-ATK, 3-
Change Parameters $gameActors.actor(actorId).addParam(paramId, n);
DEF, 4-MAT, 5-MDEF, 6-AGI, 7-LUK
$gameActors.actor(actorId).learnSkill(n);
Change Skill
$gameActors.actor(actorId).forgetSkill(n);
Add All Skills $dataSkills.forEach(function(skill){ if(skill) $gameParty.leader().learnSkill(skill.id);}); replace $gameParty.leader() with any other actor
Change Equipment $gameActors.actor(actorId).changeEquip(slotId, item); item = $dataWeapons[n] or $dataArmors[n]
If you want to change an Actor's name based on another Actor's name:
Change Name $gameActors.actor(actorId).setName(n)
$gameActors.actor(actorId).setName($gameActors.actor(actorId).name())
Change Class $gameActors.actor(actorId).changeClass(n, keepExp) keepExp is either true or false
Change Nickname $gameActors.actor(actorId).setNickname(n)
Change Profile $gameActors.actor(actorId).setProfile(n)
Event Page 2
Movement
direction = Down(2), Left(4), Right(6), Up(8)
Transfer Player $gamePlayer.reserveTransfer(mapId, x, y, direction, fade type);
fade type = 0-Black, 1-White, 2-None
Set Vehicle Location $gameMap.vehicle(vehicleId).setLocation(mapId, x, y); t
Set Event Location $gameMap.event(eventID).setPosition(x, y);
direction = Down(2), Left(4), Right(6), Up(8)
Set Event Direction $gameMap.event(eventID).setDirection(direction); Example:
$gameMap.event(this._eventId).setDirection(2)
Check Event Direction $gameMap.event(eventID).direction();
Set Player Location $gamePlayer.locate(x, y);
Set Player Direction $gamePlayer.setDirection(dir); direction = Down(2), Left(4), Right(6), Up(8)
Check Player Location $gamePlayer.pos(x, y)
Check Player Direction $gamePlayer.direction(); direction = Down(2), Left(4), Right(6), Up(8)
$gamePlayer.x;
Check Player Coordinates
$gamePlayer.y;
Set Follower Location $gamePlayer.followers().follower(index).setPosition(X, Y); Index starts at 0
Set Follower Direction $gamePlayer.followers().follower(index).setDirection(dir); direction = Down(2), Left(4), Right(6), Up(8)
$gamePlayer.followers().follower(index).x
Check Follower Coordinates Index starts at 0
$gamePlayer.followers().follower(index).y
Check Follower Direction $gamePlayer._followers.follower(index).direction();
Check Map ID $gameMap._mapId;
Scroll Map $gameMap.startScroll(direction, distance, speed); direction = Down(2), Left(4), Right(6), Up(8)
Example:
$gameScreen.startZoom($gamePlayer.screenX(), $gamePlayer.screenY(), 2.5, 60);
Instant Zoom:
Zoom $gameScreen.startZoom(x,y,zoom,wait);
$gameScreen.setZoom(x,y,zoom);
Clear Zoom
$gameScreen.clearZoom();
Change Player Camera Position $gamePlayer.center(x, y) replace x/y with map coordinates.
Change Map Camera $gameMap.setDisplayPos(x, y)
In rpg_objects.js look for the following:
Game_Character.prototype.processMoveCommand = function(command) {
Example:
Set Movement Route For Events: $gameMap.event(5).moveStraight(4);
$gameMap.event(id).command(x);
$gameMap.event(id)._moveType = x;
0 = Fixed, 1 = Random, 2 = Approach
$gameMap.event(id)._trigger = x;
0 = Action, 1 = Player Touch, 2 = Event Touch, 3 = Autorun, 4 = Parallel
//for this example "charEvent" is the event you want to move, but you can use $gameMap._events
var charEvent = $gameMap._events[id];
Set Movement Route (Default Pathfinding) Remember that default pathfinding has a limit
// THIS IS THE IMPORTANT LINE, of course you have to put real coordinates instead of x & y
charEvent.moveStraight( charEvent.findDirectionTo(x, y) );
Set Destination $gameTemp.setDestination(mapX, mapY)
Get ON/OFF Vehicle $gamePlayer.getOnOffVehicle();
Timing
Only one wait will work in a script call. It's because a script call runs everything at
Wait this.wait(frames) once within that block. The only way to work around with it is having a custom method
or set a timeout.
Character
Change Transparency $gamePlayer.setTransparent(flag) flag = true / false
Change Player Followers $gamePlayer.showFollowers(); $gamePlayer.hideFollowers(); Might need $gamePlayer.refresh();
Gather Followers $gamePlayer.gatherFollowers(); this.setWaitMode('gather');
Replace character with one of these:
- $gamePlayer;
- $gameMap.event(ID);
- For "This Event" $gameMap.event(this._eventId)
For Example:
var character = $gameMap.event(1);
var id = 1;
character.requestAnimation(id);
Replace character with one of these: $gamePlayer; $gameMap.event(ID);
Show Balloon Icon character.requestBalloon(id); this.setWaitMode('balloon');
For example: $gameMap.event(6).requestBalloon(3); this.setWaitMode('balloon');
Erase Event $gameMap.eraseEvent(this._eventId);
Screen
Fadeout Screen $gameScreen.startFadeOut(fade_speed); Default is 24
FadeIn Screen $gameScreen.startFadeIn(fade_speed); might want to call wait to go with it, by default the event command does
red,green,blue between -255 to 255, grey between 0 and 255, if you want wait for
Tint Screen $gameScreen.startTint([red,green,blue,grey], duration);
completion call the following $gameInterpreter.wait(duration);
All between 0 and 255, if you want wait for completion call the following
Flash Screen $gameScreen.startFlash([red, green, blue, intensity], duration);
$gameInterpreter.wait(duration);
Shake Screen $gameScreen.startShake(power, speed, duration); If you want wait for completion call the following $gameInterpreter.wait(duration);
Weather = "none","rain","storm","snow". If you want wait for completion call the
Set Weather Effect $gameScreen.changeWeather("weather", power, duration);
following $gameInterpreter.wait(duration);
Picture
$gameScreen.showPicture(pictureId, name, origin, x, y,
Show Picture
scaleX, scaleY, opacity, blendMode)
$gameScreen.movePicture(pictureId, origin, x, y, scaleX,
Move Picture
scaleY, opacity, blendMode, duration)
Picture Blend Mode $gameScreen._pictures[id]._blendMode = #
Rotate Picture $gameScreen.rotatePicture(pictureId, speed);
Tint Picture $gameScreen.tintPicture(pictureId, tone, duration);
Erase Picture $gameScreen.erasePicture(pictureId);
// Erase Pictures
for (var i = 1; i <= 100; ++i) {
Erase all displayed pictures
$gameScreen.erasePicture(i);
}
Audio & Video
Sound Object: { name: filename, volume: n, pitch: n, pan: n }
Play BGM AudioManager.playBgm( refer to sound object above );
Fadeout BGM AudioManager.fadeOutBgm(n);
Save BGM $gameSystem.saveBgm();
Replay BGM $gameSystem.replayBgm();
Play BGS AudioManager.playBgs( refer to sound object above );
Fadeout BGS AudioManager.fadeOutBgs(n);
Play ME AudioManager.playMe( refer to sound object above );
Play SE AudioManager.playSe( refer to sound object above );
Stop SE AudioManager.stopSe();
Play Movie Graphics.playVideo(path/name.ext);
Event Page 3
Scene Control
BattleManager.setup(troopId, true/false, true/false);
First true/false is for allowing to Escape, 2nd true/false is for allowing the player to
Battle Processing $gamePlayer.makeEncounterCount();
lose
SceneManager.push(Scene_Battle);
Shop Processing SceneManager.push(Scene_Shop);
SceneManager.push(Scene_Name);
Name Input Processing
SceneManager.prepareNextScene(actorId, name length);
Open Menu Screen SceneManager.push(Scene_Menu);
If you want to check if your game has any savefiles at all:
DataManager.isAnySavefileExists()
Open Save Screen SceneManager.push(Scene_Save);
Useful for custom title screens that are evented.
Open Load Screen SceneManager.push(Scene_Load);
$gameSystem.onBeforeSave();
if (DataManager.saveGame(index)) { Replace index with the save file you want. e.g. StorageManager.remove(1);
Create Save File or for Loading use below. (Warning might cause page error if versionId is not working
StorageManager.cleanBackup(index);
} properly.)
StorageManager.removeAllStorage = function() {
for (var i = 0; i < 20; i++) {
A simple script call where it loops to delete 20 save files: this.remove(i);
}
var i; };
Delete all Save Files
for (i = 0; i < 20; i++) { and script call will be:
StorageManager.remove(i);
} StorageManager.removeAllStorage();
There is no way out of the box to know the maximum file size MV has since it's
hardcoded. You could change the 20 to like a plugin parameter if you have a plugin
that changes the max amount though.
Check if any Save File exists DataManager.isAnySavefileExists() returns true/fase
Check if a Save File exists StorageManager.exists(id) id = save file slot. Starting from 1.
Game Over SceneManager.goto(Scene_Gameover);
Return to Title Screen SceneManager.goto(Scene_Title);
You can also in theory do something like this:
$gameMap.event(ID).copyPosition({_x: 0, _y: 0, _realX: 100, _realY: 100, _direction:
8});
$gameMap.event(ID).copyPosition($gameMap.event(ID));
Copy Position of the Player/Event/Object
Basically it means you can make a variable and set it to that object and have events
clone that. So if it changes everything is cloning from the same place. At least in
terms of position.
Copy just the direction of the Player/Event/Object $gameMap.event(ID).setDirection($gameMap.event(ID).direction())
You can either use it as the following:
$gameMap.event(8).start();
$gameMap.event(EventID, EventPage).start();
Call Event
(or use this instead since this is more complicated: http://yanfly.moe/2016/06/24/yep-110-call-event-rpg-maker-mv/)
For a specific page:
$gameMap.event(8,3).start();
Map
$gameMap.enableNameDisplay();
Change Map Name Display
$gameMap.disableNameDisplay();
Change Tileset $gameMap.changeTileset(n);
Change Tileset Z Value $dataMap.data[(Z * $dataMap.height + Y) * $dataMap.width + X] = TILEID; Used to change a tile in coordonate X,Y with (TILEID) on the layer Z!
Change Battleback $gameMap.changeBattleback(filename, filename);
Change Parallax $gameMap.changeParallax(name, loopX, loopY, speed x, speed y);
$gameMap.terrainTag(x, y);
Get Location Info $gameMap.eventIdXy(x, y);
$gameMap.tileId(x, y, layer);
$gamePlayer.regionId()
Get Region for Player and Events Set x and y to the x, y of the player/event
$gameMap.regionId(x, y);
System Settings
Change Battle BGM $gameSystem.setBattleBgm(name);
Change Victory ME $gameSystem.setVictoryMe(name);
Change Defeat ME $gameSystem.setDefeatMe(name);
Change Vehicle BGM $gameMap.vehicle(vehicleId).setBgm(name);
$gameSystem.disableSave();
Change Save Access
$gameSystem.enableSave();
$gameSystem.disableMenu();
Change Menu Access
$gameSystem.enableMenu();
$gameSystem.disableEncounter();
Change Encounter
$gameSystem.enableEncounter();
$gameSystem.disableFormation();
Change Formation Access
$gameSystem.enableFormation();
Change Window Color $gameSystem.setWindowTone(tone); (red, green, blue, gray);
$gameActors.actor(actorId).setCharacterImage("name", index);
$gameActors.actor(actorId).setFaceImage("name", index):
Change Actor Images Might need $gamePlayer.refresh();
$gameActors.actor(actorId).setBattlerImage("name");
Battle
Use negative n if you want the enemy to lose HP.
Example:
var m = $gameTroop.members()[ID]
var d = damage
Change Enemy HP Kill an enemy immediately:
var KO = true/false
var m = $gameTroop.members()[0]
Game_Interpreter.prototype.changeHp.call(this, m, d, KO);
var d = Math.round(-m.mhp)
var KO = true
Game_Interpreter.prototype.changeHp.call(this, m, d, KO);
Change Enemy MP $gameTroop.members()[enemyIndex].gainMp(n); Use negative n if you want the enemy to lose MP.
Change Enemy TP $gameTroop.members()[enemyIndex].gainTp(n); Use negative n if you want the enemy to lose TP.
$gameTroop.members()[enemyIndex].addState(n);
Change Enemy State
$gameTroop.members()[enemyIndex].removeState(n);
Enemy Recover All $gameTroop.members()[enemyIndex].recoverAll();
Enemy Appear $gameTroop.members()[enemyIndex].appear();
Enemy Transform $gameTroop.members()[enemyIndex].transform(n); n is the enemy ID you want the enemy to transform into.
Show Battle Animation $gameTroop.members()[enemyIndex].startAnimation(animationId, true/false, delayN); true/false is for mirror. delayN is for the frames to delay the animation.
$gameParty.members()[index].forceAction(skillId, targetIndex);
BattleManager.forceAction($gameParty.members()[index]);
Force Action TargetIndex= "-1" for random and "-2" for last target.
$gameTroop.members()[index].forceAction(skillId, targetIndex);
BattleManager.forceAction($gameTroop.members()[index]);
Abort Battle BattleManager.abort();
Advanced
var aliasPluginCommand = Game_Interpreter.prototype.pluginCommand;
Actor Stats
HP $gameActors.actor(actorId).hp
MaxHP $gameActors.actor(actorId).mhp
MP $gameActors.actor(actorId).mp
MaxMP $gameActors.actor(actorId).mmp
ATK $gameActors.actor(actorId).param[2]
DEF $gameActors.actor(actorId).param[3]
MAT $gameActors.actor(actorId).param[4]
MDF $gameActors.actor(actorId).param[5]
AGI $gameActors.actor(actorId).param[6]
LUK $gameActors.actor(actorId).param[7]
You can also check for multiple skills. Example:
var a = Actor ID
$gameActors.actor(1).skills().contains($dataSkills[14,15,16]);
Check if an Actor have X Skill var b = Skill ID
$gameActors.actor(a).skills().contains($dataSkills[b]);
This will check if character has skills 14, 15, 16
# Check for Name/ID of Player Equipment
# ----------------------------------------------
$game_actors[X].equips[Y].id unless $game_actors[X].
equips[Y] == nil
# Returns the ID of the equipment on actor X, equipped in
slot Y
# Checking Actors
# ----------------------------------------------
$game_actors[X].name # Returns the name of the actor X
$game_actors[X].nickname # Returns the nickname of the $gameActors.actor(actorId).name()
actor X $gameActors.actor(actorId).nickname()
$game_actors[X].class.id # Returns the ID of the actor X $gameActors.actor(actorId).currentClass().id
class $gameActors.actor(actorId).currentClass().name
$game_actors[X].class.name # Returns the name of the
actor X class
# Screen Clean Up
# ----------------------------------------------
# Clear Fade
# Clear Tone
# Clear Flash
# Clear Shake $gameScreen.clear();
# Clear Weather
# Clear Pictures $gameScreen.clearTone();
$game_map.screen.clear
$gameScreen.clearFlash();
# Clear Tone (Immediate)
$game_map.screen.clear_tone $gameScreen.clearShake();
(Input.isTriggered('ok'))
(Input.isRepeated(ok'))
(Input.isPressed('ok'))
Input.trigger?(:A)
(Input.isLongPressed('ok'))
Input.repeat?(:A)
Input.press?(:A)
(TouchInput.isTriggered())
# Change A to your desired key, refer to F1 when you
(TouchInput.isRepeated())
testplay and see the keys.
(TouchInput.isPressed())
(TouchInput.isLongPressed())
Please Include Touch Input and such.
(TouchInput.isCancelled())
(TouchInput.isMoved())
(TouchInput.isReleased())
Movement Commands
$game_player.moving?
$game_player.dash?
$game_player.jumping?
$game_map.events[event_id].moving?
$game_map.events[event_id].jumping?
$game_map.passable?(X, Y, D)
$game_player.passable?(x, y, d)
$game_map.events[event_id].passable?(x, y, d)
# ----------------------------------------------
# Follower Move Route Option
# ----------------------------------------------
$game_player.followers[n].force_move_route(move_route)
# For Followers (0 for first after actor, 1 for second after
actor, etc.)
# To get the items. Replace the index in equips for the item
you're looking for:
# 0 = right hand, 1 = left hand, 2 = head, 3 = body, 4 =
accessory
# provided you're not using any scripts that change that.
You can check their types with:
if right_hand.is_a?(RPG::Weapon)
# do something
elsif right_hand.is_a?(RPG::Armor)
# do something else
end
$gameActors.actor(actor_id).equips()[slot_id] == null;
*change null to id
# Or get their properties with with:
right_hand.id
right_hand.name
right_hand.icon_index
right_hand.description
# etc..
# You don't even need to keep track of the IDs, really (unless
you want to, for some reason).
# If there's no way to not have a weapon equipped in your
game, you can also take out the ".nil?" check.
# or:
y = SceneManager.scene.log_window
y.add_text(text)
# ----------------------------------------------
# Follower Move Route Option
# ----------------------------------------------
$game_player.followers[n].force_move_route(move_route)
# For Followers (0 for first after actor, 1 for second after
actor, etc.)
$game_player.center($game_player.x, $game_player.y)
You can set an event or the player to be in the center of the $gamePlayer.center($gamePlayer.x, $gamePlayer.y)
screen. It snaps but it's pretty good :D!
$gameSystem.onBeforeSave();
DataManager.save_game(0)SceneManager.goto(Scene_Map) DataManager.saveGame(id);
SceneManager.goto(Scene_Map);
UPDATED: 9/24/2019
http://forums.rpgmakerweb.com/index.php?/topic/25759-script-call-collection-for-vxace/
- Added Check if Alive Party Member have x state
Troops
Use one of the scripts call inside a conditional branch. This helps you avoid Force
Check if Enemies are Alive $gameTroop.aliveMembers().length > 0
Action Issues.
Use one of the scripts call inside a conditional branch. This helps you avoid Force
Check if Party Members are Alive $gameParty.aliveMembers().length > 0
Action Issues.
Check if an Enemy Unit is still Alive. $gameTroop.members()[ID].isDead() Replace ID with the enemy troop # you want. Remember it goes 0-7.
Check if an actor has x state $gameActors.actor(x).isStateAffected(x)
This check if alive party members have state #5
$gameTroop.aliveMembers().every(function(member) { return member.
Check if Alive Party Members have x state $gameTroop.aliveMembers().every(function(member) { return member.isStateAffected(stateID) })
isStateAffected(5) })
Basic Variables
a The actor doing the current action.
b The target of said action.
v The damage formula equivalent of variables.
also p
Variable
Example Use:
[variableid, variableid, variableid].some(function(id) { return $gameVariable.value(id) ===
[121, 122, 123, 124, 125, 126, 127].some(function(id){ return $gameVariables.value(id) === 1})
Check a range of variables if some of them has x value value}){
This means that from Variables 121 - 127, it will check if one or more of them has the value of 1.
Example Use:
[variableid, variableid, variableid].every(function(id) { return $gameVariable.value(id) === [121, 122, 123, 124, 125, 126, 127].every(function(id){ return $gameVariables.value(id) === 1})
Check if a range of variables has x value
value}){
This means that from Variables 121 - 127, it will check if they have the value of 1.
Map Events
Calculate Distance $gameVariables.setValue(VarID, ($gamePlayer.x - $gameMap.event(ID).x));
(Not Using Absolute) $gameVariables.setValue(VarID, ($gamePlayer.y - $gameMap.event(ID).y));
Flush Image Cache ImageManager.clear()
$gameVariables.setValue(17, $gamePlayer.characterName());
$gameVariables.setValue(18, $gamePlayer.characterIndex()); To restore image:
Make only the leader invisible
$gamePlayer.setImage($gameVariables.value(17), $gameVariables.value(18));
$gamePlayer.setImage('', index)
Player go slower, but not slower than 3 $gamePlayer._moveSpeed = Math.max(3, $gamePlayer._moveSpeed - 1);
Player go faster, but not faster than 5 $gamePlayer._moveSpeed = Math.min(5, $gamePlayer._moveSpeed + 1);
Utility
Forcibly Stop Messages SceneManager._scene._messageWindow.terminateMessage();
End Event Processing $gameMap._interpreter.command115(); You can theoretically replace command115 to other event commands seen in rpg_objects.js
Game_Character.ROUTE_END = 0; Script Call
In rpg_objects.js look for the following:
Game_Character.prototype.processMoveCommand = function(command) {
$gameMap.event(id)._trigger = x;
Game_Character.ROUTE_MOVE_DOWN = 1; 0 = Action, 1 = Player Touch, 2 = Event Touch, 3 = Autorun, 4 = Parallel
var cMove = { code: Game_Character.ROUTE_MOVE_RANDOM, parameters: [] };
var cEnd = { code: Game_Character.ROUTE_END, parameters: [] };
var cList = [cMove, cEnd];
var route = { list: cList, repeat: false, skippable: false };
this._character = youreventID;
this._character.forceMoveRoute(route);
Game_Character.ROUTE_MOVE_LEFT = 2; this.setWaitMode('route');
Game_Character.ROUTE_MOVE_RIGHT = 3;
Game_Character.ROUTE_MOVE_UP = 4;
Game_Character.ROUTE_MOVE_LOWER_L = 5;
Game_Character.ROUTE_MOVE_LOWER_R = 6;
Game_Character.ROUTE_MOVE_UPPER_L = 7;
Game_Character.ROUTE_MOVE_UPPER_R = 8;
Game_Character.ROUTE_MOVE_RANDOM = 9;
Game_Character.ROUTE_MOVE_TOWARD = 10;
Game_Character.ROUTE_MOVE_AWAY = 11;
Game_Character.ROUTE_MOVE_FORWARD = 12;
Game_Character.ROUTE_MOVE_BACKWARD = 13;
Game_Character.ROUTE_JUMP = 14;
Game_Character.ROUTE_WAIT = 15;
Game_Character.ROUTE_TURN_DOWN = 16;
Game_Character.ROUTE_TURN_LEFT = 17;
Game_Character.ROUTE_TURN_RIGHT = 18;
Game_Character.ROUTE_TURN_UP = 19;
Game_Character.ROUTE_TURN_90D_R = 20;
Game_Character.ROUTE_TURN_90D_L = 21;
Game_Character.ROUTE_TURN_180D = 22;
Game_Character.ROUTE_TURN_90D_R_L = 23;
Game_Character.ROUTE_TURN_RANDOM = 24;
Game_Character.ROUTE_TURN_TOWARD = 25;
Game_Character.ROUTE_TURN_AWAY = 26;
Game_Character.ROUTE_SWITCH_ON = 27;
Game_Character.ROUTE_SWITCH_OFF = 28;
Game_Character.ROUTE_CHANGE_SPEED = 29;
Game_Character.ROUTE_CHANGE_FREQ = 30;
Game_Character.ROUTE_WALK_ANIME_ON = 31;
Game_Character.ROUTE_WALK_ANIME_OFF = 32;
Game_Character.ROUTE_STEP_ANIME_ON = 33;
Game_Character.ROUTE_STEP_ANIME_OFF = 34;
Game_Character.ROUTE_DIR_FIX_ON = 35;
Game_Character.ROUTE_DIR_FIX_OFF = 36;
Game_Character.ROUTE_THROUGH_ON = 37;
Game_Character.ROUTE_THROUGH_OFF = 38;
Game_Character.ROUTE_TRANSPARENT_ON = 39;
Game_Character.ROUTE_TRANSPARENT_OFF = 40;
Game_Character.ROUTE_CHANGE_IMAGE = 41;
Game_Character.ROUTE_CHANGE_OPACITY = 42;
Game_Character.ROUTE_CHANGE_BLEND_MODE = 43;
Game_Character.ROUTE_PLAY_SE = 44;
Game_Character.ROUTE_SCRIPT = 45;