RMMV Script Calls
 Share
This version of Google Chrome is no longer supported. Please upgrade to a supported browser.Dismiss

Comment only
 
 
ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
NAMESCRIPT CALLCOMMENT
2
UPDATED (10/20/2020, GMT+8:30)
- Added Check Event X/Y
- Added Check Event Screen X/Y
- Added Mouse / Touch Input X/Y
Discussion Thread:
If you have any suggestions, just go here.
https://forums.rpgmakerweb.com/index.php?threads/rpg-maker-mv-script-call-list.46456/
VXA Version:
https://docs.google.com/spreadsheets/d/1SPWPqSZ3I_LgilZse2I2sDPq-QyNQphb4T3i5aWMQic/edit?usp=drive_web&ouid=112741546968112756440
http://forums.rpgmakerweb.com/index.php?/topic/25759-script-call-collection-for-vxace/
http://forums.rpgmakerweb.com/index.php?/topic/46456-rpg-maker-mv-script-call-list/&page=1
3
Event Page 1
4
Message
5
Show Text$gameMessage.setFaceImage('Actor1',0)
$gameMessage.setBackground(1)
$gameMessage.setPositionType(1)
$gameMessage.add("Show Text Script Call")
6
Show Choiceschoices = []; params = [];
$gameMessage.setChoices(choices, 0)
choices.push("I love you1");choices.push("I love you2");
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()
7
Input Number$gameMessage.setNumberInput(var, digits);
8
Select Key Item$gameMessage.setItemChoice(var, n);n = 1 for regular items, 2 for key items, 3 for Hidden A, 4 for Hidden B
9
Show Scrolling Text$gameMessage.setScroll(scrolling_speed, no_fast_forward);
$gameMessage.add("Text");
scrolling speed should be a number e.g. 2, fast_forward should be true or false
you need this line for each line of text individually
10
Show Gold WindowSceneManager._scene.addChild(new Window_Gold(x, y));
$gameParty.Gold();
11
12
Party
13
Change Gold$gameParty.gainGold(n);
14
Change Items$gameParty.gainItem($dataItems[itemId], n);
$gameParty.loseItem($dataItems[ID], amount);
15
Change Weapons$gameParty.gainItem($dataWeapons[weaponId], n, true/false *note);*note if decreasing, true will mean it will include already equipped weapons.
16
Change Armor$gameParty.gainItem($dataArmors[armorId], n, true/false *note);*note if decreasing, true will mean it will include already equipped armors.
17
Get All Items$dataItems.forEach(function(item) {$gameParty.gainItem(item,99,false);});
$dataArmors.forEach(function(armor){ $gameParty.gainItem(armor,99,false);});
$dataWeapons.forEach(function(weapon){ $gameParty.gainItem(weapon,99,false);});
18
Get All Items (unless the name is empty)$dataItems.forEach(function(item) {if (item && item.name) {$gameParty.gainItem(item,99,false);}});
$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);}});
19
Change Party Member$gameParty.addActor(n);
$gameParty.removeActor(n);
To initialize: $gameActors.actor(actorId).setup(actorId);
20
Check Party Leader$gameParty.leader().actorId() == IDReplace ID with the ID of the actor you want to check.
21
Check Party Size$gameParty.members().length
22
Check Party Index of a Character$gameParty.members().indexOf($gameActors.actor(ACTORID))Replace ACTORID with the ID of the actor you want to check
You can also use it like this: $gameParty.members().indexOf($gameActors.actor(1)) == 0
23
24
Game Progression
25
Control Switches$gameSwitches.setValue(num, true/false);If you want to use in a condition's script condition with multiple switches to check:
($gameSwitches.value(1) == true) && ($gameSwitches.value(2) == true) && ($gameSwitches.value(3) == true)
26
Control Variables$gameVariables.setValue(var, value);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.


Math.random()
It's from 0.0 to 1.0
27
Control Variables (Array)$gameVariables.setValue(ID, ["a", "b", "c"]);// 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, ["あ", "い", "う", "え", "お"]);
: :$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]
28
Control Self Switchvar key = [mapId, eventId, A-D]
$gameSelfSwitches.setValue(key, true);
Example:
var key = [28, 67, 'A'];
$gameSelfSwitches.setValue(key, true);

You can also use

$gameMap._mapId

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

29
Clear All Self Switches per Eventvar 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++) {
var key = [this._mapId, eventIds[i], letters[j]];
$gameSelfSwitches.setValue(key, false);
}
}
Change the eventIds array to just the one event you want to flush self switches from.
30
Clear All Self Switches$gameSelfSwitches.clear();
31
Control Timer$gameTimer.start(time); $gameTimer.stop();
32
33
Flow Control
34
Conditional Branchif (code) { stuff } else { stuff }
35
Loopwhile (;;) { stuff }
36
Break Loopbreak;
37
Exit Event Processing$gameInterpreter._index = $gameInterpreter._list.length;
38
Exit GameSceneManager.exit();
39
Common Event$gameTemp.reserveCommonEvent(n);
$gameTemp.clearCommonEvent(n);
40
Label
41
Jump to Label
42
Comment// For Single Lines

/* For
Multiple lines like this.
*/
// Is good for only a small chunk of code.
/* item */ is good if you want to batch comment.

Not super useful for script calls though due to 210 line limit.
43
44
Actor
45
Change HPvar m = $gameActors.actor(id)
var d = damage
var KO = true/false
Game_Interpreter.prototype.changeHp.call(this, m, d, KO);
Also allow using party member index: $gameParty.members()[index].gainHp(n)

Example Uses:

-- Decrease Actor ID #1 by 70%
var m = $gameActors.actor(1)
var d = Math.round(-0.7*m.mhp)
var KO = true
Game_Interpreter.prototype.changeHp.call(this, m, d, KO);

46
Change MP$gameActors.actor(actorId).gainMp(n)Also allow using party member index: $gameParty.members()[index].gainMp(n)
47
Change TP$gameActors.actor(actorId).gainTp(n)Also allow using party member index: $gameParty.members()[index].gainTp(n)
48
Change State$gameActors.actor(actorId).addState(n);
$gameActors.actor(actorId).removeState(n);
Also allow using party member index: $gameParty.members()[index].addState(n);
49
Recover All$gameParty.members().forEach(function(m){
m.recoverAll();
});

You can also use:

$gameParty.members().forEach(function(m){
m.gainHp(Math.round(1*(m.mhp)));
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)})
50
Change EXP$gameActors.actor(actorId).gainExp(n);Negative n if you want the actor to lose Exp.
51
Change Level$gameActors.actor(actorId).changeLevel(n, true/false);n = level the actor will become. true/false to show level up.
52
Change Parameters$gameActors.actor(actorId).addParam(paramId, n);Negative n if you wish the actor to lose stats. Params: 0-MaxHP, 1-MaxMP, 2-ATK, 3-DEF, 4-MAT, 5-MDEF, 6-AGI, 7-LUK
53
Change Skill$gameActors.actor(actorId).learnSkill(n);
$gameActors.actor(actorId).forgetSkill(n);
54
Add All Skills$dataSkills.forEach(function(skill){ if(skill) $gameParty.leader().learnSkill(skill.id);});replace $gameParty.leader() with any other actor
55
Change Equipment$gameActors.actor(actorId).changeEquip(slotId, item);item = $dataWeapons[n] or $dataArmors[n]
56
Change Name$gameActors.actor(actorId).setName(n)If you want to change an Actor's name based on another Actor's name:
$gameActors.actor(actorId).setName($gameActors.actor(actorId).name())
57
Change Class$gameActors.actor(actorId).changeClass(n, keepExp)keepExp is either true or false
58
Change Nickname$gameActors.actor(actorId).setNickname(n)
59
Change Profile$gameActors.actor(actorId).setProfile(n)
60
61
Event Page 2
62
Movement
63
Transfer Player$gamePlayer.reserveTransfer(mapId, x, y, direction, fade type);direction = Down(2), Left(4), Right(6), Up(8)
fade type = 0-Black, 1-White, 2-None
64
Set Vehicle Location$gameMap.vehicle(vehicleId).setLocation(mapId, x, y);t
65
Set Event Location$gameMap.event(eventID).setPosition(x, y);
66
Set Event Direction$gameMap.event(eventID).setDirection(direction);direction = Down(2), Left(4), Right(6), Up(8)
Example:
$gameMap.event(this._eventId).setDirection(2)
67
Check Event X / Y$gameMap.event(eventId).x
$gameMap.event(eventId).y
68
Check Event Screen X / Y$gameMap.event(eventId).screenX()
$gameMap.event(eventId).screenY()
69
Check Event Direction$gameMap.event(eventID).direction();
70
Set Player Location$gamePlayer.locate(x, y);
71
Set Player Direction$gamePlayer.setDirection(dir);direction = Down(2), Left(4), Right(6), Up(8)
72
Check Player Location$gamePlayer.pos(x, y)
73
Check Player Direction$gamePlayer.direction();direction = Down(2), Left(4), Right(6), Up(8)
74
Check Player Coordinates$gamePlayer.x;
$gamePlayer.y;
75
Set Follower Location$gamePlayer.followers().follower(index).setPosition(X, Y);Index starts at 0
76
Set Follower Direction$gamePlayer.followers().follower(index).setDirection(dir);direction = Down(2), Left(4), Right(6), Up(8)
77
Check Follower Coordinates$gamePlayer.followers().follower(index).x
$gamePlayer.followers().follower(index).y
Index starts at 0
78
Check Follower Direction$gamePlayer._followers.follower(index).direction();
79
Mouse / Touch Input X / YTouchInput._x
TouchInput._y
80
Check Map ID$gameMap._mapId;
81
Scroll Map$gameMap.startScroll(direction, distance, speed);direction = Down(2), Left(4), Right(6), Up(8)
82
Zoom$gameScreen.startZoom(x,y,zoom,wait);Example:
$gameScreen.startZoom($gamePlayer.screenX(), $gamePlayer.screenY(), 2.5, 60);

Instant Zoom:

$gameScreen.setZoom(x,y,zoom);


Clear Zoom
$gameScreen.clearZoom();
83
84
Change Player Camera Position$gamePlayer.center(x, y)replace x/y with map coordinates.
85
Change Map Camera$gameMap.setDisplayPos(x, y)
86
Set Movement Route
For Events:
$gameMap.event(id).command(x);
In rpg_objects.js look for the following:
Game_Character.prototype.processMoveCommand = function(command) {

and look at the cases like moveStraight, etc.

Example:
$gameMap.event(5).moveStraight(4);

$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
87
Set Movement Route (Default Pathfinding)//for this example "charEvent" is the event you want to move, but you can use $gameMap._events
var charEvent = $gameMap._events[id];

// THIS IS THE IMPORTANT LINE, of course you have to put real coordinates instead of x & y
charEvent.moveStraight( charEvent.findDirectionTo(x, y) );
Remember that default pathfinding has a limit
88
Set Destination$gameTemp.setDestination(mapX, mapY)
89
Get ON/OFF Vehicle$gamePlayer.getOnOffVehicle();
90
91
Timing
92
Waitthis.wait(frames)Only one wait will work in a script call. It's because a script call runs everything at once within that block. The only way to work around with it is having a custom method or set a timeout.
93
94
Character
95
Change Transparency$gamePlayer.setTransparent(flag)flag = true / false
96
Change Player Followers$gamePlayer.showFollowers(); $gamePlayer.hideFollowers();Might need $gamePlayer.refresh();
97
Gather Followers$gamePlayer.gatherFollowers(); this.setWaitMode('gather');
98
Show Animationcharacter.requestAnimation(id); this.setWaitMode('animation');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.
- $gamePlayer._followers._data[id].requestAnimation(1);

For Example:
var character = $gameMap.event(1);
var id = 1;
character.requestAnimation(id);
99
Show Balloon Iconcharacter.requestBalloon(id); this.setWaitMode('balloon');Replace character with one of these: $gamePlayer; $gameMap.event(ID);
For example: $gameMap.event(6).requestBalloon(3); this.setWaitMode('balloon');
100
Erase Event$gameMap.eraseEvent(this._eventId);
Loading...