Script Call Equivalent of Events

This is a little something I'm using right now, it's being used together with Tsukihime's Tileswap script (which is what the pos_swap thing is)

if $game_switches[32] == true if $game_switches[33] == true pos_swap($game_variables[14], $game_variables[15], "D96", 2) end if $game_switches[33] == false pos_swap($game_variables[14], $game_variables[15], "D112", 2) endendIt checks to see if one switch is on, and if it is, it then checks to see if a second switch is on or off, I could probably put an "else" in the place of "if $game_switches[33] == false" and get rid of the extra "end" but meh. XD

Anyway, that little snippit does exactly what I need it to and theoretically you could put as many if statements as you need so long as you use something like Tsukihime's Large Script Call Script in order to tie them all together.
Question: With the script call can I make a conditional branch with multiple If's. I know the conditonal branch that's built in is setup as follows:
Code:
if cond1  if cond2    if cond3      something
Is equivalent to
Code:
if cond1 && cond2 && cond3  something
You are unable to create event command branching with script calls alone.
You could also do this:

Code:
if cond1 somethingelsif cond2 somethingelsif cond3 somethingelse somethingend
Is there still no known good way to make 'choices' calls from scripts?

This just seems insane to me. I was completely expecting to do something like call "do_choices(list_of_choices)" and have it return an index of the made choice. Instead they seem to have taken a leap off the deepend on this one. And why isn't it handled directly by $game_message ? Frustration!
Didn't Tsukihime write up a script for choices? It may have had some issues, but it should get you at least part-way there.
Didn't Tsukihime write up a script for choices? It may have had some issues, but it should get you at least part-way there.
Tuskihime had a script that let you make choice commands back to back to extend options, but that won't help me.

What I have is an array of crafting options (Potentially long) based on which crafting recipe's the party knows. I want to display the list of recipe's and have the user choose one. This means that the list isn't always the same options, it could contain 10 items, it could contain 3 or 4, or even 30 (I have a pagination system in mind). I thought this would be fairly straight forward to do.

Guess I'll look into writing something up to fix this. The choice response must be stored somewhere such that the choice_proc in game message can access it, right?
This means that the list isn't always the same options, it could contain 10 items, it could contain 3 or 4, or even 30
If the list doesn't always have the same options, how can you create an event with only 3 branches and use it for the case where you have 30 options? It doesn't matter if the list you show won't have all the items; you're using a single event and that event must have all of the logic contained if it's supposed to handle the case where the player actually does have access to every option.


In any case this script should do the trick: Choice Options. Just create your 30 choices with your pagination scheme and then attach "hidden" conditions to each option so that if you don't have a particular item, that choice won't be available.
Yep, I would use that, or I would just ditch choices altogether and go with a custom menu to handle it (which is exactly what I did in my game for crafting).
Yep, I would use that, or I would just ditch choices altogether and go with a custom menu to handle it (which is exactly what I did in my game for crafting).
That sounds like a better option actually. I haven't delved into custom menu's yet, but I'll need to handle that for other things, and I wouldn't at all be surprised if they were more powerful. I really don't like using Events if I don't have to (Since they are so hard to upkeep, and you tend to have to repeat work a lot.)
This issue is solving a lot of questions before I had, is very useful and interesting, here's my question, I hope someone answers it:

 

Is there any way to show the character's name (for example, the one in position 001 of the database) on the screen, but without opening any message box and putting manually the x and y screen variables?
This thread is for things that can already be done with event commands. Putting the character's name on the screen without using a message box cannot be done with event commands.


You need to open your own thread with your question. Also make sure you're posting in the correct forum - your profile says you're using VX, but this thread (and subforum) is for VX Ace. If you ARE using VX, any answers given here would probably not work for you.
This has been the most fun I have had, reading this thread front to back, in a long time! Woo Hoo!

Where did you get all this info? I can't find it in the help files or anything.

Well, I was gonna add what Cel posted already in her reply: (cuz I sure didn't know it!)

when I saw it here

$game_player.moving?

(replying to

"Can someone consolidate all of these script call equivalents? I wanted to get the one for self_switches yesterday and it took me a while to find it.. it's in there somewhere and I know the answer to my question now (it's soooooo handy to be able to check and set self_switches on other events) but it would be handy to have all this information in a concise and consolidated format."

I will soonish after I get some stuff sorted out.

And thanks for all the help so far guys! You guys rock <3
Archeia, would you like some help with this? I'd enjoy getting away fro resources and getting my head into some coding-type thinking for a bit. I could compile some of the list, and you could check up on me and make sure I was keeping things properly organized (since I am completely new to this angle in RPG Maker.)

No problem if you wanted to do it yourself; I am not offended at all! =] But it would be fun for me, if it would help you.

and, again, Thanks, everyone! Takes me back to my old coding days, and starts me out where I can understand things. [=

from first page

Spoiler
from"Celianna" post="67216"

$game_player.moving?
Code:
Input.trigger?(Input::A)
**************************************from"Galv" post="67235"

Call Common Event:

$game_temp.reserve_common_event(id)Play SE/ME/BGS/BGM:
Code:
RPG::SE.new("SE Name", volume, pitch).playRPG::ME.new("ME Name", volume, pitch).playRPG::BGS.new("BGS Name", volume, pitch).playRPG::BGM.new("BGM Name", volume, pitch).play
Show Text:
Code:
$game_message.add("Text")
Gain/lose Item:
Code:
$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.gatherChange Player Followers:
Code:
$game_player.followers.visible = true or false
Erase Event:
Code:
$game_map.events[event_id].erase
Some conditional script calls to add to Celianna's:Button pressing

Input.repeat?🙂A)Input.press?🙂A)Movement
Code:
$game_player.dash?$game_player.jumping?$game_map.events[event_id].moving?$game_map.events[event_id].jumping?
Location
Code:
$game_map.events[event_id].x$game_map.events[event_id].y$game_player.x$game_player.y
Remove Actor
Code:
$game_party.remove_actor(actor_id)
Add Actor
Code:
$game_party.add_actor(actor_id)
Remove Party Member from position (where x = party position. 0 = 1st member, 1 = 2nd member, etc.)
Code:
m = $game_party.members$game_party.remove_actor(m[x].id)
***************************************from"Nicke" post="67328"

If you ever wanted to add every item/skills/weapons for debugging purpose (or something else?) it can be kind of tedious to add them all if you have alot. This small script call will help immensely:

$data_items.each { |i|next if i.nil? or i.name == ""$game_party.gain_item(i, 99)}Of course, if you want you can change $data_items to $data_weapons or something else and the amount you want.When checking for input triggers/pressing you can actually shorten that a bit:

Input.trigger?🙂CTRL)There is no need to write Input::CTRL anymore.To get the leader of the party you can do this:

$game_party.leaderGain/lose gold:
Code:
$game_party.gain_gold(amount)$game_party.lose_gold(amount)
Check for current max gold:
Code:
$game_party.max_gold
Get map id and name:
Code:
$game_map.map_id$game_map.name
To correct the screen shake bug thing do the following at Game_Interpreter:
Code:
def command_225screen.start_shake(@params[0], @params[1], @params[2])wait(@params[2]) if @params[2]end
Now it will wait the right amount of frames and not 5.***************************************

from "Archeia" post="68234"

Regions

$game_player.region_id == n$game_map.events[event_id].region_id == nfrom "Archeia" post="70304"Show Choices

params = []choices = []choices.push("choice 1")choices.push("choice 2")params.push(choices)params.push(0/1/2 this part is where you press cancel and which choice to default)setup_choices(params)**************************from"Tsukihime" post="72374"

It is pretty easy to fake the When [**] command (402).

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**************************
from second page

Spoiler
from"Napoleon" post="85069"

change the text dialog background:

$game_message.background = 1 #0 = default blue, 1 = dim, 2 = transparent Equip weapon

$game_actors[1].change_equip(0,$data_weapons[1])the 0 value in the above code snippet can have the following values:0 = weapon

1 = shield

2 = headgear

3 = body-gear (armor)

4 = accessory

Transfer player

$game_player.reserve_transfer(map_id, x, y, $game_player.direction)*************** from "Shaz" post="92817"

$game_player.followers.visible = true or false

*************
from the third page

Spoiler
from "Galv" post="97738"

If you're on the map scene you can use:

wait(x)*****************from "Shaz" post="99040"

Audio.se_play(name, volume, pitch)

where name is Audio/SE/filename without the extension. Volume and Pitch are optional. So to play Door1.ogg you'd use Audio.se_play('Audio/SE/Door1')

from "Shaz" post="99322"

$game_actors[id].weapons gives you an array of currently equipped weapons (the actual weapon object itself, not just the id). Usually there'd only be one, but it's possible to have a weapon in each hand.

So to figure out how many they have equipped, you'd use $game_actors[id].weapons.size, and if that is > 0, you can use $game_actors[id].weapons[0].id to figure out what the weapon is. And if size is 2, you could use $game_actors[id].weapons[1].id to get the second weapon. If size is 0, obviously they don't have a weapon equipped at all.

If you want to check if they have a particular weapon equipped (the equivalent of the Conditional Branch: [Actor] is [Weapon] Equipped, you would do this:

$game_actors[actor id].weapons.include?($data_weapons[weapon id])from "Shaz" post="99443"$game_self_switches[[mapid, eventid, 'A']] = true

Make sure you use [[...]] and not just [...]

******************

from "Napoleon" post="100756"

I'm not sure if it was posted already but to get the currency unit set from the system tab:

$data_system.currency_unit***************from "Kaelan" post="105988"

For any equipment, you can use this:

  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  endOr get their properties with with
Code:
  right_hand.id  right_hand.name  right_hand.icon_index  right_hand.description  # etc..
 i.e. if you want to check if you have a Prinny Gun equipped on your first weapon slot: 
Code:
  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.***************

from "Tahlan" post="106270" timestamp="1362877140"]

Showing a text box with pure script

$game_message.position = X

0 -Top

1- Middle

2- Bottom

$game_message.background = X

0 - Normal

1 - Faded

2 - Transparent

$game_message.face_name = 'Actor1' <- Name of the graphic plate

$game_message.face_index = 0 <- Position in the plate of the face you are using.

$game_message.face_name = 'Actor1'$game_message.face_index = 0$game_message.background = 2$game_message.position = 0$game_message.add("Text")****************
from the fourth page

Spoiler
by "Sicine" post="119842"

I think this (and the first example) is missing a dot after [index]. I think it should read: 

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

***************************

by "HalestormXV" post="121638"

I'd like to add a little bit to the list as well.

$game_map.passable?(X, Y, D)This lets you determine is a tile is passable or not. I use this for a teleport skill done via common events.***************************

 by "Shaz" post="121652"

$game_player.passable?(x, y, d) and $game_map.events[event_id].passable?(x, y, d)

are extensions to this that do a little more detailed checking.

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

*********************

 by "Galv" post="121895"

You can check an actor's current hp with:

$game_actors[x].hpOr the leader's current hp:
Code:
$game_party.leader.hp
Or a member of the party:
Code:
$game_party.members[x].hp
********************** by "Shaz" post="122197"

Best way to find the script equivalent of something you can do in events is to look through the Game_Interpreter script and search for the event that does it, then decide how the script needs to be changed (because the interpreter uses parameters for the numbers you want to input).

Here's the script from Game_Interpreter that places the quantity of an item into a variable:

$game_party.item_number($data_items[param1])So you'd just change param1 to the item id you're interested in, and add your condition around it:
Code:
if $game_party.item_number($data_items[32]) == 15
Checking how many of a particular type of weapon or armor is very similar:
Code:
$game_party.item_number($data_weapons[param1])$game_party.item_number($data_armors[param1])
************************
fifth page

Spoiler
by "FiXato" post="123079"

And two more:

Recover All for your entire party:

@params = [0, 0]command_314Show a named animation (in this case 'Sleep') for the player and wait for it to end:

Code:
animation_name = 'Sleep'animation_id = $data_animations.find_index{|ani|ani && ani.name == animation_name}@params = [-1, animation_id, true]command_212
Note that you don't need to use the game variables to get the current x and y position of the player:
Code:
$game_player.x$game_player.y
are the script equivalents of the player's current coordinates. 🙂 ****************************

by "Shaz" post="124337" timestamp="1366921713"]

Similarly,

$game_map.events[id].x$game_map.events[id].ygive you the event's coordinates in script, without having to use variables. Event id should not have leading zeros - so EV006 would just be written as [6]***************************

by "Tsukihime" post="124923"

but if you're trying to hide followers (and for whatever reason you can't just use the event command that does this)

$game_player.followers.visible = false***************************
sixth and seventh page

Spoiler
by "Shaz" post="136858"

if calling using a Script in a move route, just type animation_id = #.

If calling using a Call Script event command, type $game_map.events[eventid].animation_id = #

where eventid is the id of the event (exclude any leading zeros - type 2 instead of 0002), and # is the id of the animation (again exclude leading zeros).

*****************

by "seita" post="136861"

Call Script for the equivalent of a "Set Move Route Turn Left/Up/Right/Down" for an Event?

$game_map.events[eventid].set_direction(#)

2 = down, 4 = left, 6 = right, 8 = up.

***************************

by"Shaz" post="137064"

change the back_opacity of a message window - option 1

You just say @windowname.back_opacity = value

But you have to do it in the scene that's calling the window, not in the window class itself. At least, that's the only way I've ever been able to get it to work.

*************

by "Nicke" post="137102"

change the back_opacity of a message window - option 2

Can't you use this in the window class? I just tried it in Window_Message and said code worked for me.

self.back_opacity = value*******************by="Shaz" post="137448"

Show Balloon Icon event within a Move Route event over a non-player event

If your move route is for the event you want the balloon to appear on,

just add balloon_id = #.

If it's for a different event,

add $game_map.events[eventid].balloon_id = #

where # is the row of the balloon spritesheet you want to show (I think the top row is 1, not 0), and eventid is the id of the event, with no leading zeros.

etype will just tell you if it's a weapon or a certain type of armor.

If you want a certain type of weapon, you'd look at weapons rather than equips, and you'd check the weapon's wtype_id.

**************

by "Shaz" post="137610"

$game_player.direction

2 = down

4 = left

6 = right

8 = up

so

$game_player.direction==2

Would provide a true if player was facing down

To find a character's position in the party

$game_actors[id].index

where id is the actor id, and index is their position (0 is the leader).

***************

by "Racheal" post="145365"

$game_party.leader.id == n

where n is their position in the database.

***************
haha - they come from reading the scripts. In particular, Game_Interpreter has the basics of every command that you can see when you are looking at the list of event command buttons. In some cases, you have to figure a few extra things out (if it's a character, is it a particular event, 'this' event, or the player?), and on the odd occasion you have to look at the other classes to see what parameters are getting sent into the methods.
Okay, this is all of the script call equivalents posted here, I think, but I really do not know how to go about organizing them intelligently.

I can't promise that there are no repeats.

But if someone will give me some direction, I'll be glad to do the work of sorting them.

original post list

Spoiler
Variables

$game_variables[n]Switches
Code:
$game_switches[n]
Conditional Branch
Code:
if #something#somethingelse#somethingend
Show Picture
Code:
screen.pictures[index].show(file_name, upperleft/center, x, y, x zoom, y zoom, opacity, blend type)
Move Picture
Code:
screen.pictures[n].move(0/1 (top left or center), x, y, zoom1, zoom2, opacity, blend type (0,1, 2), wait)
Picture Tone
Code:
screen.pictures[n].start_tone_change(Tone.new(0, 0, 0, 0), wait)
Looping
Code:
For#somethingend
Move Event
Code:
move_route = RPG::MoveRoute.newmove_route.repeat = falsemove_route.skippable = truem = RPG::MoveCommand.newm.code = 45 #The List of M Code can be found over Game_Character, this current m.code is call scriptm.parameters = ["script call here"]move_route.list.insert(0,m.clone)$game_player.force_move_route(move_route)
Transfer Event Location
Code:
$game_map.events[id].moveto(new_x, new_y)
Transfer Player
Code:
$game_player.reserve_transfer(map_id, x, y, direction)
Screen Tint
Code:
t = Tone.new(red,green,blue, gray)screen.start_tone_change(t, duration)
Shake Screen
Code:
@params = []@params[0] = power or $game_variables[x]@params[1] = speed or $game_variables[y]@params[2] = duration or $game_variables[z]
Note: (Neonblack and Fomar0153 found this glitch!)The shake screen has an option in the editor where you can add a "wait" or not. But the glitch involves that it will wait no matter what. But it will only wait a number of frames equal to whatever the speed is set to the default option. For example, the setting is 5 power, 5 speed, 60 frames, and wait. It will wait for 5 frames, no matter what.
remainder of first page

Spoiler
from"Celianna" post="67216"

$game_player.moving?
Code:
Input.trigger?(Input::A)
**************************************from"Galv" post="67235"

Call Common Event:

$game_temp.reserve_common_event(id)Play SE/ME/BGS/BGM:
Code:
RPG::SE.new("SE Name", volume, pitch).playRPG::ME.new("ME Name", volume, pitch).playRPG::BGS.new("BGS Name", volume, pitch).playRPG::BGM.new("BGM Name", volume, pitch).play
Show Text:
Code:
$game_message.add("Text")
Gain/lose Item:
Code:
$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.gatherChange Player Followers:
Code:
$game_player.followers.visible = true or false
Erase Event:
Code:
$game_map.events[event_id].erase
Some conditional script calls to add to Celianna's:Button pressing

Input.repeat?🙂A)Input.press?🙂A)Movement
Code:
$game_player.dash?$game_player.jumping?$game_map.events[event_id].moving?$game_map.events[event_id].jumping?
Location
Code:
$game_map.events[event_id].x$game_map.events[event_id].y$game_player.x$game_player.y
Remove Actor
Code:
$game_party.remove_actor(actor_id)
Add Actor
Code:
$game_party.add_actor(actor_id)
Remove Party Member from position (where x = party position. 0 = 1st member, 1 = 2nd member, etc.)
Code:
m = $game_party.members$game_party.remove_actor(m[x].id)
***************************************from"Nicke" post="67328"

If you ever wanted to add every item/skills/weapons for debugging purpose (or something else?) it can be kind of tedious to add them all if you have alot. This small script call will help immensely:

$data_items.each { |i|next if i.nil? or i.name == ""$game_party.gain_item(i, 99)}Of course, if you want you can change $data_items to $data_weapons or something else and the amount you want.When checking for input triggers/pressing you can actually shorten that a bit:

Input.trigger?🙂CTRL)There is no need to write Input::CTRL anymore.To get the leader of the party you can do this:

$game_party.leaderGain/lose gold:
Code:
$game_party.gain_gold(amount)$game_party.lose_gold(amount)
Check for current max gold:
Code:
$game_party.max_gold
Get map id and name:
Code:
$game_map.map_id$game_map.name
To correct the screen shake bug thing do the following at Game_Interpreter:
Code:
def command_225screen.start_shake(@params[0], @params[1], @params[2])wait(@params[2]) if @params[2]end
Now it will wait the right amount of frames and not 5.***************************************

from "Archeia" post="68234"

Regions

$game_player.region_id == n$game_map.events[event_id].region_id == nfrom "Archeia" post="70304"Show Choices

params = []choices = []choices.push("choice 1")choices.push("choice 2")params.push(choices)params.push(0/1/2 this part is where you press cancel and which choice to default)setup_choices(params)**************************from"Tsukihime" post="72374"

It is pretty easy to fake the When [**] command (402).

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**************************
from second page

Spoiler
from"Napoleon" post="85069"

change the text dialog background:

$game_message.background = 1 #0 = default blue, 1 = dim, 2 = transparent Equip weapon

$game_actors[1].change_equip(0,$data_weapons[1])the 0 value in the above code snippet can have the following values:0 = weapon

1 = shield

2 = headgear

3 = body-gear (armor)

4 = accessory

Transfer player

$game_player.reserve_transfer(map_id, x, y, $game_player.direction)*************** from "Shaz" post="92817"

$game_player.followers.visible = true or false

*************
from the third page

Spoiler
from "Galv" post="97738"

If you're on the map scene you can use:

wait(x)*****************from "Shaz" post="99040"

Audio.se_play(name, volume, pitch)

where name is Audio/SE/filename without the extension. Volume and Pitch are optional. So to play Door1.ogg you'd use Audio.se_play('Audio/SE/Door1')

from "Shaz" post="99322"

$game_actors[id].weapons gives you an array of currently equipped weapons (the actual weapon object itself, not just the id). Usually there'd only be one, but it's possible to have a weapon in each hand.

So to figure out how many they have equipped, you'd use $game_actors[id].weapons.size, and if that is > 0, you can use $game_actors[id].weapons[0].id to figure out what the weapon is. And if size is 2, you could use $game_actors[id].weapons[1].id to get the second weapon. If size is 0, obviously they don't have a weapon equipped at all.

If you want to check if they have a particular weapon equipped (the equivalent of the Conditional Branch: [Actor] is [Weapon] Equipped, you would do this:

$game_actors[actor id].weapons.include?($data_weapons[weapon id])from "Shaz" post="99443"$game_self_switches[[mapid, eventid, 'A']] = true

Make sure you use [[...]] and not just [...]

******************

from "Napoleon" post="100756"

I'm not sure if it was posted already but to get the currency unit set from the system tab:

$data_system.currency_unit***************from "Kaelan" post="105988"

For any equipment, you can use this:

  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  endOr get their properties with with
Code:
  right_hand.id  right_hand.name  right_hand.icon_index  right_hand.description  # etc..
 i.e. if you want to check if you have a Prinny Gun equipped on your first weapon slot: 
Code:
  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.***************

from "Tahlan" post="106270" timestamp="1362877140"]

Showing a text box with pure script

$game_message.position = X

0 -Top

1- Middle

2- Bottom

$game_message.background = X

0 - Normal

1 - Faded

2 - Transparent

$game_message.face_name = 'Actor1' <- Name of the graphic plate

$game_message.face_index = 0 <- Position in the plate of the face you are using.

$game_message.face_name = 'Actor1'$game_message.face_index = 0$game_message.background = 2$game_message.position = 0$game_message.add("Text")****************
from the fourth page

Spoiler
by "HalestormXV" post="121638"

I'd like to add a little bit to the list as well.

$game_map.passable?(X, Y, D)This lets you determine is a tile is passable or not. I use this for a teleport skill done via common events.***************************

 by "Shaz" post="121652"

$game_player.passable?(x, y, d) and $game_map.events[event_id].passable?(x, y, d)

are extensions to this that do a little more detailed checking.

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

*********************

 by "Galv" post="121895"

You can check an actor's current hp with:

$game_actors[x].hpOr the leader's current hp:
Code:
$game_party.leader.hp
Or a member of the party:
Code:
$game_party.members[x].hp
********************** by "Shaz" post="122197"

Best way to find the script equivalent of something you can do in events is to look through the Game_Interpreter script and search for the event that does it, then decide how the script needs to be changed (because the interpreter uses parameters for the numbers you want to input).

quantity of an item into a variable:

if $game_party.item_number($data_items[32]) == 15Checking how many of a particular type of weapon or armor is very similar:
Code:
$game_party.item_number($data_weapons[param1])$game_party.item_number($data_armors[param1])
************************
fifth page

Spoiler
by "FiXato" post="123079"

And two more:

Recover All for your entire party:

@params = [0, 0]command_314Show a named animation (in this case 'Sleep') for the player and wait for it to end:

Code:
animation_name = 'Sleep'animation_id = $data_animations.find_index{|ani|ani && ani.name == animation_name}@params = [-1, animation_id, true]command_212
Note that you don't need to use the game variables to get the current x and y position of the player:
Code:
$game_player.x$game_player.y
are the script equivalents of the player's current coordinates. 🙂 ****************************

by "Shaz" post="124337" timestamp="1366921713"]

Event Location - $game_map.events

$game_map.events[id].x$game_map.events[id].ygive you the event's coordinates in script, without having to use variables. Event id should not have leading zeros - so EV006 would just be written as [6]***************************

by "Tsukihime" post="124923"

but if you're trying to hide followers (and for whatever reason you can't just use the event command that does this)

$game_player.followers.visible = false***************************
sixth and seventh page

Spoiler
by "Shaz" post="136858"

Showing an animation on an event - $game_map.events

if calling using a Script in a move route, just type animation_id = #.

If calling using a Call Script event command, type $game_map.events[eventid].animation_id = #

where eventid is the id of the event (exclude any leading zeros - type 2 instead of 0002), and # is the id of the animation (again exclude leading zeros).

Show Balloon Icon event within a Move Route over an event - $game_map.events

If your move route is for the event you want the balloon to appear on,

just add balloon_id = #.

If it's for a different event,

add $game_map.events[eventid].balloon_id = #

where # is the row of the balloon spritesheet you want to show (I think the top row is 1, not 0), and eventid is the id of the event, with no leading zeros.

*****************

by "seita" post="136861"

Set Move Route Turn Left/Up/Right/Down" for an Event - $game_map.events

$game_map.events[eventid].set_direction(#)

2 = down, 4 = left, 6 = right, 8 = up.

***************************

by"Shaz" post="137064"

change the back_opacity of a message window - option 1

You just say @windowname.back_opacity = value

But you have to do it in the scene that's calling the window, not in the window class itself. At least, that's the only way I've ever been able to get it to work.

*************

by "Nicke" post="137102"

change the back_opacity of a message window - option 2

Can't you use this in the window class? I just tried it in Window_Message and said code worked for me.

self.back_opacity = value*******************by="Shaz" post="137448"

etype will just tell you if it's a weapon or a certain type of armor.

If you want a certain type of weapon, you'd look at weapons rather than equips, and you'd check the weapon's wtype_id.

**************

by "Shaz" post="137610"

$game_player.direction

2 = down

4 = left

6 = right

8 = up

so

$game_player.direction==2

Would provide a true if player was facing down

To find a character's position in the party

$game_actors[id].index

where id is the actor id, and index is their position (0 is the leader).

***************

by "Racheal" post="145365"

$game_party.leader.id == n

where n is their position in the database.

***************
Thank you so much GrandmaDeb, I'll organize this soon after I'm done with work stuffs <3
I have split out way too many posts from here in the last few days. This thread is for EQUIVALENTS OF EVENT COMMANDS. If you CANNOT do what you want to do via the existing event commands, then your question DOES NOT BELONG IN THIS THREAD. Please don't clutter it up with "how do I do something that I CAN'T currently do via events" questions.
[...]

**************************************

from"Galv" post="67235"

Call Common Event:

$game_temp.reserve_common_event(id)[...]
This is actually not an exact equivalent to the "Call Common Event" command.

By using this script command you only reserve the common event for execution. Unlike the event command this will not suspend the calling event and the called common event won't start while another main event is running ("main event" means any event not triggered by "Parallel Process").

Another proposal:

@params = [ 91 ]; command_117(You may replace "91" by the common events ID)

However, this code might not work outside of the "Script...", "Conditional Branch" or "Control Variables" commands.
i want to contribute :")
 
Input Number:

Spoiler
i = (how many digits)x = (variable container)
$game_message.num_input_variable_id = x
$game_message.num_input_digits_max = i
Fiber.yield while $game_message.busy?
little edit.
did you test that?
Is there a function that checks if an ME is still playing?

Original thread: https://forums.rpgmakerweb.com/threads/script-call-equivalent-of-events.6248/