You are on page 1of 4

NAME SCRIPT CALL COMMENT

VXA Version:
https://docs.google.com/spreadsheets/d/1SPWPqSZ3I_LgilZse2I2sDPq-QyNQphb4T3i5aWMQic/edit?
UPDATED (04/23/2021, GMT+8:30) Discussion Thread:
usp=drive_web&ouid=112741546968112756440
- Updated Show Choices If you have any suggestions, just go here. This thread is being maintained by Archeia.
http://forums.rpgmakerweb.com/index.php?/topic/25759-script-call-collection-for-vxace/
- Reformatting Spreadsheet 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")
defaultType = The default choice that is selected when you press cancel button.

cancelType:
0 = If you cancel, First Choice will be automatically selected.
-1 = Disallow Cancelling
-2 = Show Cancel Button

If you wish to replace the Variable, just replace variableIndex =


$gameVariables.setValue(variableIndex, n);

Background:
0 = Window
1 = Dim
// Initialize Choices Array
2 = Transparent
const choices = ["choice1", "choice2", "choice3", "choice4", "choice5", "choice6", "choice7", "choice8"];
// Set Message Choices
Position Type:
$gameMessage.setChoices(choices, defaultType, cancelType);
0 = Left
// Set Message Background
1 = Center
$gameMessage.setChoiceBackground(background);
2 = Right
Show Choices // Set Message Position
$gameMessage.setChoicePositionType(positionType);
You can also use variables to form an array for Show Choices to something like this:
// Record Outcome in Variable #1
$gameMessage.setChoiceCallback(n => {
// Initialize Choices Array
this._branch[this._indent] = n;
$gameVariables.setValue(2,
$gameVariables.setValue(variableIndex, n);
[
});
"This is choice #1",
"This is choice #2",
"This is choice #3",
"This is choice #4",
"This is choice #5",
"This is choice #6",
"This is choice #7",
"This is choice #8"
]);

// Set Message Choices


$gameMessage.setChoices($gameVariables.value(2), 0, -1);

Input Number $gameMessage.setNumberInput(var, digits);


Select 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

SceneManager._scene.addChild(new Window_Gold(x, y));


Show Gold Window
$gameParty.Gold();

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:

$gameVariables.setValue(13, Math.randomInt(3) + 1);


It means it will randomize from 1-3. If you want to start with 0, just remove the +1.
Control Variables $gameVariables.setValue(var, 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))

// Example Eventing Use:


◆Script:$gameVariables.setValue(20, ["あ", "い", "う", "え", "お"]);
Control Variables (Array) $gameVariables.setValue(ID, ["a", "b", "c"]); : :$gameVariables.setValue(19, $gameVariables.value(20)[1]);
◆Text:None, Window, Bottom
: :\v[19]

// Another Example by Caethyrill


◆Control Variables:#0001 Array = ["あ", "い", "う", "え", "お"]
◆Control Variables:#0002 First = $gameVariables.value(1)[0]
◆Control Variables:#0003 Random = $gameVariables.value(1)[Math.randomInt(5)]
◆Text:None, Window, Bottom
: :Array: \v[1]
: :First: \v[2]
: :Random: \v[3]
Example:
var key = [28, 67, 'A'];
$gameSelfSwitches.setValue(key, true);

You can also use

$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);

var eventIds = [1, 2, 3, 4, 5];


var letters = ['A','B','C','D']
for (var i = 0; i < eventIds.length; i++) {
for (var j = 0; j < letters.length; j++) {
Clear All Self Switches per Event Change the eventIds array to just the one event you want to flush self switches from.
var key = [this._mapId, eventIds[i], letters[j]];
$gameSelfSwitches.setValue(key, false);
}
}
Clear All Self Switches $gameSelfSwitches.clear();
Control Timer $gameTimer.start(time); $gameTimer.stop();

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);

Change MP $gameActors.actor(actorId).gainMp(n) Also allow using party member index: $gameParty.members()[index].gainMp(n)


Change TP $gameActors.actor(actorId).gainTp(n) Also allow using party member index: $gameParty.members()[index].gainTp(n)
$gameActors.actor(actorId).addState(n);
Change State Also allow using party member index: $gameParty.members()[index].addState(n);
$gameActors.actor(actorId).removeState(n);
You can also use:

$gameParty.members().forEach(function(m){ $gameParty.members().forEach(function(m){
m.recoverAll(); m.gainHp(Math.round(1*(m.mhp)));
Recover All }); m.gainMp(Math.round(1*(m.mmp)));
});

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.
NAME SCRIPT CALL COMMENT
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-DEF, 4-
Change Parameters $gameActors.actor(actorId).addParam(paramId, n);
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)
$gameMap.event(eventId).x
Check Event X / Y
$gameMap.event(eventId).y
$gameMap.event(eventId).screenX()
Check Event Screen X / Y
$gameMap.event(eventId).screenY()
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();
TouchInput._x
Mouse / Touch Input X / Y
TouchInput._y
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) {

and look at the cases like moveStraight, etc.

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 once within that
Wait this.wait(frames)
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)

If you want Followers remember that their IDs starts from 0.


Show Animation character.requestAnimation(id); this.setWaitMode('animation');
- $gamePlayer._followers._data[id].requestAnimation(1);

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 completion call
Tint Screen $gameScreen.startTint([red,green,blue,grey], duration);
the following $gameInterpreter.wait(duration);
All between 0 and 255, if you want wait for completion call the following $gameInterpreter.wait
Flash Screen $gameScreen.startFlash([red, green, blue, intensity], duration);
(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 following
Set Weather Effect $gameScreen.changeWeather("weather", power, duration);
$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 = #
alernatively:
Rotate Picture $gameScreen.rotatePicture(pictureId, speed);
$gameScreen._pictures[ID]._angle = Math.floor($gameScreen._pictures[ID]._angle + NUM)
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);
Battle Processing $gamePlayer.makeEncounterCount(); First true/false is for allowing to Escape, 2nd true/false is for allowing the player to 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)) {
Create Save File Replace index with the save file you want. e.g. StorageManager.remove(1);
StorageManager.cleanBackup(index);
} or for Loading use below. (Warning might cause page error if versionId is not working properly.)

if (DataManager.loadGame(index)) { // Replace Index


if (DataManager.loadGame(index)) { if ($gameSystem.versionId() !== $dataSystem.versionId) {
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y); $gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
Load Save File $gamePlayer.requestMapReload(); $gamePlayer.requestMapReload();
SceneManager.goto(Scene_Map); }
} SceneManager.goto(Scene_Map);
}
Replace index with the save file you want. e.g. StorageManager.remove(1);
or for Loading use below. (Warning might cause page error if versionId is not working properly.)

if (DataManager.loadGame(index)) { // Replace Index


if ($gameSystem.versionId() !== $dataSystem.versionId) {
$gamePlayer.reserveTransfer($gameMap.mapId(), $gamePlayer.x, $gamePlayer.y);
$gamePlayer.requestMapReload();
}
SceneManager.goto(Scene_Map);
NAME SCRIPT CALL } COMMENT
Erase Save File StorageManager.remove(index);
You can also try adding this to StoreManager:

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() Use gamePlayer version to grab player's region ID.
Get Region for Player and Events
$gameMap.regionId(x, y); Set x and y to the x, y of the tile or event.

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");

Change Vehicle Image $gameMap.vehicle(vehicleId).setImage(name, index);

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;

Game_Interpreter.prototype.pluginCommand = function(command, args) {


Plugin Command
aliasPluginCommand.call(this, command, args);
It would be cool if we could teach people about
if (command === 'plugincommandtextname') {
params/notetags here.
dostuff(args);
}
};
var key = ImageManager._generateCacheKey(path, hue);
ImageManager._imageCache[key] = undefined;
Manually Dumping Assets from Cache var reservationId = Utils.generateRuntimeId(); You have to manually put in the path and hue values.
ImageManager.releaseReservation(this._imageReservationId);
ImageManager._imageCache._truncateCache();

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

$game_actors[X].equips[Y].name unless $game_actors[X]. if ($gameActors.actor(actorId).equips()[n]) {


equips[Y] == nil return $gameActors.actor(actorId).equips()[n].id;
# Returns the name of the equipment on actor X equipped in };
slot Y
if ($gameActors.actor(actorId).equips()[n]) {
# NOTE: If using any scripts that give or take equipment return $gameActors.actor(actorId).equips()[n].name;
slots, the #Y is the number of the character's slot };
# not the slot's number in the script. I.E. using Yanfly Equip
Menu script - if your character has equipment
# slots 6,7,8,15,15,32,75 available then $game_actors[1].
equips[0].id would return the ID of the
# item equipped in the slot defined as slot 6 in Yanfly script
because it's the 1st equipment slot for the
# specific character.

# 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();

# Clear Shake (Immediate) $gameScreen.clearWeather();


$game_map.screen.clear_shake
$gameScreen.clearPictures();
# Clear Weather (Immediate)
$game_map.screen.clear_weather

# Clear Pictures (Immediate)


$game_map.screen.clear_pictures
NAME SCRIPT CALL COMMENT
(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)

# $game_map.passable? only tells you whether you can


leave one tile in the direction of the other.
# The player and event versions take it further and tell you if
you can leave that tile in the
# direction of the other AND if you can enter the other tile
from the tile you're on now (for example,
# if you are facing right and the tile in front of you is the
edge of a cliff that is higher than you -
# $game_map.passable? would tell you that you CAN step
right from the current tile.
# But $game_player.passable? would tell you that you could
not move onto the next tile from the left).
# It also looks to see if there is an event on your target tile
which would stop you going there,
# but $game_map.passable? would not tell you that.

# Q: I want to check the position of Player and compare with


$gamePlayer.isMoving()
the position at side of Events.
$gamePlayer.isDashing()
# ----------------------------------------------
$gamePlayer.isJumping()
# Variable [6] = Position X Player
# Variable [7] = Position Y Player
$gameMap.events()[eventId].isMoving()
# Variable [8] = Position X Event
$gameMap.events()[eventId].isJumping()
# Variable [9] = Position Y Event
$gameMap.isPassable(x, y, direction)
# If you only want them to be beside the event (positions 1
or 3), use this:
$gameVariables.setValue(6, $gamePlayer.x)
$game_variables[7] == $game_variables[9] and
$gameVariables.setValue(7, $gamePlayer.y)
($game_variables[6] - $game_variables[8]).abs == 1
$gameVariables.setValue(8, $gameMap.events()[n].x)
# which says if the y value is the same and there is a
$gameVariables.setValue(9, $gameMap.events()[n].y)
difference of 1 between the x values.
# Note: abs = absolute value

# If you want them to be on any of the 4 numbered tiles, use


this:
($game_variables[6] - $game_variables[8]).abs +
($game_variables[7] - $game_variables[9]).abs == 1
# which says there is a difference of 1 between the x values
OR a difference of 1 between the y values
# It is comparing the difference between the x position of the
player and the tile of interest.
# Using abs lets me take one away from the other in any
order and still end up with a positive number -
# it doesn't matter which has the # higher or lower x value.
Then it does the same with the y position of
# the player and the tile of interest. Then it adds them
together (+ means plus, not and).
# So if the sum of the x distance and the y distance between
the two tiles is 1, it means the player is on
# a tile that is directly touching the tile of interest (and not
corner-ways, as then the sum of the numbers would be 2)

# ----------------------------------------------
# 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.)

# Change an actor's equipment.


# ----------------------------------------------
$game_actors[1].change_equip(n,$data_weapons[1])
# Change n with one of the following:
# 0 = weapon, 1 = shield, 2 = headgear, 3 = body-gear
(armor), 4 = accessory

# Check Conditional Branch: if [Actor] has [Weapon]


Equipped
# ----------------------------------------------
$game_actors[actor id].weapons.include?($data_weapons
[weapon id])
right_hand = $game_actors[actor_id].equips[0]
left_hand = $game_actors[actor_id].equips[1]

# 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..

# Example: if you want to check if you have a Prinny Gun


equipped on your first weapon slot:
right_hand = $game_actors[actor_id].equips[0]
if !right_hand.nil? && right_hand.name.eql?("Prinny Gun")
# Do something
end

# 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.

# Currency unit set from the system tab:


# ----------------------------------------------
$data_system.currency_unit

# Move Events and players by fractional squares


# ----------------------------------------------
$game_map.events[ID].moveto(x, y)
$game_player.moveto(x, y)

# Example of fractional squares


$game_map.events[1].moveto(0, 5.5)
$game_player.moveto(7.5, 3)
end
# The Collission box is still seen as 32x32

# Script Call Battle Logs!


# ----------------------------------------------
# First add this scriptlet:
class Scene_Battle < Scene_Base
attr_accessor:log_window
end

# To load your own battle logs


SceneManager.scene.log_window.add_text("Insert custom
text here")
# It doesn't clear out and just stays there until something You can use all normal text codes but have to use \\ instead of \.
else replaces it. Ex: Use \\C[1] to change the text color to blue.
var text = "Your text goes in there."
SceneManager.scene.log_window.wait
SceneManager._scene._logWindow.addText(text)
# If you want it to clear make sure to use this. If using Yanfly Action Sequence:
SceneManager._scene._logWindow.clear();
SceneManager.scene.log_window.wait_and_clear eval: SceneManager._scene._logWindow.addText(target.name() + " was scorched due to
contact!")
# You can also do something like this!
x = "Hi."
x += " Hello."
x += " This is getting long eh?"
x += " Surely so long. wahahahahahaha"
SceneManager.scene.log_window.add_text(x)

# 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);

example use:

callErik = function(){
Load Script Calls from js file PluginManager.loadScript(filename); alert('Erik is gay af');
};

call Erik();

You might also like