SephirothSpawn
Sponsor
RGSS/RGSS2 Support Forum
Introduction:
This topic is for questions that are frequently asked, since the beginning of the forums. Feel free to post questions you believe deserve to be put into the FAQ. The staff will add it to the main post and delete your post (to keep things clean).
If there is a topic discussing the question at hand, a link to the topic would be helpful, as it could possibly provide more support.
If someone asks for something that is in this FAQ, and you are sure of it, simply copy and paste the FAQ link in the thread. Do not say, "search for it", or anything. Just provide the link (This is to prevent confrontation).
RGSS(RMXP) Questions:
Once the FAQ has more questions, the questions will then be divided up accordingly.
Code:
 $game_temp.player_transferring = true
 $game_temp.player_new_map_id = #
 $game_temp.player_new_x = #
 $game_temp.player_new_y = #
 $game_temp.player_new_direction = #
 $scene = Scene_Map.new
 $game_map.autoplay
Code:
 $game_map.events[event_id]
Insert the following code somewhere above main:
Now, use this as your script call:
Code:
class Game_Character
 attr_accessor :character_name
 attr_accessor :character_hue
end
Code:
 $game_map.events[event_id].character_name = 'filename'
 $game_map.events[event_id].character_hue = 0..360
Code:
 key = [map_id, event_id, switch]
 $game_self_switches[key] = boolean
 $game_map.need_refresh = true
 map_id - Map Id
 event_id - Event Id
 switch - 'A', 'B', 'C', or 'D'
 boolean - true or false
Code:
# Variables
$game_variables[variable_id] = value
# Switches
$game_switches[switch_id] = boolean
http://rmxp.org/forums/http://dev.rmxp.org/forums/viewtopic.php?p=126935#p126935
Code:
# Test for Number of Items
n = $game_party.item_number(item_id)
# Test for Number of Weapons
n = $game_party.weapon_number(weapon_id)
# Test for Number of Armors
n = $game_party.armor_number(armor_id)
Code:
# If On Map : Replace id with common event id
$game_temp.common_event_id = id
# If in Battle : Replace id with common event id
common_event = $data_common_events[id]
$game_system.battle_interpreter.setup(common_event.list, 0)
Code:
class Sprite_Timer < Sprite
 alias_method :sprite_timer_update, :update
 def update
  sprite_timer_update
  # Conditions to hide the timer (switch, $game_temp.in_battle etc.)
  if $game_switches[switch_id] == true
   # Hide the timer
   self.visible = false
  end
 end
end
Code:
 $game_temp.shop_goods = []
 $game_temp.shop_goods << [item_type, item_id]
 # item type = 0 : Items, 1 : Weapons, 2 : Armors
 # Repeat until you add all your items
 $scene = Scene_Shop.new
Insert the following code somewhere above main:
Now, to change the players move speed, use:
To change events move speed, use:
Code:
class Game_Character
 attr_accessor :move_speed
end
Code:
 $game_player.move_speed = n
Code:
 $game_map.events[event_id].move_speed = n
Code:
 self.contents.draw_text(x_pos, y_pos, width, height, text, align)
 0 = Left
 1 = Center
 2 = Right
By default align is set to left.
If there were no installation directions provided or the ones that were, seem vague. Do as follows. First open your project, then your script editor(F11, the shortcut key). Insert an empty section in the script listing by right clicking 'Main' and selecting 'Insert'. Copy the text from the custom script document you want to install. Paste this code that was just copied into the large empty section on the right known as the code panel. Lastly go back to the listing of script on the left and name the section something informative and memorable for the script.
A picture of where your script will most likely go:
A picture of where your script will most likely go:
RGSS2(RMVX) Questions:
If your question was found above but not below this heading than most likely the answer still applies for RGSS2.
Code:
 # What map to create?
$game_map.setup(map_id)
# Map position
$game_player.moveto(x, y)
$game_player.refresh
$scene = Scene_Map.new
$game_map.autoplay
Code:
 # Test for Number of Items
n = $game_party.item_number($data_items[item_id])
# Test for Number of Weapons
n = $game_party.item_number($data_weapons[weapon_id])
# Test for Number of Armors
n = $game_party.item_number($data_armors[armor_id])
Code:
 # If On Map : Replace id with common event id
 Script : $game_map.common_event_id = id
 # If in Battle : Replace id with common event id
 Script : common_event = $data_common_events[id]
 $game_troop.interpreter.setup(common_event.list, 0)
If there were no installation directions provided or the ones that were, seem vague. Do as follows. First open your project, then your script editor(F11, the shortcut key). Insert an empty section in the script listing by right clicking 'Insert Here' and selecting 'Insert'. Copy the text from the custom script document you want to install. Paste this code that was just copied into the large empty section on the right known as the code panel. Lastly go back to the listing of script on the left and name the section something informative and memorable for the script.
A picture of where your script will most likely go:
A picture of where your script will most likely go:
Format For Submitting to FAQ
Q.
Topic Link: http://www.rmxp.org/forums/
Please make questions in question format, if possible.
Please provide a link to topic, if possible.
Please use code tags when supplying code.
khmp: Cleaned up the thread. 4/24/08