ABCDEFGHIJKLMNOPQRSTUVWXYZ
1
Original URLhttp://forums.rpgmakerweb.com/index.php?/topic/25759-script-call-collection-for-vxace/CTRL+ ENTER or ALT+ ENTER for new lines
2
Event Page 1
3
Message
4
Show Text$gameMessage.setFaceImage('Actor1',0)
$gameMessage.setBackground(1)
$gameMessage.setPositionType(1)
$gameMessage.add("Show Text Script Call")
5
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()
6
Input Number$gameMessage.setNumberInput(var, digits);
7
Select Key Item$gameMessage.setItemChoice(var, n);n = 1 for regular items, 2 for key items, 3 for Hidden A, 4 for Hidden B
8
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
9
10
Party
11
Change Gold$gameParty.gainGold(n);
12
Change Items$gameParty.gainItem($dataItems[itemId], n);
13
Change Weapons$gameParty.gainItem($dataWeapons[weaponId], n, true/false *note);*note if decreasing, true will mean it will include already equipped weapons.
14
Change Armor$gameParty.gainItem($dataArmorsweaponId], n, true/false *note);*note if decreasing, true will mean it will include already equipped armors.
15
Change Party Member$gameParty.addActor(n);
$gameParty.removeActor(n);
To initialize: $gameActors.actor(actorId).setup(actorId);
16
17
Game Progression
18
Control Switches$gameSwitches.setValue(num, true/false);
19
Control Variables$gameVariables.setValue(var, value);
20
Control Self Switch$gameSelfSwitches.setValue(key, true/false);key = [mapId, eventId, A-D]
21
Control Timer$gameTimer.start(time); $gameTimer.stop();
22
23
Flow Control
24
Conditional Branchif (code) { stuff } else { stuff }
25
Loopwhile (;;) { stuff }
26
Break Loopbreak;
27
Exit Event Processing$gameInterpreter._index = $gameInterpreter._list.length;
28
Common Event$gameTemp.reserveCommonEvent(n);
29
Label
30
Jump to Label
31
Comment/*
32
33
Actor
34
Change HP$gameActors.actor(actorId).gainHp(n)Also allow using party member index: $gameParty.members()[index].gainHp(n)
35
Change MP$gameActors.actor(actorId).gainMp(n)Also allow using party member index: $gameParty.members()[index].gainMp(n)
36
Change TP$gameActors.actor(actorId).gainTp(n)Also allow using party member index: $gameParty.members()[index].gainTp(n)
37
Change State$gameActors.actor(actorId).addState(n);
$gameActors.actor(actorId).removeState(n);
Also allow using party member index: $gameParty.members()[index].addState(n);
38
Recover All
for (var j = 0; j < $gameActors.length; j++) {
$gameActors.actor(j).recoverAll();
};
39
Change EXP$gameActors.actor(actorId).gainExp(n);Negative n if you want the actor to lose Exp.
40
Change Level$gameActors.actor(actorId).changeLevel(n, true/false);n = level the actor will become. true/false to show level up.
41
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
42
Change Skill
$gameActors.actor(actorId).learnSkill(n);
$gameActors.actor(actorId).forgetSkill(n);
43
Change Equipment$gameActors.actor(actorId).changeEquip(slotId, item);item = $databaseWeapons[n] or $databaseArmors[n]
44
Change Name$gameActors.actor(actorId).setName(n)
45
Change Class$gameActors.actor(actorId).changeClass(n, keepExp)keepExp is either true or false
46
Change Nickname$gameActors.actor(actorId).setNickname(n)
47
Change Profile$gameActors.actor(actorId).setProfile(n)
48
49
Event Page 2
50
Movement
51
Transfer Player$gamePlayer.reserveTransfer(mapId, x, y, direction, fade type);direction = look at NumPad fade type = 0-Black, 1-White, 2-None
52
Set Vehicle Location$gameMap.vehicle(vehicleId).setLocation(mapId, x, y);
53
Set Event Location$gameMap.event(eventID).setPosition(x, y)
54
Scroll Map$gameMap.startScroll(direction, distance, speed);direction = look at NumPad
55
Set Movement Route
56
Get ON/OFF Vehicle$gamePlayer.getOnOffVehicle();
57
58
Timing
59
Wait$gameInterpreter.wait(frames);
60
61
Character
62
Change Transparency$gamePlayer.setTransparent(flag)
63
Change Player Followers$gamePlayer.showFollowers(); $gamePlayer.hideFollowers();Might need $gamePlayer.refresh();
64
Gather Followers$gamePlayer.gatherFollowers(); this.setWaitMode('gather');
65
Show Animationcharacter.requestAnimation(id); this.setWaitMode('animation');For character: $gamePlayer; $gameMap.event(ID);
66
Show Balloon Iconcharacter.requestBalloon(id); this.setWaitMode('balloon');For character: $gamePlayer; $gameMap.event(ID);
67
Erase Event$gameMap.eraseEvent(this._eventId);
68
69
Screen
70
Fadeout Screen$gameScreen.startFadeOut(fade_speed);Default is 24
71
FadeIn Screen$gameScreen.startFadeIn(fade_speed);might want to call wait to go with it, by default the event command does
72
Tint Screen$gameScreen.startTint([red,green,blue,grey], duration);red,green,blue between -255 to 255, grey between 0 and 255, if you want wait for completion call the following $gameInterpreter.wait(duration);
73
Flash Screen$gameScreen.startTint([red,green,blue,intensity], duration);All between 0 and 255, if you want wait for completion call the following $gameInterpreter.wait(duration);
74
Shake Screen$gameScreen.startShake(power, speed, duration);If you want wait for completion call the following $gameInterpreter.wait(duration);
75
Set Weather Effect$gameScreen.changeWeather("weather", power, duration);Weather = "none","rain","storm","snow". If you want wait for completion call the following $gameInterpreter.wait(duration);
76
77
Picture
78
Show Picture$gameScreen.showPicture(pictureId, name, origin, x, y,
scaleX, scaleY, opacity, blendMode)
79
Move Picture$gameScreen.movePicture(pictureId, origin, x, y, scaleX,
scaleY, opacity, blendMode, duration)
80
Picture Blend Mode$gameScreen._pictures[id]._blendMode = #
81
Rotate Picture$gameScreen.rotatePicture(pictureId, speed);
82
Tint Picture$gameScreen.tintPicture(pictureId, tone, duration);
83
Erase Picture$gameScreen.erasePicture(pictureId);
84
Audio & Video
85
Sound Object: { name: filename, volume: n, pitch: n, pan: n }
86
Play BGMAudioManager.playBgm( refer to sound object above );
87
Fadeout BGMAudioManager.fadeOutBgm(n);
88
Save BGM$gameSystem.saveBgm();
89
Replay BGM$gameSystem.replayBgm();
90
Play BGSAudioManager.playBgs( refer to sound object above );
91
Fadeout BGSAudioManager.fadeOutBgs(n);
92
Play MEAudioManager.playMe( refer to sound object above );
93
Play SEAudioManager.playSe( refer to sound object above );
94
Stop SEAudioManager.stopSe();
95
Play MovieGraphics.playVideo(path/name.ext);
96
97
Event Page 3
98
Scene Control
99
Battle ProcessingBattleManager.setup(troopId, true/false, true/false);
$gamePlayer.makeEncounterCount();
SceneManager.push(Scene_Battle);
First true/false is for allowing to Escape, 2nd true/false is for allowing the player to lose
100
Shop ProcessingSceneManager.push(Scene_Shop);
101
Name Input ProcessingSceneManager.push(Scene_Name);
SceneManager.prepareNextScene(actorId, name length);
102
Open Menu ScreenSceneManager.push(Scene_Menu);
103
Open Save ScreenSceneManager.push(Scene_Save);If you want to check if your game has any savefiles at all:
DataManager.isAnySavefileExists()

Useful for custom title screens that are evented.
104
Open Load ScreenSceneManager.push(Scene_Load);
105
Game OverSceneManager.goto(Scene_Gameover);
106
Return to Title ScreenSceneManager.goto(Scene_Title);
107
Call Event$gameMap.event(EventID, EventPage).start();You can either use it as the following:
$gameMap.event(8).start();

For a specific page:
$gameMap.event(8,3).start();
108
Map
109
Change Map Name Display$gameMap.enableNameDisplay();
$gameMap.disableNameDisplay();
110
Change Tileset$gameMap.changeTileset(n);
111
Change Battleback$gameMap.changeBattleback(filename, filename);
112
Change Parallax$gameMap.changeParallax(name, loopX, loopY, speed x, speed y);
113
Get Location Info$gameMap.terrainTag(x, y);
$gameMap.eventIdXy(x, y);
$gameMap.tileId(x, y, layer);
114
Get Region for Player and Events$gameMap.regionId(x, y);Set x and y to the x, y of the player/event
115
116
System Settings
117
Change Battle BGM$gameSystem.setBattleBgm(name);
118
Change Victory ME$gameSystem.setVictoryMe(name);
119
Change Defeat ME$gameSystem.setDefeatMe(name);
120
Change Vehicle BGM$gameMap.vehicle(vehicleId).setBgm(name);
121
Change Save Access$gameSystem.disableSave();
$gameSystem.enableSave();
122
Change Menu Access$gameSystem.disableMenu();
$gameSystem.enableMenu();
123
Change Encounter$gameSystem.disableEncounter();
$gameSystem.enableEncounter();
124
Change Formation Access$gameSystem.disableFormation();
$gameSystem.enableFormation();
125
Change Window Color$gameSystem.setWindowTone(tone); (red, green, blue, gray);
126
Change Actor Images$gameActors.actor(actorId).setCharacterImage(name, index);
$gameActors.actor(actorId).setFaceImage(name, index):
$gameActors.actor(actorId).setBattlerImage(name);
127
Change Vehicle Image$gameMap.vehicle(vehicleId).setImage(name, index);
128
129
Battle
130
Change Enemy HP$gameTroop.members()[enemyIndex].gainHp(n);Use negative n if you want the enemy to lose HP.
131
Change Enemy MP$gameTroop.members()[enemyIndex].gainMp(n);Use negative n if you want the enemy to lose MP.
132
Change Enemy TP$gameTroop.members()[enemyIndex].gainTp(n);Use negative n if you want the enemy to lose TP.
133
Change Enemy State
$gameTroop.members()[enemyIndex].addState(n);
$gameTroop.members()[enemyIndex].removeState(n);
134
Enemy Recover All$gameTroop.members()[enemyIndex].recoverAll();
135
Enemy Appear$gameTroop.members()[enemyIndex].appear();
136
Enemy Transform$gameTroop.members()[enemyIndex].transform(n);n is the enemy ID you want the enemy to transform into.
137
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.
138
Force Action$gameParty.members()[index].forceAction(skillId, targetIndex);
BattleManager.forceAction($gameParty.members()[index]);

$gameTroop.members()[index].forceAction(skillId, targetIndex);
BattleManager.forceAction($gameTroop.members()[index]);
139
Abort BattleBattleManager.abort();
140
141
Advanced
142
Plugin Command
It would be cool if we could teach people about params/notetags here.
var aliasPluginCommand = Game_Interpreter.prototype.pluginCommand;

Game_Interpreter.prototype.pluginCommand = function(command, args) {
aliasPluginCommand.call(this, command, args);
if (command === 'plugincommandtextname') {
dostuff(args);
}
};
143
144
Debugging Tools
145
Mouse SettingsTouchInput._x
TouchInput._y
146
# Add every Item/Skill/Weapon/Etc. without blank fields.
# ----------------------------------------------
$data_items.each { |i|
next if i.nil? or i.name == ""
$game_party.gain_item(i, 99)
}
for (var i = 0; i < $dataItems.length; i++) {
if (!!$dataItems[i]) {
if ($dataItems[i].name.length > 0) {
$gameParty.gainItem($dataItems[i], 99);

}
}
}
for (var i = 0; i < $dataWeapons.length; i++) {
if (!!$dataWeapons[i]) {
if ($dataWeapons[i].name.length > 0) {
$gameParty.gainItem($dataWeapons[i], 99);

}
}
}
for (var i = 0; i < $dataArmors.length; i++) {
if (!!$dataArmors[i]) {
if ($dataArmors[i].name.length > 0) {
$gameParty.gainItem($dataArmors[i], 99);

}
}
}
147
148
# Use Items immediately
# ----------------------------------------------
$game_actors[id].use_item($data_items[x])
$game_party.leader.use_item($data_items[x])
$game_party.members[index].use_item($data_items[x])
$gameActors.actor(actorId).useItem($dataItems[id]);
$gameParty.leader().useItem($dataItems[id]);
$gameParty.members()[id].useItem($dataItems[id]);
149
150
# Check Party Member Size
# ----------------------------------------------
$game_party.members.size
$game_party.all_members.size
# If In Battle, use this instead. This checks the total size of your party (not just battlers).
$gameParty.members().length;
$gameParty.allMembers().length;
151
152
# Checking Availability
# ----------------------------------------------
$game_actors[X].equips.include?($data_weapons[Y]) # Checks if the actor X has weapon Y equipped
$game_actors[X].equips.include?($data_armors[Y]) # Checks if the actor X has equipment
#(shield, armor, helmet or accessory)
# Y equipped
$game_actors[X].skills.include?($data_skills[Y]) # Checks if the actor X has learned skill Y
$game_actors[X].states.include?($data_states[Y]) # Checks if the actor X is afflicted by status
# effect Y

$game_actors[actorid].skill_learn?($data_skills[skillid]) # If Player learned Skill. actorid and skillid
# are the ids from the database of
# the actor and skill you're interested in.
# It will return true if they have that skill, an
# false if they don't.

# Example Usage:
# if xxx weapon type is the same as unless xxx == nil
$game_actors[x].equips[y].wtype_id if $game_actors[x].equips[y]
$gameActors.actor(actorId).equips().contains($dataWeapons[n])

$gameActors.actor(actorId).equips().contains($dataArmorsn])

$gameActors.actor(actorId).skills().contains($dataSkills[n])

$gameActors.actor(actorId).isLearnedSkill(n)
$gameActors.actor(1).changeEquip(0, $dataWeapons[5]);

With slot 0 being 'weapons' by default. Great for forcing a character to equip a weapon type their class can't handle.
153
154
# 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].equips[Y] == nil
# Returns the name of the equipment on actor X equipped in slot Y

# NOTE: If using any scripts that give or take equipment 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.
if ($gameActors.actor(actorId).equips()[n]) {
return $gameActors.actor(actorId).equips()[n].id;
};

if ($gameActors.actor(actorId).equips()[n]) {
return $gameActors.actor(actorId).equips()[n].name;
};
155
156
# Checking Actors
# ----------------------------------------------
$game_actors[X].name # Returns the name of the actor X
$game_actors[X].nickname # Returns the nickname of the actor X
$game_actors[X].class.id # Returns the ID of the actor X class
$game_actors[X].class.name # Returns the name of the actor X class
$gameActors.actor(actorId).name()
$gameActors.actor(actorId).nickname()
$gameActors.actor(actorId).currentClass().id
$gameActors.actor(actorId).currentClass().name
157
158
# Screen Clean Up
# ----------------------------------------------
# Clear Fade
# Clear Tone
# Clear Flash
# Clear Shake
# Clear Weather
# Clear Pictures
$game_map.screen.clear

# Clear Tone (Immediate)
$game_map.screen.clear_tone

# Clear Shake (Immediate)
$game_map.screen.clear_shake

# Clear Weather (Immediate)
$game_map.screen.clear_weather

# Clear Pictures (Immediate)
$game_map.screen.clear_pictures
$gameScreen.clear();

$gameScreen.clearTone();

$gameScreen.clearFlash();

$gameScreen.clearShake();

$gameScreen.clearWeather();

$gameScreen.clearPictures();
159
160
Input.trigger?(:A)
Input.repeat?(:A)
Input.press?(:A)
# Change A to your desired key, refer to F1 when you testplay and see the keys.

Please Include Touch Input and such.
(Input.isTriggered('ok'))
(Input.isRepeated(ok'))
(Input.isPressed('ok'))
(Input.isLongPressed('ok'))

(TouchInput.isTriggered())
(TouchInput.isRepeated())
(TouchInput.isPressed())
(TouchInput.isLongPressed())
(TouchInput.isCancelled())
(TouchInput.isMoved())
(TouchInput.isReleased())
161
162
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 the position at side of Events.
# ----------------------------------------------
# Variable [6] = Position X Player
# Variable [7] = Position Y Player
# Variable [8] = Position X Event
# Variable [9] = Position Y Event

# If you only want them to be beside the event (positions 1 or 3), use this:
$game_variables[7] == $game_variables[9] and ($game_variables[6] - $game_variables[8]).abs == 1
# which says if the y value is the same and there is a 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.)
$gamePlayer.isMoving()
$gamePlayer.isDashing()
$gamePlayer.isJumping()

$gameMap.events()[eventId].isMoving()
$gameMap.events()[eventId].isJumping()

$gameMap.isPassable(x, y, direction)

$gameVariables.setVariable(6, $gamePlayer.x)
$gameVariables.setVariable(7, $gamePlayer.y)
$gameVariables.setVariable(8, $gameMap.events()[n].x)
$gameVariables.setVariable(9, $gameMap.events()[n].y)

163
164
# 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
165
166
# 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

# 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.
167
168
# Currency unit set from the system tab:
# ----------------------------------------------
$data_system.currency_unit
169
170
# 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
171
172
# 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 else replaces it.
SceneManager.scene.log_window.wait
# If you want it to clear make sure to use this.
SceneManager.scene.log_window.wait_and_clear

# 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)
173
174
# ----------------------------------------------
# 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.)
175
176
$game_player.center($game_player.x, $game_player.y)
You can set an event or the player to be in the center of the screen. It snaps but it's pretty good :D!
177
178







179
180
181
182
183
184
185
186
187