Script Call Equivalent of Events

Status
Not open for further replies.

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
Very helpful thread. Thank you for this! BD
 

Necrofear04

Variemai...
Veteran
Joined
Nov 5, 2012
Messages
38
Reaction score
2
First Language
Greek
Primarily Uses
Is there a script call for the "Wait x frames" feature?
 

Galv

Veteran
Veteran
Joined
Oct 1, 2012
Messages
1,306
Reaction score
1,575
First Language
English
Primarily Uses
RMMZ
If you're on the map scene you can use:

Code:
wait(x)
 

mary674

Veteran
Veteran
Joined
Jul 6, 2012
Messages
42
Reaction score
2
First Language
French
Primarily Uses
What would be the script call to play a sound effect, if there is one? Thank you!
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
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')
 

mary674

Veteran
Veteran
Joined
Jul 6, 2012
Messages
42
Reaction score
2
First Language
French
Primarily Uses
Thank you very much... another question: How do I determine what weapon my actor currently has equipped?
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
$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:

Code:
$game_actors[actor id].weapons.include?($data_weapons[weapon id])
 
Last edited by a moderator:

Tahlan

Veteran
Veteran
Joined
Jan 3, 2013
Messages
53
Reaction score
1
First Language
English
Primarily Uses
I am working on trying to change the the self switch of one event with another event.  AKA I want to change / enable self switch A on event 1 from event 2.  I think the answer to my problem lies in this code. Im just not smart enough yet to decode it in to a usable script.

key = [@map_id, @event_id, @params[1]]  result = ($game_self_switches[key] == (@params[2] == 0)) Its it takes in the event id so it seems I should be able to call it and alter any self switch of any event from any event.
 

say.id

Event Designer
Member
Joined
Feb 13, 2013
Messages
6
Reaction score
0
First Language
Bahasa
Primarily Uses
i'm trying to make my actor to use same skill for 5 turns. but his/her id come from variables.

how about force battle action with script call??
 

Napoleon

Veteran
Veteran
Joined
Dec 29, 2012
Messages
869
Reaction score
97
First Language
Dutch
Primarily Uses
I'm not sure if it was posted already but to get the currency unit set from the system tab:

Code:
$data_system.currency_unit
 

Tahlan

Veteran
Veteran
Joined
Jan 3, 2013
Messages
53
Reaction score
1
First Language
English
Primarily Uses
Using this script how would you disable / enable the fade effect?

Code:
$game_player.reserve_transfer(map_id, x, y, direction)
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
These are the Interpreter commands that initiate a transfer:

$game_player.reserve_transfer(map_id, x, y, @params[4]) $game_temp.fade_type = @params[5] Fiber.yield while $game_player.transfer?You'll see the fade is set on the line AFTER the reserve_transfer command. Since the fade types are Normal, White and None, I would start by assuming @params[5] would be either 0, 1 or 2 respectively.

So try this:

Code:
    $game_player.reserve_transfer(map_id, x, y, direction)    $game_temp.fade_type = 2 # No fade
 
Last edited by a moderator:

ct_bolt

Creator
Veteran
Joined
May 3, 2012
Messages
954
Reaction score
520
First Language
Javascript
Primarily Uses
RMMZ
$game_temp.reserve_common_event(id)Galv mentioned this. It seems to work really well but I have question with this. Sorry i realize this is a pretty old thread.I noticed that the code wont wait for a common event to finish before moving on to the next line of code. Is there a way to force it so the common event completely finishes before executing

any of the code afterwords?
load scene call
I don't know what that means & I need to do this also. Can someone post the actual code for that?
 
Last edited by a moderator:

Kaelan

Veteran
Veteran
Joined
May 14, 2012
Messages
797
Reaction score
537
First Language
Portuguese
Primarily Uses
RMMV
$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])
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

  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: 

  right_hand = $game_actors[actor_id].equips[0]  if !right_hand.nil? && right_hand.name.eql?("Prinny Gun")    # Do something  endYou 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.
 

Tahlan

Veteran
Veteran
Joined
Jan 3, 2013
Messages
53
Reaction score
1
First Language
English
Primarily Uses
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.

Code:
$game_message.face_name = 'Actor1'$game_message.face_index = 0$game_message.background = 2$game_message.position = 0$game_message.add("Text")
 
Last edited by a moderator:

TheCastle

Veteran
Veteran
Joined
Apr 2, 2012
Messages
150
Reaction score
2
First Language
English
Primarily Uses
I am writing a message system that allows me to easily display an image and localized text right now using information on this thread. I am wondering if its possible to flip an image backwards so that I can have separate functions for having face graphics appear on either side of the screen without having to produce additional art assets. Anyone know?
 

Tsukihime

Veteran
Veteran
Joined
Jun 30, 2012
Messages
8,564
Reaction score
3,846
First Language
English
Sprite objects support flipping and rotation so you just need to figure out how to specify that an image should be flipped.
 

TheCastle

Veteran
Veteran
Joined
Apr 2, 2012
Messages
150
Reaction score
2
First Language
English
Primarily Uses
ok hmm Where to look now. Its gonna be in interpreter some place I imagine. Its kind of hard to lock down what does what because of how the code uses generic @params[] for almost every function in interpreter.

I am also getting stuck on how to specify the number of frames a "screen.pictures[300].move(0, 0, 0, 100, 100, 255, 0, 1)" Should wait.

on line 954 of game_interpreter it says something that should give me a clue


wait(@params[10]) if @params[11]

but I am not sure how to access @param[11]. If I attempt to I end up getting a too many arguments error. 9/8

There must be another function to set the number of frames to wait for a move.

Ok I figured out the wait problem. I had to do this.

    @params[11] = 1
    screen.pictures[300].move(0, 0, 0, 100, 100, 255, 0, 60)


ok all of a sudden this right here is working without having to specify anything more. I swear I tried that multiple times and it didn't work but its working now FML!!! XD

screen.pictures[300].move(0, 0, 0, 100, 100, 255, 0, 10)

Now to figure out where I can flip a picture. I tried simple stuff like setting the zoom to a negative number. Didn't seem to work.
 
Last edited by a moderator:

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
img = Sprite.new


img.mirror = true


I am not sure what the equivalent is if you're using a bitmap rather than a sprite.
 
Last edited by a moderator:
Status
Not open for further replies.

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,863
Messages
1,017,053
Members
137,571
Latest member
grr
Top