Save-Point
RMVX Ace Script Call Eventing Procedures. - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Games Development (https://www.save-point.org/forum-4.html)
+--- Forum: Tutorials (https://www.save-point.org/forum-19.html)
+--- Thread: RMVX Ace Script Call Eventing Procedures. (/thread-4894.html)



RMVX Ace Script Call Eventing Procedures. - JayRay - 10-26-2013

This was copied in part from RPG Maker (rpgmakerweb.com)

Enclosed is a compiled list of several script calls that mimic event actions.


Variables
$game_variables[n]

Switches

$game_switches[n]

Conditional Branch

if#something#somethingelse#somethingend

Show Picture

screen.pictures[index].show(file_name, upperleft/center, x, y, x zoom, y zoom, opacity, blend type)

Move Picture

screen.pictures[n].move(0/1(top left or center), x, y, zoom1, zoom2, opacity, blend type (0,1,2), wait)

Picture Tone

screen.pictures[n].start_tone_change(Tone.new(0,0,0,0), wait)

Looping

For#somethingend

Move Event

move_route = RPG::MoveRoute.new
move_route.repeat =false
move_route.skippable =true
m = RPG::MoveCommand.new
m.code =45#The List of M Code can be found over Game_Character, this current m.code is call script
m.parameters =["script call here"]
move_route.list.insert(0,m.clone)
$game_player.force_move_route(move_route)

Transfer Event Location

$game_map.events[id].moveto(new_x, new_y)

Transfer Player

$game_player.reserve_transfer(map_id, x, y, direction)

Screen Tint

t =Tone.new(red,green,blue, gray)
screen.start_tone_change(t, duration)

Shake Screen

@params=[]@params[0]= power or $game_variables[x]@params[1]= speed or $game_variables[y]@params[2]= duration or $game_variables[z]

Call Common Event:
$game_temp.reserve_common_event(id)

Play SE/ME/BGS/BGM:
RPG::SE.new("SE Name", volume, pitch).play
RPG::ME.new("ME Name", volume, pitch).play
RPG::BGS.new("BGS Name", volume, pitch).play
RPG::BGM.new("BGM Name", volume, pitch).play

Show Text:
$game_message.add("Text")

Gain/lose Item:

$game_party.gain_item($data_items[id], amount)
$game_party.lose_item($data_items[id], amount)
(For weapons/armor use $data_weapons or $data_armors in place of $data_items.)

Gather Followers:

$game_player.followers.gather

Change Player Followers:

$game_player.followers.visible =trueorfalse

Erase Event:

$game_map.events[event_id].erase

(Conditional) Button pressing
Input.repeat?(:A)Input.press?(:A)
[b]
(Conditional)
Movement
[/b]
$game_player.dash?
$game_player.jumping?
$game_map.events[event_id].moving?
$game_map.events[event_id].jumping?
[b]
(Conditional)
Location
[/b]
$game_map.events[event_id].x
$game_map.events[event_id].y
$game_player.x
$game_player.y

Remove Actor

$game_party.remove_actor(actor_id)

Add Actor

$game_party.add_actor(actor_id)

Remove Party Member from position (where x = party position. 0 = 1st member, 1 = 2nd member, etc.)

m = $game_party.members
$game_party.remove_actor(m[x].id)

Gain/lose gold:
$game_party.gain_gold(amount)
$game_party.lose_gold(amount)

Check for current max gold:
$game_party.max_gold

Get map id and name:
$game_map.map_id
$game_map.name

Show Choices
params=[]
choices =[]
choices.push("choice 1")
choices.push("choice 2")params.push(choices)params.push(0/1/2this part iswhere you press cancel and which choice to default)
setup_choices(params)

(this is very good when trying to stop the 4 choice maximum, you can use this with the following work to define what happens on each choice)
The definition is just...


command_skip if@branch[@indent]!=@params[0]
Where @params stores the choice number for that specific branch (0, 1, 2, ... )

So all you have to do is replace @params[0] with an integer

if@branch[@indent]==0# branch for first choiceelsif@branch[@indent]==1# branch for second choiceend



If anyone has any others that they'd like to add to this, I'd love to see them.