<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
	<channel>
		<title><![CDATA[Save-Point - RPGMaker XP (RGSS) Engine]]></title>
		<link>https://www.save-point.org/</link>
		<description><![CDATA[Save-Point - https://www.save-point.org]]></description>
		<pubDate>Mon, 27 Jul 2026 03:07:19 +0000</pubDate>
		<generator>MyBB</generator>
		<item>
			<title><![CDATA[KBuild XP]]></title>
			<link>https://www.save-point.org/thread-13628.html</link>
			<pubDate>Sun, 12 Jul 2026 01:13:10 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13628.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KBuild XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
Did you ever want to copy and paste tiles on a map?<br />
Did you ever plan to create your very own city builder (on a small scale)?<br />
Or did you ever dream on recreating your favorite Harvest Moon game?<br />
<br />
Well, now that might be possible! <img src="https://www.save-point.org/images/smilies/ejlol/grin.gif" alt="Grinning" title="Grinning" class="smilie smilie_25" /><br />
<img src="https://www.save-point.org/images/smilies/ejlol/sweathappy.gif" alt="Happy with a sweat" title="Happy with a sweat" class="smilie smilie_31" /> On a small scale at least. <img src="https://www.save-point.org/images/smilies/ejlol/laughing.gif" alt="Laughing" title="Laughing" class="smilie smilie_23" /> <br />
<br />
My scriptlet includes 3 useful script calls that might make it happen! <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /><br />
<br />
2 calls are used exclusively during the <img src="https://www.save-point.org/images/smilies/ejlol/sculptor.gif" alt="Sculptor" title="Sculptor" class="smilie smilie_224" /> development stage, while the remaining one can be used at any time. <img src="https://www.save-point.org/images/smilies/ejlol/grin.gif" alt="Grinning" title="Grinning" class="smilie smilie_25" /> <br />
<br />
By the way, it can also play a SE and some animation! <img src="https://www.save-point.org/images/smilies/ejlol/thumbs.gif" alt="Two Thumbs Up!" title="Two Thumbs Up!" class="smilie smilie_61" /> Both are optional.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KBuild XP * #<br />
#&nbsp;&nbsp; Scripter : Kyonides<br />
#&nbsp;&nbsp; v0.8.0 - 2026-07-26<br />
<br />
# This scriptlet allows you to copy and paste tiles on the fly on maps that<br />
# use the same tileset. It totally depends on script calls to work.<br />
<br />
# * Script Calls - 2 Stages * #<br />
# * Development Stage Only * #<br />
<br />
# - Copy a custom Area with Tiles on the current map for future calls.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; Setting a list of Layers allows you pick a combination of:<br />
#&nbsp;&nbsp;&nbsp;&nbsp; Layers 0, 1 or 2, identified as X, Y &amp; Z in the DB.<br />
# KBuild.set_build_area(AreaID, X, Y, Width, Height)<br />
# KBuild.set_build_area(AreaID, X, Y, Width, Height, Layers)<br />
<br />
# - Save all custom Areas with Tiles for future calls.<br />
# KBuild.save_buildings<br />
<br />
# * For Both Development Stage and Normal Gameplay * #<br />
<br />
# - Paste a custom Area with Tiles on the current map.<br />
#&nbsp;&nbsp; It will fail if both maps don't share the same tileset!<br />
# KBuild.build_area(BaseMapID, ThisMapID, AreaID, X, Y, Width, Height)<br />
<br />
module KBuild<br />
&nbsp;&nbsp;BUILDING_AREAS_FN = "Data/KBuildingAreas.rxdata"<br />
&nbsp;&nbsp;# Set the SE name or leave it empty<br />
&nbsp;&nbsp;BUILD_SE = "129-Earth01"<br />
&nbsp;&nbsp;# DB Animation ID or 0 for none<br />
&nbsp;&nbsp;BUILD_ANIME = 17<br />
&nbsp;&nbsp;@build_se = RPG::AudioFile.new(BUILD_SE, 50)<br />
&nbsp;&nbsp;extend self<br />
&nbsp;&nbsp;attr_accessor :building_areas<br />
&nbsp;&nbsp;def set_build_area(key, x, y, w, h, *layers)<br />
&nbsp;&nbsp;&nbsp;&nbsp;layers.flatten!<br />
&nbsp;&nbsp;&nbsp;&nbsp;area = [x, y, w, h]<br />
&nbsp;&nbsp;&nbsp;&nbsp;map_id = &#36;game_map.map_id<br />
&nbsp;&nbsp;&nbsp;&nbsp;b_area = @building_areas[map_id].areas[key]<br />
&nbsp;&nbsp;&nbsp;&nbsp;b_area.tileset_id = &#36;game_map.map.tileset_id<br />
&nbsp;&nbsp;&nbsp;&nbsp;b_area.table = &#36;game_map.area_tiles(key, area, layers)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def build_area(base_map_id, map_id, key, *area)<br />
&nbsp;&nbsp;&nbsp;&nbsp;b_area = @building_areas[base_map_id].areas[key]<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if &#36;game_map.map.tileset_id != b_area.tileset_id<br />
&nbsp;&nbsp;&nbsp;&nbsp;areas = &#36;game_system.built_areas[map_id]<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if areas.include?(key)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(@build_se) unless BUILD_SE.empty?<br />
&nbsp;&nbsp;&nbsp;&nbsp;map = &#36;game_system.dup_map(map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;if BUILD_ANIME &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interpreter = &#36;game_system.map_interpreter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event = interpreter.get_character(0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.animation_id = BUILD_ANIME<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;areas &lt;&lt; key<br />
&nbsp;&nbsp;&nbsp;&nbsp;map_table = map.data<br />
&nbsp;&nbsp;&nbsp;&nbsp;table = b_area.table<br />
&nbsp;&nbsp;&nbsp;&nbsp;min_x = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;min_y = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;width = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;height = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in b_area.layers<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width.times do |mx|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height.times do |my|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map_table[min_x + mx, min_y + my, i] = table[mx, my, i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_map.replace_data<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;class Area<br />
&nbsp;&nbsp;&nbsp;&nbsp;DEFAULT_LAYER_IDS = [0, 1, 2]<br />
&nbsp;&nbsp;&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@tileset_id = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@table = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@layers = DEFAULT_LAYER_IDS<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;attr_accessor :tileset_id, :table, :layers<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;class Map<br />
&nbsp;&nbsp;&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@areas = {}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@areas.default = Area.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;attr_reader :areas<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def save_buildings<br />
&nbsp;&nbsp;&nbsp;&nbsp;save_data(@building_areas, BUILDING_AREAS_FN)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def load_maps<br />
&nbsp;&nbsp;&nbsp;&nbsp;begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@building_areas = load_data(BUILDING_AREAS_FN)<br />
&nbsp;&nbsp;&nbsp;&nbsp;rescue<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@building_areas = {}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@building_areas.default = Map.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;load_maps<br />
end<br />
<br />
class Game_System<br />
&nbsp;&nbsp;alias :kyon_tiles_gm_sys_init :initialize<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;kyon_tiles_gm_sys_init<br />
&nbsp;&nbsp;&nbsp;&nbsp;@map_data = {}<br />
&nbsp;&nbsp;&nbsp;&nbsp;@built_areas = {}<br />
&nbsp;&nbsp;&nbsp;&nbsp;@built_areas.default = []<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def dup_map(map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@map_data[map_id] ||= &#36;game_map.map<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;attr_accessor :map_data, :built_areas<br />
end<br />
<br />
class Game_Map<br />
&nbsp;&nbsp;alias :kyon_tiles_gm_map_stp :setup<br />
&nbsp;&nbsp;def setup(map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;kyon_tiles_gm_map_stp(map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;replace_data<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def replace_data<br />
&nbsp;&nbsp;&nbsp;&nbsp;map_data = &#36;game_system.map_data<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless map_data.has_key?(@map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@map = map_data[@map_id]<br />
&nbsp;&nbsp;&nbsp;&nbsp;@need_refresh = true<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def area_tiles(key, area, layers)<br />
&nbsp;&nbsp;&nbsp;&nbsp;layers = [0, 1, 2] if layers.empty?<br />
&nbsp;&nbsp;&nbsp;&nbsp;min_x = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;min_y = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;width = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;height = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;table = Table.new(width, height, 3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;map_table = @map.data<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in layers<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width.times do |mx|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height.times do |my|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table[mx, my, i] = map_table[min_x + mx, min_y + my, i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;table<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def tileset_id<br />
&nbsp;&nbsp;&nbsp;&nbsp;@map.tileset_id<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;attr_reader :map<br />
end</code></div></div><br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: x-large;" class="mycode_size"><a href="https://www.mediafire.com/folder/nq1ox0s6rsx7r/KBuild" target="_blank" rel="noopener" class="mycode_url">DOWNLOAD DEMO HERE</a></span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Terms &amp; Conditions</span></span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Include my nickname in your game credits! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /><br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KBuild XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
Did you ever want to copy and paste tiles on a map?<br />
Did you ever plan to create your very own city builder (on a small scale)?<br />
Or did you ever dream on recreating your favorite Harvest Moon game?<br />
<br />
Well, now that might be possible! <img src="https://www.save-point.org/images/smilies/ejlol/grin.gif" alt="Grinning" title="Grinning" class="smilie smilie_25" /><br />
<img src="https://www.save-point.org/images/smilies/ejlol/sweathappy.gif" alt="Happy with a sweat" title="Happy with a sweat" class="smilie smilie_31" /> On a small scale at least. <img src="https://www.save-point.org/images/smilies/ejlol/laughing.gif" alt="Laughing" title="Laughing" class="smilie smilie_23" /> <br />
<br />
My scriptlet includes 3 useful script calls that might make it happen! <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /><br />
<br />
2 calls are used exclusively during the <img src="https://www.save-point.org/images/smilies/ejlol/sculptor.gif" alt="Sculptor" title="Sculptor" class="smilie smilie_224" /> development stage, while the remaining one can be used at any time. <img src="https://www.save-point.org/images/smilies/ejlol/grin.gif" alt="Grinning" title="Grinning" class="smilie smilie_25" /> <br />
<br />
By the way, it can also play a SE and some animation! <img src="https://www.save-point.org/images/smilies/ejlol/thumbs.gif" alt="Two Thumbs Up!" title="Two Thumbs Up!" class="smilie smilie_61" /> Both are optional.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KBuild XP * #<br />
#&nbsp;&nbsp; Scripter : Kyonides<br />
#&nbsp;&nbsp; v0.8.0 - 2026-07-26<br />
<br />
# This scriptlet allows you to copy and paste tiles on the fly on maps that<br />
# use the same tileset. It totally depends on script calls to work.<br />
<br />
# * Script Calls - 2 Stages * #<br />
# * Development Stage Only * #<br />
<br />
# - Copy a custom Area with Tiles on the current map for future calls.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; Setting a list of Layers allows you pick a combination of:<br />
#&nbsp;&nbsp;&nbsp;&nbsp; Layers 0, 1 or 2, identified as X, Y &amp; Z in the DB.<br />
# KBuild.set_build_area(AreaID, X, Y, Width, Height)<br />
# KBuild.set_build_area(AreaID, X, Y, Width, Height, Layers)<br />
<br />
# - Save all custom Areas with Tiles for future calls.<br />
# KBuild.save_buildings<br />
<br />
# * For Both Development Stage and Normal Gameplay * #<br />
<br />
# - Paste a custom Area with Tiles on the current map.<br />
#&nbsp;&nbsp; It will fail if both maps don't share the same tileset!<br />
# KBuild.build_area(BaseMapID, ThisMapID, AreaID, X, Y, Width, Height)<br />
<br />
module KBuild<br />
&nbsp;&nbsp;BUILDING_AREAS_FN = "Data/KBuildingAreas.rxdata"<br />
&nbsp;&nbsp;# Set the SE name or leave it empty<br />
&nbsp;&nbsp;BUILD_SE = "129-Earth01"<br />
&nbsp;&nbsp;# DB Animation ID or 0 for none<br />
&nbsp;&nbsp;BUILD_ANIME = 17<br />
&nbsp;&nbsp;@build_se = RPG::AudioFile.new(BUILD_SE, 50)<br />
&nbsp;&nbsp;extend self<br />
&nbsp;&nbsp;attr_accessor :building_areas<br />
&nbsp;&nbsp;def set_build_area(key, x, y, w, h, *layers)<br />
&nbsp;&nbsp;&nbsp;&nbsp;layers.flatten!<br />
&nbsp;&nbsp;&nbsp;&nbsp;area = [x, y, w, h]<br />
&nbsp;&nbsp;&nbsp;&nbsp;map_id = &#36;game_map.map_id<br />
&nbsp;&nbsp;&nbsp;&nbsp;b_area = @building_areas[map_id].areas[key]<br />
&nbsp;&nbsp;&nbsp;&nbsp;b_area.tileset_id = &#36;game_map.map.tileset_id<br />
&nbsp;&nbsp;&nbsp;&nbsp;b_area.table = &#36;game_map.area_tiles(key, area, layers)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def build_area(base_map_id, map_id, key, *area)<br />
&nbsp;&nbsp;&nbsp;&nbsp;b_area = @building_areas[base_map_id].areas[key]<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if &#36;game_map.map.tileset_id != b_area.tileset_id<br />
&nbsp;&nbsp;&nbsp;&nbsp;areas = &#36;game_system.built_areas[map_id]<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if areas.include?(key)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(@build_se) unless BUILD_SE.empty?<br />
&nbsp;&nbsp;&nbsp;&nbsp;map = &#36;game_system.dup_map(map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;if BUILD_ANIME &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;interpreter = &#36;game_system.map_interpreter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event = interpreter.get_character(0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;event.animation_id = BUILD_ANIME<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;areas &lt;&lt; key<br />
&nbsp;&nbsp;&nbsp;&nbsp;map_table = map.data<br />
&nbsp;&nbsp;&nbsp;&nbsp;table = b_area.table<br />
&nbsp;&nbsp;&nbsp;&nbsp;min_x = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;min_y = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;width = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;height = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in b_area.layers<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width.times do |mx|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height.times do |my|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;map_table[min_x + mx, min_y + my, i] = table[mx, my, i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_map.replace_data<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;class Area<br />
&nbsp;&nbsp;&nbsp;&nbsp;DEFAULT_LAYER_IDS = [0, 1, 2]<br />
&nbsp;&nbsp;&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@tileset_id = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@table = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@layers = DEFAULT_LAYER_IDS<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;attr_accessor :tileset_id, :table, :layers<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;class Map<br />
&nbsp;&nbsp;&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@areas = {}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@areas.default = Area.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;attr_reader :areas<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def save_buildings<br />
&nbsp;&nbsp;&nbsp;&nbsp;save_data(@building_areas, BUILDING_AREAS_FN)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def load_maps<br />
&nbsp;&nbsp;&nbsp;&nbsp;begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@building_areas = load_data(BUILDING_AREAS_FN)<br />
&nbsp;&nbsp;&nbsp;&nbsp;rescue<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@building_areas = {}<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@building_areas.default = Map.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;load_maps<br />
end<br />
<br />
class Game_System<br />
&nbsp;&nbsp;alias :kyon_tiles_gm_sys_init :initialize<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;kyon_tiles_gm_sys_init<br />
&nbsp;&nbsp;&nbsp;&nbsp;@map_data = {}<br />
&nbsp;&nbsp;&nbsp;&nbsp;@built_areas = {}<br />
&nbsp;&nbsp;&nbsp;&nbsp;@built_areas.default = []<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def dup_map(map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@map_data[map_id] ||= &#36;game_map.map<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;attr_accessor :map_data, :built_areas<br />
end<br />
<br />
class Game_Map<br />
&nbsp;&nbsp;alias :kyon_tiles_gm_map_stp :setup<br />
&nbsp;&nbsp;def setup(map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;kyon_tiles_gm_map_stp(map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;replace_data<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def replace_data<br />
&nbsp;&nbsp;&nbsp;&nbsp;map_data = &#36;game_system.map_data<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless map_data.has_key?(@map_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@map = map_data[@map_id]<br />
&nbsp;&nbsp;&nbsp;&nbsp;@need_refresh = true<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def area_tiles(key, area, layers)<br />
&nbsp;&nbsp;&nbsp;&nbsp;layers = [0, 1, 2] if layers.empty?<br />
&nbsp;&nbsp;&nbsp;&nbsp;min_x = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;min_y = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;width = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;height = area.shift<br />
&nbsp;&nbsp;&nbsp;&nbsp;table = Table.new(width, height, 3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;map_table = @map.data<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in layers<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;width.times do |mx|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;height.times do |my|<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;table[mx, my, i] = map_table[min_x + mx, min_y + my, i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;table<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;def tileset_id<br />
&nbsp;&nbsp;&nbsp;&nbsp;@map.tileset_id<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;attr_reader :map<br />
end</code></div></div><br />
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: x-large;" class="mycode_size"><a href="https://www.mediafire.com/folder/nq1ox0s6rsx7r/KBuild" target="_blank" rel="noopener" class="mycode_url">DOWNLOAD DEMO HERE</a></span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Terms &amp; Conditions</span></span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Include my nickname in your game credits! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /><br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Two-Stage Crafting]]></title>
			<link>https://www.save-point.org/thread-13620.html</link>
			<pubDate>Wed, 01 Jul 2026 13:48:46 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13620.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Two-Stage Crafting</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This system is designed for game developers who wish to make fixed crafting stations requiring the player  to move from one station to simulate the experience of actively working.<br />
<br />
There should be little confusion for the player  in how the crafting system operates.   One station is defined  to allow the player select  one or more pre-defined items in possession that are to be combined. And the other station requires the player to supply one more to finish the crafting service.<br />
<br />
The system can use 'DerVV's Tutorial Windows'  to bring up helpful one-time information screens. Optional, not manditory.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Physical stations to perform the work</li>
<li>Requires going between two stations simulating actual activity</li>
<li>Able to create multiple stations based on a linking ID value</li>
<li>Define type of items crafted by element tagging</li>
<li>Able to have multiple ways to create a singular item</li>
<li>Use of charactersets/tilest graphics to represent the crafting stations</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/q5ggsieyk9hmaybabgdtr5jk8punodm1" target="_blank" rel="noopener" class="mycode_url"><span style="color: #E82A1F;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">A Box.Com Demo link</span> </span></a> <span style="font-style: italic;" class="mycode_i"><span style="font-size: x-small;" class="mycode_size">In the Box.com page, the download button is in the top-right.</span></span><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty. A simple means to create crafting stations described, and each configuration option with their own separate instruction set.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Compatible with RPGMaker XP and has no rewrites.<br />
Compatible with <a href="showthread.php?tid=13619"><span style="text-decoration: underline;" class="mycode_u"><span style="font-style: italic;" class="mycode_i">DerVV's Tutorial Windows</span></span></a> to allow pop-up hint windows for each station at will.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Ace_V who supplied graphics for the Demo's Crafting Stations.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit is required.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Two-Stage Crafting</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This system is designed for game developers who wish to make fixed crafting stations requiring the player  to move from one station to simulate the experience of actively working.<br />
<br />
There should be little confusion for the player  in how the crafting system operates.   One station is defined  to allow the player select  one or more pre-defined items in possession that are to be combined. And the other station requires the player to supply one more to finish the crafting service.<br />
<br />
The system can use 'DerVV's Tutorial Windows'  to bring up helpful one-time information screens. Optional, not manditory.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Physical stations to perform the work</li>
<li>Requires going between two stations simulating actual activity</li>
<li>Able to create multiple stations based on a linking ID value</li>
<li>Define type of items crafted by element tagging</li>
<li>Able to have multiple ways to create a singular item</li>
<li>Use of charactersets/tilest graphics to represent the crafting stations</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/q5ggsieyk9hmaybabgdtr5jk8punodm1" target="_blank" rel="noopener" class="mycode_url"><span style="color: #E82A1F;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">A Box.Com Demo link</span> </span></a> <span style="font-style: italic;" class="mycode_i"><span style="font-size: x-small;" class="mycode_size">In the Box.com page, the download button is in the top-right.</span></span><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty. A simple means to create crafting stations described, and each configuration option with their own separate instruction set.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Compatible with RPGMaker XP and has no rewrites.<br />
Compatible with <a href="showthread.php?tid=13619"><span style="text-decoration: underline;" class="mycode_u"><span style="font-style: italic;" class="mycode_i">DerVV's Tutorial Windows</span></span></a> to allow pop-up hint windows for each station at will.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Ace_V who supplied graphics for the Demo's Crafting Stations.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit is required.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[DerVV's Tutorial Windows]]></title>
			<link>https://www.save-point.org/thread-13619.html</link>
			<pubDate>Wed, 01 Jul 2026 13:38:42 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13619.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">DerVV's Tutorial Windows</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This system allows you to create pop-up windows designed to give the player quick gameplay instructions,  whether it be simple movement instructions or more complex guides for devices, system mechanics or minigames.<br />
<br />
Being in-game tutorials, the window(s) will not close without player input.<br />
<br />
The system is designed  to let game developers use both map events or troop database events (such as inserted into Turn 0).  However, it is possible to adapt game mechanic scripts (lockpicking, quest system, etc) to include the tutorial system and allow pop-up help to appear upon their first execution.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Creates a window of custom size to display helpful text</li>
<li>Uses a text system similar to the message window</li>
<li>Track if a tutorial had already shown and prevent re-appearance</li>
<li>Instructions include how to inert into other custom scripts in need</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> TUT HERE</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** DerVV's Tutorial Windows<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;by DerVVulfman<br />
#&nbsp;&nbsp;&nbsp;&nbsp;version 1.0<br />
#&nbsp;&nbsp;&nbsp;&nbsp;07-01-2026 (mm/dd/yyyy)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;RGSS / RPGMaker XP<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;INTRODUCTION:<br />
#<br />
#&nbsp;&nbsp;This system allows you to create pop-up windows designed to give the player<br />
#&nbsp;&nbsp;quick gameplay instructions,&nbsp;&nbsp;whether it be simple movement instructions or<br />
#&nbsp;&nbsp;more complex guides for devices, system mechanics or minigames.<br />
#<br />
#&nbsp;&nbsp;Being in-game tutorials, the window(s) will not close without player input.<br />
#<br />
#&nbsp;&nbsp;The system is designed&nbsp;&nbsp;to let game developers use both map events or troop<br />
#&nbsp;&nbsp;database events (such as inserted into Turn 0).&nbsp;&nbsp;However, it is possible to<br />
#&nbsp;&nbsp;adapt game mechanic scripts (lockpicking, quest system, etc) to include the<br />
#&nbsp;&nbsp;tutorial system and allow pop-up help to appear upon their first execution.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;INSTALLATION:<br />
#<br />
#&nbsp;&nbsp;Place this script below Scene_Debug and above Main.&nbsp;&nbsp;Create a new Tutorials<br />
#&nbsp;&nbsp;subfolder within&nbsp;&nbsp;the project's Graphics folder&nbsp;&nbsp;if you plan to use graphic<br />
#&nbsp;&nbsp;images instead of basic text.<br />
#<br />
#&nbsp;&nbsp;IE:&nbsp;&nbsp;Graphics&#92;Tutorials<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;CONFIGURATION:<br />
#<br />
#&nbsp;&nbsp;The TutWindow module is where the game developer defines the basic settings<br />
#&nbsp;&nbsp;for all, or most all,&nbsp;&nbsp;tutorial windows.&nbsp;&nbsp;It is divided&nbsp;&nbsp;into two sections;<br />
#&nbsp;&nbsp;the Fixed Values section and the Flexible Values section.<br />
#<br />
#&nbsp;&nbsp;Fixed Values are the settings&nbsp;&nbsp;for the fonts&nbsp;&nbsp;used within all tutorial win-<br />
#&nbsp;&nbsp;dows and the vertical spacing&nbsp;&nbsp;for each line of text.&nbsp;&nbsp;There are no methods<br />
#&nbsp;&nbsp;to change these settings,&nbsp;&nbsp;and that is by intent&nbsp;&nbsp;as it is assumed that the<br />
#&nbsp;&nbsp;tutorial windows all share a matching and uniform appearance.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* FONTNAME:&nbsp;&nbsp; Here,&nbsp;&nbsp;the game deveoper sets either the font or an array<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of fonts used within the tutorial window.&nbsp;&nbsp;If an array is<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;used, the system will use the first within the array that<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;functions on the player's PC.&nbsp;&nbsp;Or, it can be set to 'nil'<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to use the default system font.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* FONTNAME:&nbsp;&nbsp; Here, the game developer&nbsp;&nbsp;may set the size of the font in<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use, or can be set to 'nil' to use the 22pt standard.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* LINEHEIGHT: This setting controls&nbsp;&nbsp;the vertical height for every line<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that appears within the tutorial window. If set to 'nil',<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;it uses the default setting of 32px.<br />
#<br />
#&nbsp;&nbsp;Flexible Values are basic settings for every tutorial window,&nbsp;&nbsp;though these<br />
#&nbsp;&nbsp;may be temporarily changed&nbsp;&nbsp;by the use&nbsp;&nbsp;of script calls.&nbsp;&nbsp;As such, the game<br />
#&nbsp;&nbsp;developer can change the placement of tutorial windows or define how trans-<br />
#&nbsp;&nbsp;parent the windows may be.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* TUTORIAL_RECT: This sets the default placement&nbsp;&nbsp;and size of the tuto-<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tial window itself. Unlike all other values defined in<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configuration section, it cannot be set to nil.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* OPACITY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This value&nbsp;&nbsp;sets the opacity or transparency level&nbsp;&nbsp;of<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the tutorial window. If it is set to nil,&nbsp;&nbsp;the opacity<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; of the window will be a solid 255.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* WINDOWSKIN:&nbsp;&nbsp;&nbsp;&nbsp;This value allows the use of a separate windowskin for<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the tutorial window&nbsp;&nbsp;rather than the default skin used<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for the default menus. Still, this may be set to 'nil'<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if the default skin is desired.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;SCRIPT CALLS - SETTING A TUTORIAL:<br />
#<br />
#&nbsp;&nbsp;Once installed, the game developer can immediately create a tutorial.&nbsp;&nbsp;This<br />
#&nbsp;&nbsp;tutorial is a pop-up window giving instructions to the player, and may come<br />
#&nbsp;&nbsp;to be as either text or as an image/graphics file.&nbsp;&nbsp;And both are relatively<br />
#&nbsp;&nbsp;simple to design.<br />
#<br />
#<br />
#&nbsp;&nbsp;* SET TUTORIAL WITH TEXT<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;set_tutorial_text(text)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;<br />
#&nbsp;&nbsp;&nbsp;&nbsp;That one method&nbsp;&nbsp;is the essential command to pass text&nbsp;&nbsp;into the Tutorial<br />
#&nbsp;&nbsp;&nbsp;&nbsp;system. And the moment this method is executed,&nbsp;&nbsp;the Tutorial Window will<br />
#&nbsp;&nbsp;&nbsp;&nbsp;appear. Note that the text itself is basically the same type of text that<br />
#&nbsp;&nbsp;&nbsp;&nbsp;is used in a [SHOW TEXT] message window event, though stripped down.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;* Color:&nbsp;&nbsp;To set the color of the text, you use &#92;&#92;C[#] rather than &#92;C[#].<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I don't understand why it cannot use &#92;C[#] alone,&nbsp;&nbsp;but "It just works",<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to quote Todd Howard.&nbsp;&nbsp;And it still uses&nbsp;&nbsp;value 0-7&nbsp;&nbsp;to set the colors.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;* Line Break:&nbsp;&nbsp;The [SHOW TEXT] event adds line breaks to the text entered<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;into its text entry window.&nbsp;&nbsp;However,&nbsp;&nbsp;the developer&nbsp;&nbsp;must manually add<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;their own line breaks&nbsp;&nbsp;so text will end on one line&nbsp;&nbsp;and advance to the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next.&nbsp;&nbsp;To do this, you use the &#92;n code.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EXAMPLE (Used in a map's parallel process):<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&gt;Wait: 1 frame(s)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@Script: my_text = "&#92;&#92;c[6]Tutorial:&#92;n&#92;n"+<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp; : "&#92;&#92;c[0]This is my example."<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp; : set_tutorial_text(my_text)<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;This doesn't change the size of the tutorial window,&nbsp;&nbsp;only adding the two<br />
#&nbsp;&nbsp;&nbsp;&nbsp;lines of text with a blank line in between, and the first line in yellow.<br />
#&nbsp;&nbsp;&nbsp;&nbsp;This system allows you to create pop-up windows designed to give the play<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;* SET TUTORIAL WITH GRAPHICS<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;set_tutorial_image(filename)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Similar in appearance, this method is used to display an image within the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;tutorial window.&nbsp;&nbsp;And the moment it is executed,&nbsp;&nbsp;the window will appear.<br />
#&nbsp;&nbsp;&nbsp;&nbsp;The graphic image MUST be within the 'Graphics&#92;Tutorials' subfolder.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EXAMPLE (Used in a map's parallel process):<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&gt;Wait: 1 frame(s)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@Script: set_tutorial_text("TestTutScreen")<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;This will immediately load a graphic image named "TestTutScreen" found in<br />
#&nbsp;&nbsp;&nbsp;&nbsp;the Graphics&#92;Tutorials subfolder and immediately display it.&nbsp;&nbsp;That's it!<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Do note, you will want a '1-frame' delay before calling either command if<br />
#&nbsp;&nbsp;&nbsp;&nbsp;it is&nbsp;&nbsp;being executed&nbsp;&nbsp;by a parallel process event&nbsp;&nbsp;that immediately runs<br />
#&nbsp;&nbsp;&nbsp;&nbsp;the moment a map loads. The delay is not needed if the map event executed<br />
#&nbsp;&nbsp;&nbsp;&nbsp;is an 'auto-run' event.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Do note that the area of the tutorial window&nbsp;&nbsp;must be both 32px wider and<br />
#&nbsp;&nbsp;&nbsp;&nbsp;taller than the image file itself&nbsp;&nbsp;as RMXP windows&nbsp;&nbsp;have a 16px border on<br />
#&nbsp;&nbsp;&nbsp;&nbsp;all sides. A graphic that is 200x150px would need a 232x182px window.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;SCRIPT CALLS - TEMPORARY SETTINGS:<br />
#<br />
#&nbsp;&nbsp;Obviously, not every tutorial pop-up are equal. A game developer may devise<br />
#&nbsp;&nbsp;a tutorial describing the controls&nbsp;&nbsp;for an NPC in order to navigate through<br />
#&nbsp;&nbsp;a lethal obstacle course which may include dash and jump buttons.&nbsp;&nbsp;However,<br />
#&nbsp;&nbsp;the game developer may wish a small screen to appear to let the player know<br />
#&nbsp;&nbsp;to use the arrow buttons to move the character.<br />
#<br />
#&nbsp;&nbsp;To this, three script calls were created&nbsp;&nbsp;to temporarily chagne the appear-<br />
#&nbsp;&nbsp;ance of the tutorial window.&nbsp;&nbsp;Blatantly temporary, the settings erase imme-<br />
#&nbsp;&nbsp;diately after they are executed. And these script calls must be used before<br />
#&nbsp;&nbsp;the tutorials are shown.<br />
#<br />
#&nbsp;&nbsp;* SET THE AREA<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;set_tutorial_area = array<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This command asks for a four-parameter array&nbsp;&nbsp;that defines the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x-coordinate, y-coordinate, width and height of the window. If<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;used for an image tutorial, both the width and height needs to<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be 32px larger to accommodate the 16px border on all sides.<br />
#<br />
#&nbsp;&nbsp;* SET THE OPACITY<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;tutorial_opacity = value <br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This asks for a value from 0-255, setting how solid or trans-<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parnt the window (or image file) will appear.<br />
#<br />
#&nbsp;&nbsp;* SET THE WINDOWSKIN<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;set_tutorial_skin = value <br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This asks for an alternative windowskin name, the skin being<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;within the Graphics&#92;Windowskins folder.&nbsp;&nbsp;The windowskin will<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;not appear if a Graphic Image tutorial is being used.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;SPECIAL!<br />
#&nbsp;&nbsp;INTEGRATION INTO OTHER SCRIPTS:<br />
#<br />
#&nbsp;&nbsp;If you want to include&nbsp;&nbsp;the Tutorial System as an optional feature in your<br />
#&nbsp;&nbsp;own custom system, its not that hard to include. There are just four steps.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;Step 1:&nbsp;&nbsp;Setting your OWN tutorial window appearances<br />
#<br />
#&nbsp;&nbsp;Whether you have&nbsp;&nbsp;a custom configuration module&nbsp;&nbsp;for your custom system or<br />
#&nbsp;&nbsp;not, you will want to have four custom constants.&nbsp;&nbsp;These will set the opa-<br />
#&nbsp;&nbsp;city, size and shape, windowskin&nbsp;&nbsp;and obviously the 'TEXT' of the tutorial<br />
#&nbsp;&nbsp;window for your script.<br />
#<br />
#&nbsp;&nbsp;Let's assume that you have a script that deals with unlocking doors based<br />
#&nbsp;&nbsp;on random chance and type of lockpick (I'm going good old Morrowind here).<br />
#&nbsp;&nbsp;You may have a configuration module with the name MorrowLocks. If so, just<br />
#&nbsp;&nbsp;add the three Configuration values like so:<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp; module MorrowLocks<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUTORIAL_RECT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = [80,96,480,288]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUTORIAL_OPACITY&nbsp;&nbsp;&nbsp;&nbsp;= 220<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUTORIAL_WINDOWSKIN = nil<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUTORIAL_TEXT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "&#92;&#92;c[4]My Tutorial:&#92;n&#92;&#92;c[0]Hi there."<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#<br />
#&nbsp;&nbsp;Of course, my tutorial text is pretty short. For a real tutorial text, it<br />
#&nbsp;&nbsp;would be quite a bit larger<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;Step 2: Making auto-detect and tutorial read variables<br />
#<br />
#&nbsp;&nbsp;You want the tutorial&nbsp;&nbsp;to only show once&nbsp;&nbsp;when you first&nbsp;&nbsp;try your custom<br />
#&nbsp;&nbsp;feature.&nbsp;&nbsp;So yeah, that is going to need a custom switch that is recorded<br />
#&nbsp;&nbsp;within the save game file.<br />
#<br />
#&nbsp;&nbsp;For those developing&nbsp;&nbsp;their own systems,&nbsp;&nbsp;I offer a test&nbsp;&nbsp;to determine if<br />
#&nbsp;&nbsp;the Tutorial system is even running.&nbsp;&nbsp;So their own custom systems&nbsp;&nbsp;may be<br />
#&nbsp;&nbsp;able to run with or without the tutorial script in place.<br />
#<br />
#&nbsp;&nbsp;Ergo, If the Morrowind Lockpick system is in use&nbsp;&nbsp;but the Tutorial system<br />
#&nbsp;&nbsp;isn't... it won't crash after trying to run its methods. ^_^<br />
#<br />
#&nbsp;&nbsp;Let's assume that you have a script that deals with unlocking doors based<br />
#&nbsp;&nbsp;For this, you'll need to add new values to Game_System, one for the auto-<br />
#&nbsp;&nbsp;detection switch and the other for the tutorial shown switch.&nbsp;&nbsp;And it may<br />
#&nbsp;&nbsp;look as simple as this:<br />
#&nbsp;&nbsp; <br />
#&nbsp;&nbsp;&nbsp;&nbsp; class Game_System<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attr_accessor :tutorial_detected<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attr_accessor :tutorial_lockpick<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alias morrowlocks_game_system_initialize initialize<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def initialize<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; morrowlocks_game_system_initialize <br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tutorial_detected&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= false<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tutorial_lockpick&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= false<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Interpreter.method_defined? "set_tutorial_text"<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tutorial_detected&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#<br />
#&nbsp;&nbsp;You will notice the&nbsp;&nbsp;[if Interpreter.method_defined? "set_tutorial_text"] <br />
#&nbsp;&nbsp;line.&nbsp;&nbsp;This will test the system&nbsp;&nbsp;to see if the Tutorial System is in the<br />
#&nbsp;&nbsp;project.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;Step 3: Getting the Tutorial window to show<br />
#<br />
#&nbsp;&nbsp;When you run your custom... Morrowind Lockpick... system, it obvious exe-<br />
#&nbsp;&nbsp;cutes from a custom "Scene_" code.&nbsp;&nbsp;Whether your custom Scene displays an<br />
#&nbsp;&nbsp;informative window (like Scene_Item) or not, you will want something like<br />
#&nbsp;&nbsp;this added to the mix.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def main_windows_tutorial<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Reset tutorial flag if no tutorial script used<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if &#36;game_system.tutorial_detected == false<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_system.tutorial_lockpick = true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if tutorial already shown<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if &#36;game_system.tutorial_lockpick<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get configurables<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp;= MorrowLocks::TUTORIAL_RECT[0]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp;= MorrowLocks::TUTORIAL_RECT[1]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wd&nbsp;&nbsp; = MorrowLocks::TUTORIAL_RECT[2]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ht&nbsp;&nbsp; = MorrowLocks::TUTORIAL_RECT[3]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; opa&nbsp;&nbsp;= MorrowLocks::TUTORIAL_OPACITY<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; skin = MorrowLocks::TUTORIAL_WINDOWSKIN<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text = MorrowLocks::TUTORIAL_TEXT<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if there's no text (like... really?)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if text.nil?<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_system.tutorial_lockpick = true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # First set the temp opacity and skin values<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_temp.tut_temp_window_opacity = opa<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_temp.tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp;= skin<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Finally... make the window and set the text<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tut_window = Window_Tutorial.new(x, y, wd, ht)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tut_window.refresh(text)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;This is the basis&nbsp;&nbsp;for creating the window,&nbsp;&nbsp;checking to see&nbsp;&nbsp;if you have<br />
#&nbsp;&nbsp;the tutorial script running,&nbsp;&nbsp;seeing if the tutorial even shown&nbsp;&nbsp;and then<br />
#&nbsp;&nbsp;loading the&nbsp;&nbsp;configuration values&nbsp;&nbsp;before actively generating&nbsp;&nbsp;the window<br />
#&nbsp;&nbsp;itself.<br />
#<br />
#&nbsp;&nbsp;Once this is inserted,&nbsp;&nbsp;you merely add the 'main_windows_tutorial' state-<br />
#&nbsp;&nbsp;ment around&nbsp;&nbsp;the start&nbsp;&nbsp;of your Scene's 'main' method&nbsp;&nbsp;(or 'main_windows'<br />
#&nbsp;&nbsp;method if using the SDK).&nbsp;&nbsp; You may want it&nbsp;&nbsp;to be placed after all other<br />
#&nbsp;&nbsp;windows or graphics are shown, but before the loop begins.<br />
#<br />
#&nbsp;&nbsp;There are only two things here that would change.&nbsp;&nbsp;The first change would<br />
#&nbsp;&nbsp;be the seven lines under&nbsp;&nbsp;"Get configurables"&nbsp;&nbsp;to align with&nbsp;&nbsp;your custom<br />
#&nbsp;&nbsp;script's config.<br />
#<br />
#&nbsp;&nbsp;The second thing to change&nbsp;&nbsp;would be if you wanted&nbsp;&nbsp;to show an image file<br />
#&nbsp;&nbsp;rather than text. In that case, the final line would read:<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tut_window.refresh(text, true)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;The second value&nbsp;&nbsp;in the refresh method&nbsp;&nbsp;is defaulted to 'false',&nbsp;&nbsp;so its<br />
#&nbsp;&nbsp;not necessary if showing basic text. But here, we are passing 'true' into<br />
#&nbsp;&nbsp;the second parameter to inform the system that a graphic file is in use.<br />
#<br />
#&nbsp;&nbsp;Ergo, the TUTORIAL_TEXT value within the config section&nbsp;&nbsp;is actually sup-<br />
#&nbsp;&nbsp;plying the filename in the graphic file in Graphics&#92;Tutorials. <br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;Step 4: Updating and closing the Tutorial window<br />
#<br />
#&nbsp;&nbsp;Believe it or not,&nbsp;&nbsp;this is not big or long at all.&nbsp;&nbsp; And first,&nbsp;&nbsp;another<br />
#&nbsp;&nbsp;premade little present to be added to your Scene code:<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def update_tutorial?<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if &#36;game_system.tutorial_lockpick<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false unless Input.trigger?(Input::C)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Input.update<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_system.tutorial_lockpick = true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tut_window.dispose<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;The above method&nbsp;&nbsp;only runs&nbsp;&nbsp;if the tutorial window&nbsp;&nbsp;is actively showing,<br />
#&nbsp;&nbsp;and waits for the player&nbsp;&nbsp;to press any DECISION key (Enter/Space).&nbsp;&nbsp;After<br />
#&nbsp;&nbsp;that,&nbsp;&nbsp;it runs the&nbsp;&nbsp;"Input.update"&nbsp;&nbsp;statement to clear&nbsp;&nbsp;the input system, <br />
#&nbsp;&nbsp;lest any further player input affects the system.<br />
#<br />
#&nbsp;&nbsp;After that,&nbsp;&nbsp;it sets the flag&nbsp;&nbsp;to the tutorial&nbsp;&nbsp;as having&nbsp;&nbsp;finally shown,<br />
#&nbsp;&nbsp;disposes of the tutorial window, and exit.<br />
#<br />
#&nbsp;&nbsp;And once that's done, just add the "update_tutorial?" method as a test at<br />
#&nbsp;&nbsp;the start of your update method like so:<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def update<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return unless update_tutorial?<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ALL OF YOUR UPDATE CODE)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;This will stop all actions of your update method&nbsp;&nbsp;while the tutorial win-<br />
#&nbsp;&nbsp;dow is visible.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;And that's really it.&nbsp;&nbsp;You just need to add:<br />
#<br />
#&nbsp;&nbsp;1) The configuration values<br />
#&nbsp;&nbsp;2) The switches within Game_System<br />
#&nbsp;&nbsp;3) The 'main_windows_tutorial' method in your Scene code, and having it run<br />
#&nbsp;&nbsp;4) The 'update_tutorial?' method in Scene code and having it placed at the<br />
#&nbsp;&nbsp;&nbsp;&nbsp; start of update.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;COMPATIBILITY:<br />
#<br />
#&nbsp;&nbsp;Compatible with RPGMaker XP default scripts. The only default scripts within<br />
#&nbsp;&nbsp;are aliased content.<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;TERMS OF USE:<br />
#<br />
#&nbsp;&nbsp;Free for use, even in commercial games.&nbsp;&nbsp;Only due credit is required.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
module TutWindow<br />
<br />
<br />
&nbsp;&nbsp;# FIXED VALUES<br />
&nbsp;&nbsp;# ============<br />
&nbsp;&nbsp;# These values define the fonts used in all tutorial windows. The display is<br />
&nbsp;&nbsp;# considered static for all tutorials for a project for continuity.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;FONTNAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Font name (or array of fonts) or nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;FONTSIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Size of the font used, or nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;LINEHEIGHT&nbsp;&nbsp;&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Vertical height of each line, or nil<br />
<br />
<br />
&nbsp;&nbsp;# FLEXIBLE VALUES<br />
&nbsp;&nbsp;# ===============<br />
&nbsp;&nbsp;# These values define the shape and visual appearance of the tutorial windows.<br />
&nbsp;&nbsp;# They allow for customization so they'll work with various in-game mechanics,<br />
&nbsp;&nbsp;# and be adaptable to custom plugins actively using the Tutorial system.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;TUTORIAL_RECT = [80, 304, 480, 160]&nbsp;&nbsp; # Rectangle area of the window <br />
&nbsp;&nbsp;&nbsp;&nbsp;OPACITY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Opacity of the window back area<br />
&nbsp;&nbsp;&nbsp;&nbsp;WINDOWSKIN&nbsp;&nbsp;&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Custom windowskin in use<br />
<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** RPG::Cache<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;The module that loads each of RPGXP's graphic formats, creates a Bitmap<br />
#&nbsp;&nbsp;object, and retains it.<br />
#==============================================================================<br />
<br />
module RPG::Cache<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Tutorial Screen<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; filename : filename of the cached bitmap<br />
&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;def self.tutorial(filename)<br />
&nbsp;&nbsp;&nbsp;&nbsp;begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.load_bitmap("Graphics/Tutorials/", filename)<br />
&nbsp;&nbsp;&nbsp;&nbsp;rescue <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.load_bitmap("Graphics/Tutorials/", "")<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Temp<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles temporary data that is not included with save data.<br />
#&nbsp;&nbsp;Refer to "&#36;game_temp" for the instance of this class.<br />
#==============================================================================<br />
<br />
class Game_Temp<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :tut_temp_window_opacity&nbsp;&nbsp;# Temporary window back opacity<br />
&nbsp;&nbsp;attr_accessor :tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp; # Temporary window skin<br />
&nbsp;&nbsp;attr_accessor :tut_temp_window_rect&nbsp;&nbsp;&nbsp;&nbsp; # Temporary window area defined<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias game_temp_tutorial_initialize initialize<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;game_temp_tutorial_initialize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_temp_window_opacity&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Temporary opacity reset<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp; = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Temporary skin reset<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_temp_window_rect&nbsp;&nbsp;&nbsp;&nbsp; = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Temporary area reset<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_Tutorial<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window is used to display in-game tutorials.<br />
#==============================================================================<br />
<br />
class Window_Tutorial &lt; Window_Base<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: window x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: window y-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; width&nbsp;&nbsp;: window width<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; height : window height&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(x, y, width, height)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(x, y, width, height)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Superclass method<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width-32, height-32)&nbsp;&nbsp; # Create the contents area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 9998&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set z-depth to near max<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.pause&nbsp;&nbsp;&nbsp;&nbsp;= false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Remove any pause glyph<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Dispose<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use superclass method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; text : text to display<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; type : (true/false) is image?<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh(text=nil, type=false)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if text.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If passing nil text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.visible&nbsp;&nbsp;= false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Hide the window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit the method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if type == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If tutorial is an image<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh_image(text)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use image option<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit the method <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh_message(text)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Show text tutorial<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh Image<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; file : filename<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_image(file)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Clear the drawing area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.opacity = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;bitmap = RPG::Cache.tutorial(file)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get the tutorial bitmap<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = bitmap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Bitmap becomes contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;opa = 255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume solid opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::OPACITY.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If defined opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opa&nbsp;&nbsp;= TutWindow::OPACITY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use defined opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_opacity.nil?&nbsp;&nbsp;&nbsp;&nbsp;# If temp opacity exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opa = &#36;game_temp.tut_temp_window_opacity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get temp opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;end <br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents_opacity = opa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use on image contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh Message<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; text : text to display<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_message(text=nil)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh_contents&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Refresh the drawing area<br />
&nbsp;&nbsp;&nbsp;&nbsp;text.strip!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Remove excess spaces<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;lnht&nbsp;&nbsp;= 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set default line height<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::LINEHEIGHT.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a custom line height?<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lnht&nbsp;&nbsp;= TutWindow::LINEHEIGHT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set custom line height<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;x = y = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set text coords to start<br />
&nbsp;&nbsp;&nbsp;&nbsp;text.gsub!(/&#92;&#92;&#92;&#92;/) { "&#92;000" }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Change "&#92;&#92;&#92;&#92;" to "&#92;000"<br />
&nbsp;&nbsp;&nbsp;&nbsp;text.gsub!(/&#92;&#92;[Cc]&#92;[([0-9]+)&#92;]/) { "&#92;001[#{&#36;1}]"} # Change &#92;&#92;C to "&#92;001"<br />
&nbsp;&nbsp;&nbsp;&nbsp;while ((c = text.slice!(/./m)) != nil)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Loop 1 char at a time<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c = "&#92;&#92;" if c == "&#92;000"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use original text if &#92;&#92;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if c == "&#92;001"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If &#92;C[n] (Color code)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text.sub!(/&#92;[([0-9]+)&#92;]/, "")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get substitution value<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color = &#36;1.to_i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set value as color<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if color &gt;= 0 and color &lt;= 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Only if in range<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = text_color(color)# Use that set color<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Then skip to next text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if c == "&#92;n"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If new line text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 0 ; y += 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reset to next line<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Then skip to next text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4+x,lnht*y,40,lnht,c)&nbsp;&nbsp; # Draw character <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x += self.contents.text_size(c).width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add to drawn text width<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh Contents<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Clear the drawing area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = normal_color&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set normal font color <br />
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;font&nbsp;&nbsp;= Font.default_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume default font<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::FONTNAME.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a custom font defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font&nbsp;&nbsp;= TutWindow::FONTNAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get custom font<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.name = font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the font<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= Font.default_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume default size<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::FONTSIZE.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a custom size defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= TutWindow::FONTSIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get custom size<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.size = size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;skin&nbsp;&nbsp;= &#36;game_system.windowskin_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Assume system windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::WINDOWSKIN.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If defined windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;skin&nbsp;&nbsp;= TutWindow::WINDOWSKIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use defined windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_skin.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If temp skin exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;skin&nbsp;&nbsp;= &#36;game_temp.tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get temp windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;end <br />
&nbsp;&nbsp;&nbsp;&nbsp;self.windowskin = RPG::Cache.windowskin(skin)&nbsp;&nbsp;&nbsp;&nbsp; # Use windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;opa = 255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume solid opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::OPACITY.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If defined opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opa&nbsp;&nbsp;= TutWindow::OPACITY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use defined opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_opacity.nil?&nbsp;&nbsp;&nbsp;&nbsp;# If temp opacity exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opa = &#36;game_temp.tut_temp_window_opacity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get temp opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;end <br />
&nbsp;&nbsp;&nbsp;&nbsp;self.back_opacity = opa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp; = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase temp skin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_opacity&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase temp opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This interpreter runs event commands. This class is used within the<br />
#&nbsp;&nbsp;Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Text from map or battle event<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_text(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume invalid scene<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = true if &#36;scene.is_a?(Scene_Map)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Test if in the map<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = true if &#36;scene.is_a?(Scene_Battle)&nbsp;&nbsp;&nbsp;&nbsp;# Test if in battle<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not valid<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene.set_tutorial(text)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set into the scene<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Image from map or battle event<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_image(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume invalid scene<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = true if &#36;scene.is_a?(Scene_Map)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Test if in the map<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = true if &#36;scene.is_a?(Scene_Battle)&nbsp;&nbsp;&nbsp;&nbsp;# Test if in battle<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not valid<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene.set_tutorial(text, true)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set into the scene<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Area<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_area(array_val)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless array_val.is_a?(Array)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if not an array<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless array_val.size == 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if params incorrect<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_rect = array_val&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set into temp array<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Opacity<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_opacity(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless value.is_a?(Integer)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if not an integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if value &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if out of range<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if value &gt; 255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if out of range<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_opacity = value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set into temp value<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Windowskin<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def&nbsp;&nbsp;set_tutorial_skin(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless value.is_a?(String)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not text <br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_skin = value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set into temp value <br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Map<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs map screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Map<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias scene_map_tutorial_main main<br />
&nbsp;&nbsp;alias scene_map_tutorial_update update<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;main_tutorial_window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Load the custom window<br />
&nbsp;&nbsp;&nbsp;&nbsp;scene_map_tutorial_main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;main_tutorial_dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dispose of the window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing (Loading custom window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main_tutorial_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;&nbsp; = TutWindow::TUTORIAL_RECT[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get the x/y/width/height<br />
&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = TutWindow::TUTORIAL_RECT[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Of the tutorial window<br />
&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= TutWindow::TUTORIAL_RECT[2]<br />
&nbsp;&nbsp;&nbsp;&nbsp;ht&nbsp;&nbsp;= TutWindow::TUTORIAL_RECT[3]&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window = Window_Tutorial.new(x,y,wd,ht)&nbsp;&nbsp;# Create with dimensions<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set the window invisible<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Dispose<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main_tutorial_dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dispose the window&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @tut_window.visible == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If the window is active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return update_tutorial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with the custom update<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;scene_map_tutorial_update&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method <br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (When testing for player input to exit tutorial screen)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_tutorial<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if !Input.trigger?(Input::C)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if Enter isn't pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set the window invisible<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; text : text passed into the tutorial window<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; type : (true/false) if the text is a tutorial image filename<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial(text=nil, type=false)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;set_tutorial_area&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Redraw area each instance<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.refresh(text, type)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Pass tutorial into window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Contents Area<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_area<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;array_val = TutWindow::TUTORIAL_RECT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Assume default window<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_rect.nil?&nbsp;&nbsp; # If a temporary area defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array_val = &#36;game_temp.tut_temp_window_rect # Use the temporary area<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_rect = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase the temporary area<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set x-coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set y-coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[2]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get window width<br />
&nbsp;&nbsp;&nbsp;&nbsp;height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= array_val[3]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get window height<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.width&nbsp;&nbsp; = width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set window width<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.height&nbsp;&nbsp;= height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set window height<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Reset the window content area<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Battle<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs battle screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Battle<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias scene_battle_tutorial_main main<br />
&nbsp;&nbsp;alias scene_battle_tutorial_update update<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;main_tutorial_window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Load the custom window<br />
&nbsp;&nbsp;&nbsp;&nbsp;scene_battle_tutorial_main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;main_tutorial_dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dispose of the window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing (Loading custom window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main_tutorial_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;&nbsp; = TutWindow::TUTORIAL_RECT[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get the x/y/width/height<br />
&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = TutWindow::TUTORIAL_RECT[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Of the tutorial window<br />
&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= TutWindow::TUTORIAL_RECT[2]<br />
&nbsp;&nbsp;&nbsp;&nbsp;ht&nbsp;&nbsp;= TutWindow::TUTORIAL_RECT[3]&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window = Window_Tutorial.new(x,y,wd,ht)&nbsp;&nbsp;# Create with dimensions<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set the window invisible<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Dispose<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main_tutorial_dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dispose the window&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @tut_window.visible == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If the window is active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return update_tutorial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with the custom update<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;scene_battle_tutorial_update&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method <br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (When testing for player input to exit tutorial screen)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_tutorial<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if !Input.trigger?(Input::C)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if Enter isn't pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set the window invisible<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; text : text passed into the tutorial window<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; type : (true/false) if the text is a tutorial image filename<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial(text=nil, type=false)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;set_tutorial_area&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Redraw area each instance<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.refresh(text, type)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Pass tutorial into window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Contents Area<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_area<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;array_val = TutWindow::TUTORIAL_RECT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Assume default window<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_rect.nil?&nbsp;&nbsp; # If a temporary area defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array_val = &#36;game_temp.tut_temp_window_rect # Use the temporary area<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_rect = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase the temporary area<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set x-coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set y-coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[2]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get window width<br />
&nbsp;&nbsp;&nbsp;&nbsp;height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= array_val[3]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get window height<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.width&nbsp;&nbsp; = width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set window width<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.height&nbsp;&nbsp;= height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set window height<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Reset the window content area<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Built into the instructions<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Compatible with RPGMaker XP default scripts. The only default scripts within are aliased content.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
<br />
The script is included within <a href="showthread.php?tid=13620"><span style="font-style: italic;" class="mycode_i"><span style="text-decoration: underline;" class="mycode_u">Two-Stage Crafting</span></span></a>.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit is required.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">DerVV's Tutorial Windows</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This system allows you to create pop-up windows designed to give the player quick gameplay instructions,  whether it be simple movement instructions or more complex guides for devices, system mechanics or minigames.<br />
<br />
Being in-game tutorials, the window(s) will not close without player input.<br />
<br />
The system is designed  to let game developers use both map events or troop database events (such as inserted into Turn 0).  However, it is possible to adapt game mechanic scripts (lockpicking, quest system, etc) to include the tutorial system and allow pop-up help to appear upon their first execution.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Creates a window of custom size to display helpful text</li>
<li>Uses a text system similar to the message window</li>
<li>Track if a tutorial had already shown and prevent re-appearance</li>
<li>Instructions include how to inert into other custom scripts in need</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> TUT HERE</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** DerVV's Tutorial Windows<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;by DerVVulfman<br />
#&nbsp;&nbsp;&nbsp;&nbsp;version 1.0<br />
#&nbsp;&nbsp;&nbsp;&nbsp;07-01-2026 (mm/dd/yyyy)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;RGSS / RPGMaker XP<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;INTRODUCTION:<br />
#<br />
#&nbsp;&nbsp;This system allows you to create pop-up windows designed to give the player<br />
#&nbsp;&nbsp;quick gameplay instructions,&nbsp;&nbsp;whether it be simple movement instructions or<br />
#&nbsp;&nbsp;more complex guides for devices, system mechanics or minigames.<br />
#<br />
#&nbsp;&nbsp;Being in-game tutorials, the window(s) will not close without player input.<br />
#<br />
#&nbsp;&nbsp;The system is designed&nbsp;&nbsp;to let game developers use both map events or troop<br />
#&nbsp;&nbsp;database events (such as inserted into Turn 0).&nbsp;&nbsp;However, it is possible to<br />
#&nbsp;&nbsp;adapt game mechanic scripts (lockpicking, quest system, etc) to include the<br />
#&nbsp;&nbsp;tutorial system and allow pop-up help to appear upon their first execution.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;INSTALLATION:<br />
#<br />
#&nbsp;&nbsp;Place this script below Scene_Debug and above Main.&nbsp;&nbsp;Create a new Tutorials<br />
#&nbsp;&nbsp;subfolder within&nbsp;&nbsp;the project's Graphics folder&nbsp;&nbsp;if you plan to use graphic<br />
#&nbsp;&nbsp;images instead of basic text.<br />
#<br />
#&nbsp;&nbsp;IE:&nbsp;&nbsp;Graphics&#92;Tutorials<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;CONFIGURATION:<br />
#<br />
#&nbsp;&nbsp;The TutWindow module is where the game developer defines the basic settings<br />
#&nbsp;&nbsp;for all, or most all,&nbsp;&nbsp;tutorial windows.&nbsp;&nbsp;It is divided&nbsp;&nbsp;into two sections;<br />
#&nbsp;&nbsp;the Fixed Values section and the Flexible Values section.<br />
#<br />
#&nbsp;&nbsp;Fixed Values are the settings&nbsp;&nbsp;for the fonts&nbsp;&nbsp;used within all tutorial win-<br />
#&nbsp;&nbsp;dows and the vertical spacing&nbsp;&nbsp;for each line of text.&nbsp;&nbsp;There are no methods<br />
#&nbsp;&nbsp;to change these settings,&nbsp;&nbsp;and that is by intent&nbsp;&nbsp;as it is assumed that the<br />
#&nbsp;&nbsp;tutorial windows all share a matching and uniform appearance.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* FONTNAME:&nbsp;&nbsp; Here,&nbsp;&nbsp;the game deveoper sets either the font or an array<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;of fonts used within the tutorial window.&nbsp;&nbsp;If an array is<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;used, the system will use the first within the array that<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;functions on the player's PC.&nbsp;&nbsp;Or, it can be set to 'nil'<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to use the default system font.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* FONTNAME:&nbsp;&nbsp; Here, the game developer&nbsp;&nbsp;may set the size of the font in<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;use, or can be set to 'nil' to use the 22pt standard.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* LINEHEIGHT: This setting controls&nbsp;&nbsp;the vertical height for every line<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that appears within the tutorial window. If set to 'nil',<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;it uses the default setting of 32px.<br />
#<br />
#&nbsp;&nbsp;Flexible Values are basic settings for every tutorial window,&nbsp;&nbsp;though these<br />
#&nbsp;&nbsp;may be temporarily changed&nbsp;&nbsp;by the use&nbsp;&nbsp;of script calls.&nbsp;&nbsp;As such, the game<br />
#&nbsp;&nbsp;developer can change the placement of tutorial windows or define how trans-<br />
#&nbsp;&nbsp;parent the windows may be.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* TUTORIAL_RECT: This sets the default placement&nbsp;&nbsp;and size of the tuto-<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; tial window itself. Unlike all other values defined in<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; configuration section, it cannot be set to nil.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* OPACITY:&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; This value&nbsp;&nbsp;sets the opacity or transparency level&nbsp;&nbsp;of<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the tutorial window. If it is set to nil,&nbsp;&nbsp;the opacity<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; of the window will be a solid 255.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;* WINDOWSKIN:&nbsp;&nbsp;&nbsp;&nbsp;This value allows the use of a separate windowskin for<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; the tutorial window&nbsp;&nbsp;rather than the default skin used<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; for the default menus. Still, this may be set to 'nil'<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if the default skin is desired.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;SCRIPT CALLS - SETTING A TUTORIAL:<br />
#<br />
#&nbsp;&nbsp;Once installed, the game developer can immediately create a tutorial.&nbsp;&nbsp;This<br />
#&nbsp;&nbsp;tutorial is a pop-up window giving instructions to the player, and may come<br />
#&nbsp;&nbsp;to be as either text or as an image/graphics file.&nbsp;&nbsp;And both are relatively<br />
#&nbsp;&nbsp;simple to design.<br />
#<br />
#<br />
#&nbsp;&nbsp;* SET TUTORIAL WITH TEXT<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;set_tutorial_text(text)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;<br />
#&nbsp;&nbsp;&nbsp;&nbsp;That one method&nbsp;&nbsp;is the essential command to pass text&nbsp;&nbsp;into the Tutorial<br />
#&nbsp;&nbsp;&nbsp;&nbsp;system. And the moment this method is executed,&nbsp;&nbsp;the Tutorial Window will<br />
#&nbsp;&nbsp;&nbsp;&nbsp;appear. Note that the text itself is basically the same type of text that<br />
#&nbsp;&nbsp;&nbsp;&nbsp;is used in a [SHOW TEXT] message window event, though stripped down.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;* Color:&nbsp;&nbsp;To set the color of the text, you use &#92;&#92;C[#] rather than &#92;C[#].<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;I don't understand why it cannot use &#92;C[#] alone,&nbsp;&nbsp;but "It just works",<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;to quote Todd Howard.&nbsp;&nbsp;And it still uses&nbsp;&nbsp;value 0-7&nbsp;&nbsp;to set the colors.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;* Line Break:&nbsp;&nbsp;The [SHOW TEXT] event adds line breaks to the text entered<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;into its text entry window.&nbsp;&nbsp;However,&nbsp;&nbsp;the developer&nbsp;&nbsp;must manually add<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;their own line breaks&nbsp;&nbsp;so text will end on one line&nbsp;&nbsp;and advance to the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next.&nbsp;&nbsp;To do this, you use the &#92;n code.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EXAMPLE (Used in a map's parallel process):<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&gt;Wait: 1 frame(s)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@Script: my_text = "&#92;&#92;c[6]Tutorial:&#92;n&#92;n"+<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp; : "&#92;&#92;c[0]This is my example."<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; :&nbsp;&nbsp;&nbsp;&nbsp; : set_tutorial_text(my_text)<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;This doesn't change the size of the tutorial window,&nbsp;&nbsp;only adding the two<br />
#&nbsp;&nbsp;&nbsp;&nbsp;lines of text with a blank line in between, and the first line in yellow.<br />
#&nbsp;&nbsp;&nbsp;&nbsp;This system allows you to create pop-up windows designed to give the play<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;* SET TUTORIAL WITH GRAPHICS<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;set_tutorial_image(filename)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Similar in appearance, this method is used to display an image within the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;tutorial window.&nbsp;&nbsp;And the moment it is executed,&nbsp;&nbsp;the window will appear.<br />
#&nbsp;&nbsp;&nbsp;&nbsp;The graphic image MUST be within the 'Graphics&#92;Tutorials' subfolder.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EXAMPLE (Used in a map's parallel process):<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@&gt;Wait: 1 frame(s)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@Script: set_tutorial_text("TestTutScreen")<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;This will immediately load a graphic image named "TestTutScreen" found in<br />
#&nbsp;&nbsp;&nbsp;&nbsp;the Graphics&#92;Tutorials subfolder and immediately display it.&nbsp;&nbsp;That's it!<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Do note, you will want a '1-frame' delay before calling either command if<br />
#&nbsp;&nbsp;&nbsp;&nbsp;it is&nbsp;&nbsp;being executed&nbsp;&nbsp;by a parallel process event&nbsp;&nbsp;that immediately runs<br />
#&nbsp;&nbsp;&nbsp;&nbsp;the moment a map loads. The delay is not needed if the map event executed<br />
#&nbsp;&nbsp;&nbsp;&nbsp;is an 'auto-run' event.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Do note that the area of the tutorial window&nbsp;&nbsp;must be both 32px wider and<br />
#&nbsp;&nbsp;&nbsp;&nbsp;taller than the image file itself&nbsp;&nbsp;as RMXP windows&nbsp;&nbsp;have a 16px border on<br />
#&nbsp;&nbsp;&nbsp;&nbsp;all sides. A graphic that is 200x150px would need a 232x182px window.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;SCRIPT CALLS - TEMPORARY SETTINGS:<br />
#<br />
#&nbsp;&nbsp;Obviously, not every tutorial pop-up are equal. A game developer may devise<br />
#&nbsp;&nbsp;a tutorial describing the controls&nbsp;&nbsp;for an NPC in order to navigate through<br />
#&nbsp;&nbsp;a lethal obstacle course which may include dash and jump buttons.&nbsp;&nbsp;However,<br />
#&nbsp;&nbsp;the game developer may wish a small screen to appear to let the player know<br />
#&nbsp;&nbsp;to use the arrow buttons to move the character.<br />
#<br />
#&nbsp;&nbsp;To this, three script calls were created&nbsp;&nbsp;to temporarily chagne the appear-<br />
#&nbsp;&nbsp;ance of the tutorial window.&nbsp;&nbsp;Blatantly temporary, the settings erase imme-<br />
#&nbsp;&nbsp;diately after they are executed. And these script calls must be used before<br />
#&nbsp;&nbsp;the tutorials are shown.<br />
#<br />
#&nbsp;&nbsp;* SET THE AREA<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;set_tutorial_area = array<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This command asks for a four-parameter array&nbsp;&nbsp;that defines the<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x-coordinate, y-coordinate, width and height of the window. If<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;used for an image tutorial, both the width and height needs to<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;be 32px larger to accommodate the 16px border on all sides.<br />
#<br />
#&nbsp;&nbsp;* SET THE OPACITY<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;tutorial_opacity = value <br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This asks for a value from 0-255, setting how solid or trans-<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;parnt the window (or image file) will appear.<br />
#<br />
#&nbsp;&nbsp;* SET THE WINDOWSKIN<br />
#&nbsp;&nbsp;&nbsp;&nbsp;Syntax:&nbsp;&nbsp;set_tutorial_skin = value <br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;This asks for an alternative windowskin name, the skin being<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;within the Graphics&#92;Windowskins folder.&nbsp;&nbsp;The windowskin will<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;not appear if a Graphic Image tutorial is being used.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;SPECIAL!<br />
#&nbsp;&nbsp;INTEGRATION INTO OTHER SCRIPTS:<br />
#<br />
#&nbsp;&nbsp;If you want to include&nbsp;&nbsp;the Tutorial System as an optional feature in your<br />
#&nbsp;&nbsp;own custom system, its not that hard to include. There are just four steps.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;Step 1:&nbsp;&nbsp;Setting your OWN tutorial window appearances<br />
#<br />
#&nbsp;&nbsp;Whether you have&nbsp;&nbsp;a custom configuration module&nbsp;&nbsp;for your custom system or<br />
#&nbsp;&nbsp;not, you will want to have four custom constants.&nbsp;&nbsp;These will set the opa-<br />
#&nbsp;&nbsp;city, size and shape, windowskin&nbsp;&nbsp;and obviously the 'TEXT' of the tutorial<br />
#&nbsp;&nbsp;window for your script.<br />
#<br />
#&nbsp;&nbsp;Let's assume that you have a script that deals with unlocking doors based<br />
#&nbsp;&nbsp;on random chance and type of lockpick (I'm going good old Morrowind here).<br />
#&nbsp;&nbsp;You may have a configuration module with the name MorrowLocks. If so, just<br />
#&nbsp;&nbsp;add the three Configuration values like so:<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp; module MorrowLocks<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUTORIAL_RECT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = [80,96,480,288]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUTORIAL_OPACITY&nbsp;&nbsp;&nbsp;&nbsp;= 220<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUTORIAL_WINDOWSKIN = nil<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; TUTORIAL_TEXT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "&#92;&#92;c[4]My Tutorial:&#92;n&#92;&#92;c[0]Hi there."<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#<br />
#&nbsp;&nbsp;Of course, my tutorial text is pretty short. For a real tutorial text, it<br />
#&nbsp;&nbsp;would be quite a bit larger<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;Step 2: Making auto-detect and tutorial read variables<br />
#<br />
#&nbsp;&nbsp;You want the tutorial&nbsp;&nbsp;to only show once&nbsp;&nbsp;when you first&nbsp;&nbsp;try your custom<br />
#&nbsp;&nbsp;feature.&nbsp;&nbsp;So yeah, that is going to need a custom switch that is recorded<br />
#&nbsp;&nbsp;within the save game file.<br />
#<br />
#&nbsp;&nbsp;For those developing&nbsp;&nbsp;their own systems,&nbsp;&nbsp;I offer a test&nbsp;&nbsp;to determine if<br />
#&nbsp;&nbsp;the Tutorial system is even running.&nbsp;&nbsp;So their own custom systems&nbsp;&nbsp;may be<br />
#&nbsp;&nbsp;able to run with or without the tutorial script in place.<br />
#<br />
#&nbsp;&nbsp;Ergo, If the Morrowind Lockpick system is in use&nbsp;&nbsp;but the Tutorial system<br />
#&nbsp;&nbsp;isn't... it won't crash after trying to run its methods. ^_^<br />
#<br />
#&nbsp;&nbsp;Let's assume that you have a script that deals with unlocking doors based<br />
#&nbsp;&nbsp;For this, you'll need to add new values to Game_System, one for the auto-<br />
#&nbsp;&nbsp;detection switch and the other for the tutorial shown switch.&nbsp;&nbsp;And it may<br />
#&nbsp;&nbsp;look as simple as this:<br />
#&nbsp;&nbsp; <br />
#&nbsp;&nbsp;&nbsp;&nbsp; class Game_System<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attr_accessor :tutorial_detected<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; attr_accessor :tutorial_lockpick<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; alias morrowlocks_game_system_initialize initialize<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def initialize<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; morrowlocks_game_system_initialize <br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tutorial_detected&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= false<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tutorial_lockpick&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= false<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if Interpreter.method_defined? "set_tutorial_text"<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tutorial_detected&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#<br />
#&nbsp;&nbsp;You will notice the&nbsp;&nbsp;[if Interpreter.method_defined? "set_tutorial_text"] <br />
#&nbsp;&nbsp;line.&nbsp;&nbsp;This will test the system&nbsp;&nbsp;to see if the Tutorial System is in the<br />
#&nbsp;&nbsp;project.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;Step 3: Getting the Tutorial window to show<br />
#<br />
#&nbsp;&nbsp;When you run your custom... Morrowind Lockpick... system, it obvious exe-<br />
#&nbsp;&nbsp;cutes from a custom "Scene_" code.&nbsp;&nbsp;Whether your custom Scene displays an<br />
#&nbsp;&nbsp;informative window (like Scene_Item) or not, you will want something like<br />
#&nbsp;&nbsp;this added to the mix.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def main_windows_tutorial<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Reset tutorial flag if no tutorial script used<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if &#36;game_system.tutorial_detected == false<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_system.tutorial_lockpick = true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if tutorial already shown<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if &#36;game_system.tutorial_lockpick<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get configurables<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp;= MorrowLocks::TUTORIAL_RECT[0]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp;= MorrowLocks::TUTORIAL_RECT[1]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; wd&nbsp;&nbsp; = MorrowLocks::TUTORIAL_RECT[2]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ht&nbsp;&nbsp; = MorrowLocks::TUTORIAL_RECT[3]<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; opa&nbsp;&nbsp;= MorrowLocks::TUTORIAL_OPACITY<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; skin = MorrowLocks::TUTORIAL_WINDOWSKIN<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; text = MorrowLocks::TUTORIAL_TEXT<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if there's no text (like... really?)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if text.nil?<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_system.tutorial_lockpick = true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # First set the temp opacity and skin values<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_temp.tut_temp_window_opacity = opa<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_temp.tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp;= skin<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Finally... make the window and set the text<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tut_window = Window_Tutorial.new(x, y, wd, ht)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tut_window.refresh(text)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;This is the basis&nbsp;&nbsp;for creating the window,&nbsp;&nbsp;checking to see&nbsp;&nbsp;if you have<br />
#&nbsp;&nbsp;the tutorial script running,&nbsp;&nbsp;seeing if the tutorial even shown&nbsp;&nbsp;and then<br />
#&nbsp;&nbsp;loading the&nbsp;&nbsp;configuration values&nbsp;&nbsp;before actively generating&nbsp;&nbsp;the window<br />
#&nbsp;&nbsp;itself.<br />
#<br />
#&nbsp;&nbsp;Once this is inserted,&nbsp;&nbsp;you merely add the 'main_windows_tutorial' state-<br />
#&nbsp;&nbsp;ment around&nbsp;&nbsp;the start&nbsp;&nbsp;of your Scene's 'main' method&nbsp;&nbsp;(or 'main_windows'<br />
#&nbsp;&nbsp;method if using the SDK).&nbsp;&nbsp; You may want it&nbsp;&nbsp;to be placed after all other<br />
#&nbsp;&nbsp;windows or graphics are shown, but before the loop begins.<br />
#<br />
#&nbsp;&nbsp;There are only two things here that would change.&nbsp;&nbsp;The first change would<br />
#&nbsp;&nbsp;be the seven lines under&nbsp;&nbsp;"Get configurables"&nbsp;&nbsp;to align with&nbsp;&nbsp;your custom<br />
#&nbsp;&nbsp;script's config.<br />
#<br />
#&nbsp;&nbsp;The second thing to change&nbsp;&nbsp;would be if you wanted&nbsp;&nbsp;to show an image file<br />
#&nbsp;&nbsp;rather than text. In that case, the final line would read:<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tut_window.refresh(text, true)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;The second value&nbsp;&nbsp;in the refresh method&nbsp;&nbsp;is defaulted to 'false',&nbsp;&nbsp;so its<br />
#&nbsp;&nbsp;not necessary if showing basic text. But here, we are passing 'true' into<br />
#&nbsp;&nbsp;the second parameter to inform the system that a graphic file is in use.<br />
#<br />
#&nbsp;&nbsp;Ergo, the TUTORIAL_TEXT value within the config section&nbsp;&nbsp;is actually sup-<br />
#&nbsp;&nbsp;plying the filename in the graphic file in Graphics&#92;Tutorials. <br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;Step 4: Updating and closing the Tutorial window<br />
#<br />
#&nbsp;&nbsp;Believe it or not,&nbsp;&nbsp;this is not big or long at all.&nbsp;&nbsp; And first,&nbsp;&nbsp;another<br />
#&nbsp;&nbsp;premade little present to be added to your Scene code:<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def update_tutorial?<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if &#36;game_system.tutorial_lockpick<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return false unless Input.trigger?(Input::C)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Input.update<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#36;game_system.tutorial_lockpick = true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; @tut_window.dispose<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return true<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;The above method&nbsp;&nbsp;only runs&nbsp;&nbsp;if the tutorial window&nbsp;&nbsp;is actively showing,<br />
#&nbsp;&nbsp;and waits for the player&nbsp;&nbsp;to press any DECISION key (Enter/Space).&nbsp;&nbsp;After<br />
#&nbsp;&nbsp;that,&nbsp;&nbsp;it runs the&nbsp;&nbsp;"Input.update"&nbsp;&nbsp;statement to clear&nbsp;&nbsp;the input system, <br />
#&nbsp;&nbsp;lest any further player input affects the system.<br />
#<br />
#&nbsp;&nbsp;After that,&nbsp;&nbsp;it sets the flag&nbsp;&nbsp;to the tutorial&nbsp;&nbsp;as having&nbsp;&nbsp;finally shown,<br />
#&nbsp;&nbsp;disposes of the tutorial window, and exit.<br />
#<br />
#&nbsp;&nbsp;And once that's done, just add the "update_tutorial?" method as a test at<br />
#&nbsp;&nbsp;the start of your update method like so:<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; def update<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; return unless update_tutorial?<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; (ALL OF YOUR UPDATE CODE)<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; end<br />
#&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; #----------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;This will stop all actions of your update method&nbsp;&nbsp;while the tutorial win-<br />
#&nbsp;&nbsp;dow is visible.<br />
#<br />
#&nbsp;&nbsp;&nbsp;&nbsp;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
#<br />
#&nbsp;&nbsp;And that's really it.&nbsp;&nbsp;You just need to add:<br />
#<br />
#&nbsp;&nbsp;1) The configuration values<br />
#&nbsp;&nbsp;2) The switches within Game_System<br />
#&nbsp;&nbsp;3) The 'main_windows_tutorial' method in your Scene code, and having it run<br />
#&nbsp;&nbsp;4) The 'update_tutorial?' method in Scene code and having it placed at the<br />
#&nbsp;&nbsp;&nbsp;&nbsp; start of update.<br />
#<br />
#<br />
#==============================================================================<br />
#<br />
#&nbsp;&nbsp;COMPATIBILITY:<br />
#<br />
#&nbsp;&nbsp;Compatible with RPGMaker XP default scripts. The only default scripts within<br />
#&nbsp;&nbsp;are aliased content.<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
#&nbsp;&nbsp;TERMS OF USE:<br />
#<br />
#&nbsp;&nbsp;Free for use, even in commercial games.&nbsp;&nbsp;Only due credit is required.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
module TutWindow<br />
<br />
<br />
&nbsp;&nbsp;# FIXED VALUES<br />
&nbsp;&nbsp;# ============<br />
&nbsp;&nbsp;# These values define the fonts used in all tutorial windows. The display is<br />
&nbsp;&nbsp;# considered static for all tutorials for a project for continuity.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;FONTNAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Font name (or array of fonts) or nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;FONTSIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Size of the font used, or nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;LINEHEIGHT&nbsp;&nbsp;&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Vertical height of each line, or nil<br />
<br />
<br />
&nbsp;&nbsp;# FLEXIBLE VALUES<br />
&nbsp;&nbsp;# ===============<br />
&nbsp;&nbsp;# These values define the shape and visual appearance of the tutorial windows.<br />
&nbsp;&nbsp;# They allow for customization so they'll work with various in-game mechanics,<br />
&nbsp;&nbsp;# and be adaptable to custom plugins actively using the Tutorial system.<br />
&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;TUTORIAL_RECT = [80, 304, 480, 160]&nbsp;&nbsp; # Rectangle area of the window <br />
&nbsp;&nbsp;&nbsp;&nbsp;OPACITY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = 120&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Opacity of the window back area<br />
&nbsp;&nbsp;&nbsp;&nbsp;WINDOWSKIN&nbsp;&nbsp;&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Custom windowskin in use<br />
<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** RPG::Cache<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;The module that loads each of RPGXP's graphic formats, creates a Bitmap<br />
#&nbsp;&nbsp;object, and retains it.<br />
#==============================================================================<br />
<br />
module RPG::Cache<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Tutorial Screen<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; filename : filename of the cached bitmap<br />
&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;def self.tutorial(filename)<br />
&nbsp;&nbsp;&nbsp;&nbsp;begin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.load_bitmap("Graphics/Tutorials/", filename)<br />
&nbsp;&nbsp;&nbsp;&nbsp;rescue <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.load_bitmap("Graphics/Tutorials/", "")<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Temp<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles temporary data that is not included with save data.<br />
#&nbsp;&nbsp;Refer to "&#36;game_temp" for the instance of this class.<br />
#==============================================================================<br />
<br />
class Game_Temp<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :tut_temp_window_opacity&nbsp;&nbsp;# Temporary window back opacity<br />
&nbsp;&nbsp;attr_accessor :tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp; # Temporary window skin<br />
&nbsp;&nbsp;attr_accessor :tut_temp_window_rect&nbsp;&nbsp;&nbsp;&nbsp; # Temporary window area defined<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias game_temp_tutorial_initialize initialize<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;game_temp_tutorial_initialize&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_temp_window_opacity&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Temporary opacity reset<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp; = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Temporary skin reset<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_temp_window_rect&nbsp;&nbsp;&nbsp;&nbsp; = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Temporary area reset<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_Tutorial<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window is used to display in-game tutorials.<br />
#==============================================================================<br />
<br />
class Window_Tutorial &lt; Window_Base<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: window x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: window y-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; width&nbsp;&nbsp;: window width<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; height : window height&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(x, y, width, height)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(x, y, width, height)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Superclass method<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width-32, height-32)&nbsp;&nbsp; # Create the contents area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.z&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= 9998&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set z-depth to near max<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.pause&nbsp;&nbsp;&nbsp;&nbsp;= false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Remove any pause glyph<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Dispose<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use superclass method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; text : text to display<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; type : (true/false) is image?<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh(text=nil, type=false)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if text.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If passing nil text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.visible&nbsp;&nbsp;= false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Hide the window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit the method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if type == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If tutorial is an image<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh_image(text)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use image option<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit the method <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh_message(text)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Show text tutorial<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh Image<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; file : filename<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_image(file)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Clear the drawing area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.opacity = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;bitmap = RPG::Cache.tutorial(file)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get the tutorial bitmap<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = bitmap&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Bitmap becomes contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;opa = 255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume solid opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::OPACITY.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If defined opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opa&nbsp;&nbsp;= TutWindow::OPACITY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use defined opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_opacity.nil?&nbsp;&nbsp;&nbsp;&nbsp;# If temp opacity exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opa = &#36;game_temp.tut_temp_window_opacity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get temp opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;end <br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents_opacity = opa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use on image contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh Message<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; text : text to display<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_message(text=nil)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh_contents&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Refresh the drawing area<br />
&nbsp;&nbsp;&nbsp;&nbsp;text.strip!&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Remove excess spaces<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;lnht&nbsp;&nbsp;= 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set default line height<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::LINEHEIGHT.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a custom line height?<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;lnht&nbsp;&nbsp;= TutWindow::LINEHEIGHT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set custom line height<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;x = y = 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set text coords to start<br />
&nbsp;&nbsp;&nbsp;&nbsp;text.gsub!(/&#92;&#92;&#92;&#92;/) { "&#92;000" }&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Change "&#92;&#92;&#92;&#92;" to "&#92;000"<br />
&nbsp;&nbsp;&nbsp;&nbsp;text.gsub!(/&#92;&#92;[Cc]&#92;[([0-9]+)&#92;]/) { "&#92;001[#{&#36;1}]"} # Change &#92;&#92;C to "&#92;001"<br />
&nbsp;&nbsp;&nbsp;&nbsp;while ((c = text.slice!(/./m)) != nil)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Loop 1 char at a time<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;c = "&#92;&#92;" if c == "&#92;000"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use original text if &#92;&#92;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if c == "&#92;001"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If &#92;C[n] (Color code)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text.sub!(/&#92;[([0-9]+)&#92;]/, "")&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get substitution value<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;color = &#36;1.to_i&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set value as color<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if color &gt;= 0 and color &lt;= 7&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Only if in range<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = text_color(color)# Use that set color<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Then skip to next text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if c == "&#92;n"&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If new line text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 0 ; y += 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reset to next line<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Then skip to next text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4+x,lnht*y,40,lnht,c)&nbsp;&nbsp; # Draw character <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x += self.contents.text_size(c).width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add to drawn text width<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh Contents<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh_contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Clear the drawing area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = normal_color&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set normal font color <br />
&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;font&nbsp;&nbsp;= Font.default_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume default font<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::FONTNAME.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a custom font defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;font&nbsp;&nbsp;= TutWindow::FONTNAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get custom font<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.name = font&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the font<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= Font.default_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume default size<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::FONTSIZE.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a custom size defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= TutWindow::FONTSIZE&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get custom size<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.size = size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;skin&nbsp;&nbsp;= &#36;game_system.windowskin_name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Assume system windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::WINDOWSKIN.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If defined windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;skin&nbsp;&nbsp;= TutWindow::WINDOWSKIN&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use defined windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_skin.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If temp skin exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;skin&nbsp;&nbsp;= &#36;game_temp.tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get temp windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;end <br />
&nbsp;&nbsp;&nbsp;&nbsp;self.windowskin = RPG::Cache.windowskin(skin)&nbsp;&nbsp;&nbsp;&nbsp; # Use windowskin<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;opa = 255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume solid opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless TutWindow::OPACITY.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If defined opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opa&nbsp;&nbsp;= TutWindow::OPACITY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use defined opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_opacity.nil?&nbsp;&nbsp;&nbsp;&nbsp;# If temp opacity exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;opa = &#36;game_temp.tut_temp_window_opacity&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get temp opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;end <br />
&nbsp;&nbsp;&nbsp;&nbsp;self.back_opacity = opa&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Use opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_skin&nbsp;&nbsp;&nbsp;&nbsp; = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase temp skin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_opacity&nbsp;&nbsp;= nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase temp opacity<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This interpreter runs event commands. This class is used within the<br />
#&nbsp;&nbsp;Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Text from map or battle event<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_text(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume invalid scene<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = true if &#36;scene.is_a?(Scene_Map)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Test if in the map<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = true if &#36;scene.is_a?(Scene_Battle)&nbsp;&nbsp;&nbsp;&nbsp;# Test if in battle<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not valid<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene.set_tutorial(text)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set into the scene<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Image from map or battle event<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_image(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume invalid scene<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = true if &#36;scene.is_a?(Scene_Map)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Test if in the map<br />
&nbsp;&nbsp;&nbsp;&nbsp;effective = true if &#36;scene.is_a?(Scene_Battle)&nbsp;&nbsp;&nbsp;&nbsp;# Test if in battle<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless effective&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not valid<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene.set_tutorial(text, true)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set into the scene<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Area<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_area(array_val)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless array_val.is_a?(Array)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if not an array<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless array_val.size == 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if params incorrect<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_rect = array_val&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set into temp array<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Opacity<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_opacity(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless value.is_a?(Integer)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if not an integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if value &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if out of range<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if value &gt; 255&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if out of range<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_opacity = value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set into temp value<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Windowskin<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def&nbsp;&nbsp;set_tutorial_skin(value)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless value.is_a?(String)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not text <br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_skin = value&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set into temp value <br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Map<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs map screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Map<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias scene_map_tutorial_main main<br />
&nbsp;&nbsp;alias scene_map_tutorial_update update<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;main_tutorial_window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Load the custom window<br />
&nbsp;&nbsp;&nbsp;&nbsp;scene_map_tutorial_main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;main_tutorial_dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dispose of the window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing (Loading custom window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main_tutorial_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;&nbsp; = TutWindow::TUTORIAL_RECT[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get the x/y/width/height<br />
&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = TutWindow::TUTORIAL_RECT[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Of the tutorial window<br />
&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= TutWindow::TUTORIAL_RECT[2]<br />
&nbsp;&nbsp;&nbsp;&nbsp;ht&nbsp;&nbsp;= TutWindow::TUTORIAL_RECT[3]&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window = Window_Tutorial.new(x,y,wd,ht)&nbsp;&nbsp;# Create with dimensions<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set the window invisible<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Dispose<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main_tutorial_dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dispose the window&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @tut_window.visible == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If the window is active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return update_tutorial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with the custom update<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;scene_map_tutorial_update&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method <br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (When testing for player input to exit tutorial screen)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_tutorial<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if !Input.trigger?(Input::C)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if Enter isn't pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set the window invisible<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; text : text passed into the tutorial window<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; type : (true/false) if the text is a tutorial image filename<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial(text=nil, type=false)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;set_tutorial_area&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Redraw area each instance<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.refresh(text, type)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Pass tutorial into window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Contents Area<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_area<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;array_val = TutWindow::TUTORIAL_RECT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Assume default window<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_rect.nil?&nbsp;&nbsp; # If a temporary area defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array_val = &#36;game_temp.tut_temp_window_rect # Use the temporary area<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_rect = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase the temporary area<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set x-coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set y-coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[2]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get window width<br />
&nbsp;&nbsp;&nbsp;&nbsp;height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= array_val[3]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get window height<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.width&nbsp;&nbsp; = width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set window width<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.height&nbsp;&nbsp;= height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set window height<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Reset the window content area<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Battle<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs battle screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Battle<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias scene_battle_tutorial_main main<br />
&nbsp;&nbsp;alias scene_battle_tutorial_update update<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;main_tutorial_window&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Load the custom window<br />
&nbsp;&nbsp;&nbsp;&nbsp;scene_battle_tutorial_main&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;main_tutorial_dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dispose of the window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing (Loading custom window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main_tutorial_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;x&nbsp;&nbsp; = TutWindow::TUTORIAL_RECT[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get the x/y/width/height<br />
&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = TutWindow::TUTORIAL_RECT[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Of the tutorial window<br />
&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= TutWindow::TUTORIAL_RECT[2]<br />
&nbsp;&nbsp;&nbsp;&nbsp;ht&nbsp;&nbsp;= TutWindow::TUTORIAL_RECT[3]&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window = Window_Tutorial.new(x,y,wd,ht)&nbsp;&nbsp;# Create with dimensions<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set the window invisible<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Dispose<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main_tutorial_dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Dispose the window&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @tut_window.visible == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If the window is active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return update_tutorial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit with the custom update<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;scene_battle_tutorial_update&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method <br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (When testing for player input to exit tutorial screen)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_tutorial<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if !Input.trigger?(Input::C)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if Enter isn't pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set the window invisible<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; text : text passed into the tutorial window<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; type : (true/false) if the text is a tutorial image filename<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial(text=nil, type=false)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;set_tutorial_area&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Redraw area each instance<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.refresh(text, type)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Pass tutorial into window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.visible = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set the window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set Tutorial Contents Area<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def set_tutorial_area<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;array_val = TutWindow::TUTORIAL_RECT&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Assume default window<br />
&nbsp;&nbsp;&nbsp;&nbsp;unless &#36;game_temp.tut_temp_window_rect.nil?&nbsp;&nbsp; # If a temporary area defined<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;array_val = &#36;game_temp.tut_temp_window_rect # Use the temporary area<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_temp.tut_temp_window_rect = nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase the temporary area<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.x&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[0]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set x-coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.y&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[1]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set y-coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = array_val[2]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get window width<br />
&nbsp;&nbsp;&nbsp;&nbsp;height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= array_val[3]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get window height<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.width&nbsp;&nbsp; = width&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set window width<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.height&nbsp;&nbsp;= height&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set window height<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Reset the window content area<br />
&nbsp;&nbsp;&nbsp;&nbsp;@tut_window.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Built into the instructions<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Compatible with RPGMaker XP default scripts. The only default scripts within are aliased content.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
<br />
The script is included within <a href="showthread.php?tid=13620"><span style="font-style: italic;" class="mycode_i"><span style="text-decoration: underline;" class="mycode_u">Two-Stage Crafting</span></span></a>.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit is required.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KTrespass XP]]></title>
			<link>https://www.save-point.org/thread-13612.html</link>
			<pubDate>Sat, 27 Jun 2026 03:01:47 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13612.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KTrespass XP</span><br />
<br />
<span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
Let the player do crazy stuff like slipping into a pond or climbing a mountain (no batteries nor UI included) by just owning a very specific item.<br />
<br />
Everything is handled by the very short KTrespass module. Just add an item ID to the Hash and set its corresponding Array of Terrain Tags, and that's it! :D<br />
<br />
<span style="font-weight: bold;" class="mycode_b">NOTE:</span> Game_Player#passable? method has been overwritten on purpose to keep the script as simple as possible.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KTrespass XP * # <br />
#   Scripter : Kyonides<br />
#   v1.0.1 - 2026-06-26<br />
<br />
# Let the player slip into a pond or climb a mountain (no UI included)<br />
# if the party owns a specific item.<br />
# Just configure the TERRAIN_ITEMS Constant below accordingly.<br />
<br />
module KTrespass<br />
  TERRAIN_ITEMS = {} # Better leave this line alone!<br />
# Terrain Tags: Never include 0 in the array!<br />
# [ItemID] = [Tag1, etc.]<br />
  TERRAIN_ITEMS[26] = [1,2]<br />
end<br />
<br />
class Game_Party<br />
  alias :kyon_trespass_gm_pty_init :initialize<br />
  alias :kyon_trespass_gm_pty_gain_item :gain_item<br />
  def initialize<br />
    kyon_trespass_gm_pty_init<br />
    @terrain_items = {}<br />
  end<br />
<br />
  def gain_item(item_id, n)<br />
    kyon_trespass_gm_pty_gain_item(item_id, n)<br />
    tags = KTrespass::TERRAIN_ITEMS[item_id]<br />
    refresh_item_terrain_tags(item_id, tags) if tags<br />
  end<br />
<br />
  def refresh_item_terrain_tags(item_id, tags)<br />
    n = @items[item_id] || 0<br />
    if n &gt; 0<br />
      @terrain_items[item_id] ||= tags<br />
    else<br />
      @terrain_items.delete(item_id)<br />
    end<br />
  end<br />
<br />
  def terrain_items<br />
    @terrain_items ||= {}<br />
  end<br />
<br />
  def item_has_terrain_tag?(target)<br />
    @terrain_items.values.flatten.include?(target)<br />
  end<br />
end<br />
<br />
class Game_Player<br />
  def passable?(x, y, d)<br />
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)<br />
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)<br />
    return false if !&#36;game_map.valid?(new_x, new_y)<br />
    return true if &#36;DEBUG and Input.press?(Input::CTRL)<br />
    return true if @through<br />
    pass_now = &#36;game_map.passable?(x, y, d, self)<br />
    pass_next = &#36;game_map.passable?(new_x, new_y, 10 - d)<br />
    if &#36;game_party.terrain_items.empty?<br />
      return false if !pass_now or !pass_next<br />
    else<br />
      if !pass_now<br />
        tag = &#36;game_map.terrain_tag(x, y)<br />
        return false if tag == 0 or !&#36;game_party.item_has_terrain_tag?(tag)<br />
      end<br />
      if !pass_next<br />
        tag = &#36;game_map.terrain_tag(new_x, new_y)<br />
        return false if !&#36;game_party.item_has_terrain_tag?(tag)<br />
      end<br />
    end<br />
    for event in &#36;game_map.events.values<br />
      if event.x == new_x and event.y == new_y<br />
        unless event.through<br />
          return false if self != &#36;game_player<br />
          return false if !event.character_name.empty?<br />
        end<br />
      end<br />
    end<br />
    if @x == new_x and @y == new_y<br />
      return true if @through or <br />
      return false if !@character_name.empty?<br />
    end<br />
    true<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Under MIT License.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KTrespass XP</span><br />
<br />
<span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
Let the player do crazy stuff like slipping into a pond or climbing a mountain (no batteries nor UI included) by just owning a very specific item.<br />
<br />
Everything is handled by the very short KTrespass module. Just add an item ID to the Hash and set its corresponding Array of Terrain Tags, and that's it! :D<br />
<br />
<span style="font-weight: bold;" class="mycode_b">NOTE:</span> Game_Player#passable? method has been overwritten on purpose to keep the script as simple as possible.<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KTrespass XP * # <br />
#   Scripter : Kyonides<br />
#   v1.0.1 - 2026-06-26<br />
<br />
# Let the player slip into a pond or climb a mountain (no UI included)<br />
# if the party owns a specific item.<br />
# Just configure the TERRAIN_ITEMS Constant below accordingly.<br />
<br />
module KTrespass<br />
  TERRAIN_ITEMS = {} # Better leave this line alone!<br />
# Terrain Tags: Never include 0 in the array!<br />
# [ItemID] = [Tag1, etc.]<br />
  TERRAIN_ITEMS[26] = [1,2]<br />
end<br />
<br />
class Game_Party<br />
  alias :kyon_trespass_gm_pty_init :initialize<br />
  alias :kyon_trespass_gm_pty_gain_item :gain_item<br />
  def initialize<br />
    kyon_trespass_gm_pty_init<br />
    @terrain_items = {}<br />
  end<br />
<br />
  def gain_item(item_id, n)<br />
    kyon_trespass_gm_pty_gain_item(item_id, n)<br />
    tags = KTrespass::TERRAIN_ITEMS[item_id]<br />
    refresh_item_terrain_tags(item_id, tags) if tags<br />
  end<br />
<br />
  def refresh_item_terrain_tags(item_id, tags)<br />
    n = @items[item_id] || 0<br />
    if n &gt; 0<br />
      @terrain_items[item_id] ||= tags<br />
    else<br />
      @terrain_items.delete(item_id)<br />
    end<br />
  end<br />
<br />
  def terrain_items<br />
    @terrain_items ||= {}<br />
  end<br />
<br />
  def item_has_terrain_tag?(target)<br />
    @terrain_items.values.flatten.include?(target)<br />
  end<br />
end<br />
<br />
class Game_Player<br />
  def passable?(x, y, d)<br />
    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)<br />
    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)<br />
    return false if !&#36;game_map.valid?(new_x, new_y)<br />
    return true if &#36;DEBUG and Input.press?(Input::CTRL)<br />
    return true if @through<br />
    pass_now = &#36;game_map.passable?(x, y, d, self)<br />
    pass_next = &#36;game_map.passable?(new_x, new_y, 10 - d)<br />
    if &#36;game_party.terrain_items.empty?<br />
      return false if !pass_now or !pass_next<br />
    else<br />
      if !pass_now<br />
        tag = &#36;game_map.terrain_tag(x, y)<br />
        return false if tag == 0 or !&#36;game_party.item_has_terrain_tag?(tag)<br />
      end<br />
      if !pass_next<br />
        tag = &#36;game_map.terrain_tag(new_x, new_y)<br />
        return false if !&#36;game_party.item_has_terrain_tag?(tag)<br />
      end<br />
    end<br />
    for event in &#36;game_map.events.values<br />
      if event.x == new_x and event.y == new_y<br />
        unless event.through<br />
          return false if self != &#36;game_player<br />
          return false if !event.character_name.empty?<br />
        end<br />
      end<br />
    end<br />
    if @x == new_x and @y == new_y<br />
      return true if @through or <br />
      return false if !@character_name.empty?<br />
    end<br />
    true<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Under MIT License.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[SPECIAL! RMWEBS RMXP PAGES (Limited Time)]]></title>
			<link>https://www.save-point.org/thread-13606.html</link>
			<pubDate>Sat, 20 Jun 2026 18:00:04 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13606.html</guid>
			<description><![CDATA[I'm going to cut this short and sweet. <br />
<br />
This download for all of the RPGMaker XP files is  480MB in size.<br />
<br />
These archives contain the 1st page... the MAIN page... of XP RubyScript Plugins post at RPGMaker Webs.<br />
<br />
<br />
For a limited time.  These can be deleted when need no longer exists.<br />
<br />
The Index to the XP RubyScript (RGSS) Scripts has roughly 12 pages, with 20 released RGSS scripts per page... except page 12 where only half were valid (13 disregarded as no content survived).  <br />
<br />
ONLY the first page of each was saved given that it was the main page with the scripts or download links.  I endeavored to grab every requisite attachment, though very little in attachments even existed as posters opted for off-site image source links.<br />
<br />
So without further adieu, the LINK to the RPGMaker Webs RMXP Links!<br />
<br />
<a href="https://www.mediafire.com/file/8qfnwbjz5rkdt62/RGSS_Scripts_%2528RMXP%2529.zip/file" target="_blank" rel="noopener" class="mycode_url">https://www.mediafire.com/file/8qfnwbjz5...9.zip/file</a><br />
<br />
<br />
<span style="color: #ff0000;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">NOTE: Well over half of these are actually by kyonides, and all of that content already exists here.</span></span><br />
Of Amaranth's Super-Simple mouse script, only a copy of her earlier zip file survived, and that by way of the internet archive.  Likewise a tool designed to work with PK8's Unlimited Graphics was retrieved by the archive and scanned with an anti-virus as the host site itself appears suss.<br />
<br />
<br />
STRUCTURE:<br />
<br />
Every index page filled with scripts has its own folder (~1, ~2, ~8...).  And you can find those within their own master folders in groups of ten... except the very last few folders.<br />
<br />
In each numbered folder filled with plugins, you will find (on average) 20 html files and matching folders containing their webpage graphics. Sadly, the webpage graphics is what causes the filesize bloat. But removing the wrong files could cause issues with the page display. <br />
<br />
Also within each numbered folder, there will be a subfolder named ~ATTACHMENTS.  It is here where necessary graphics and files are stored, those that the poster did not supply links (such as Imgur, photobucket, etc, or Github, ItchIo). To prevent their loss, they were downloaded and all placed within this folder.  It is a bit mix-n-match, but the graphic files should have names attributed to their posts and numbered in the order they were 'attached' to their post.]]></description>
			<content:encoded><![CDATA[I'm going to cut this short and sweet. <br />
<br />
This download for all of the RPGMaker XP files is  480MB in size.<br />
<br />
These archives contain the 1st page... the MAIN page... of XP RubyScript Plugins post at RPGMaker Webs.<br />
<br />
<br />
For a limited time.  These can be deleted when need no longer exists.<br />
<br />
The Index to the XP RubyScript (RGSS) Scripts has roughly 12 pages, with 20 released RGSS scripts per page... except page 12 where only half were valid (13 disregarded as no content survived).  <br />
<br />
ONLY the first page of each was saved given that it was the main page with the scripts or download links.  I endeavored to grab every requisite attachment, though very little in attachments even existed as posters opted for off-site image source links.<br />
<br />
So without further adieu, the LINK to the RPGMaker Webs RMXP Links!<br />
<br />
<a href="https://www.mediafire.com/file/8qfnwbjz5rkdt62/RGSS_Scripts_%2528RMXP%2529.zip/file" target="_blank" rel="noopener" class="mycode_url">https://www.mediafire.com/file/8qfnwbjz5...9.zip/file</a><br />
<br />
<br />
<span style="color: #ff0000;" class="mycode_color"><span style="font-weight: bold;" class="mycode_b">NOTE: Well over half of these are actually by kyonides, and all of that content already exists here.</span></span><br />
Of Amaranth's Super-Simple mouse script, only a copy of her earlier zip file survived, and that by way of the internet archive.  Likewise a tool designed to work with PK8's Unlimited Graphics was retrieved by the archive and scanned with an anti-virus as the host site itself appears suss.<br />
<br />
<br />
STRUCTURE:<br />
<br />
Every index page filled with scripts has its own folder (~1, ~2, ~8...).  And you can find those within their own master folders in groups of ten... except the very last few folders.<br />
<br />
In each numbered folder filled with plugins, you will find (on average) 20 html files and matching folders containing their webpage graphics. Sadly, the webpage graphics is what causes the filesize bloat. But removing the wrong files could cause issues with the page display. <br />
<br />
Also within each numbered folder, there will be a subfolder named ~ATTACHMENTS.  It is here where necessary graphics and files are stored, those that the poster did not supply links (such as Imgur, photobucket, etc, or Github, ItchIo). To prevent their loss, they were downloaded and all placed within this folder.  It is a bit mix-n-match, but the graphic files should have names attributed to their posts and numbered in the order they were 'attached' to their post.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KStolenBGM XP]]></title>
			<link>https://www.save-point.org/thread-13602.html</link>
			<pubDate>Fri, 19 Jun 2026 02:54:51 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13602.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KStolenBGM XP</span></span><br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
This simple scriptlet allows you to make the game, namely the NPC or the narrator or somebody else, to refuse to play the BGM or BGS that have been stolen so far.<br />
<br />
It includes both script calls for stealing or releasing the BGM and BGS during gameplay.<br />
<br />
You might need to delete old saved games to prevent the game from crashing. (It won't be able to find the new variables I've created there.)<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KStolenBGM XP * #<br />
#   Scripter : Kyonides<br />
#   v0.5.0 - 2026-06-19<br />
<br />
# Let your game steal BGM and BGS from your players!<br />
# This means that the game won't be able to play them unless they do<br />
# something about it! Oh my!<br />
<br />
# * Script Calls * #<br />
<br />
# - Steal a BGM:<br />
# &#36;game_system.steal_bgm!(OptionalMapID)<br />
<br />
# - Steal a BGS:<br />
# &#36;game_system.steal_bgs!(OptionalMapID)<br />
<br />
# - Release a BGM:<br />
# &#36;game_system.free_bgm!(OptionalMapID)<br />
<br />
# - Release a BGS:<br />
# &#36;game_system.free_bgs!(OptionalMapID)<br />
<br />
class Game_System<br />
  alias :kyon_stolen_bgm_gm_sys_init :initialize<br />
  alias :kyon_stolen_bgm_gm_sys_bgm_play :bgm_play<br />
  alias :kyon_stolen_bgm_gm_sys_bgs_play :bgs_play<br />
  def initialize<br />
    kyon_stolen_bgm_gm_sys_init<br />
    @stolen_bgm = []<br />
    @stolen_bgs = []<br />
  end<br />
<br />
  def bgm_play(bgm)<br />
    if &#36;game_map and @stolen_bgm.include?(&#36;game_map.map_id)<br />
      bgm = nil<br />
    end<br />
    kyon_stolen_bgm_gm_sys_bgm_play(bgm)<br />
  end<br />
<br />
  def steal_bgm!(map_id=nil)<br />
    map_id ||= &#36;game_map.map_id<br />
    @stolen_bgm |= [map_id]<br />
    @stolen_bgm = @stolen_bgm.sort<br />
    map_id<br />
  end<br />
<br />
  def free_bgm!(map_id=nil)<br />
    map_id ||= &#36;game_map.map_id<br />
    @stolen_bgm.delete(map_id)<br />
  end<br />
<br />
  def bgs_play(bgs)<br />
    if &#36;game_map and @stolen_bgs.include?(&#36;game_map.map_id)<br />
      bgm = nil<br />
    end<br />
    kyon_stolen_bgm_gm_sys_bgs_play(bgs)<br />
  end<br />
<br />
  def steal_bgs!(map_id=nil)<br />
    map_id ||= &#36;game_map.map_id<br />
    @stolen_bgs |= [map_id]<br />
    @stolen_bgs = @stolen_bgs.sort<br />
    map_id<br />
  end<br />
<br />
  def free_bgs!(map_id=nil)<br />
    map_id ||= &#36;game_map.map_id<br />
    @stolen_bgs.delete(map_id)<br />
  end<br />
  attr_reader :stolen_bgm, :stolen_bgs<br />
end</code></div></div><span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Under the MIT License.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KStolenBGM XP</span></span><br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
This simple scriptlet allows you to make the game, namely the NPC or the narrator or somebody else, to refuse to play the BGM or BGS that have been stolen so far.<br />
<br />
It includes both script calls for stealing or releasing the BGM and BGS during gameplay.<br />
<br />
You might need to delete old saved games to prevent the game from crashing. (It won't be able to find the new variables I've created there.)<br />
<br />
<span style="font-weight: bold;" class="mycode_b">The Script</span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KStolenBGM XP * #<br />
#   Scripter : Kyonides<br />
#   v0.5.0 - 2026-06-19<br />
<br />
# Let your game steal BGM and BGS from your players!<br />
# This means that the game won't be able to play them unless they do<br />
# something about it! Oh my!<br />
<br />
# * Script Calls * #<br />
<br />
# - Steal a BGM:<br />
# &#36;game_system.steal_bgm!(OptionalMapID)<br />
<br />
# - Steal a BGS:<br />
# &#36;game_system.steal_bgs!(OptionalMapID)<br />
<br />
# - Release a BGM:<br />
# &#36;game_system.free_bgm!(OptionalMapID)<br />
<br />
# - Release a BGS:<br />
# &#36;game_system.free_bgs!(OptionalMapID)<br />
<br />
class Game_System<br />
  alias :kyon_stolen_bgm_gm_sys_init :initialize<br />
  alias :kyon_stolen_bgm_gm_sys_bgm_play :bgm_play<br />
  alias :kyon_stolen_bgm_gm_sys_bgs_play :bgs_play<br />
  def initialize<br />
    kyon_stolen_bgm_gm_sys_init<br />
    @stolen_bgm = []<br />
    @stolen_bgs = []<br />
  end<br />
<br />
  def bgm_play(bgm)<br />
    if &#36;game_map and @stolen_bgm.include?(&#36;game_map.map_id)<br />
      bgm = nil<br />
    end<br />
    kyon_stolen_bgm_gm_sys_bgm_play(bgm)<br />
  end<br />
<br />
  def steal_bgm!(map_id=nil)<br />
    map_id ||= &#36;game_map.map_id<br />
    @stolen_bgm |= [map_id]<br />
    @stolen_bgm = @stolen_bgm.sort<br />
    map_id<br />
  end<br />
<br />
  def free_bgm!(map_id=nil)<br />
    map_id ||= &#36;game_map.map_id<br />
    @stolen_bgm.delete(map_id)<br />
  end<br />
<br />
  def bgs_play(bgs)<br />
    if &#36;game_map and @stolen_bgs.include?(&#36;game_map.map_id)<br />
      bgm = nil<br />
    end<br />
    kyon_stolen_bgm_gm_sys_bgs_play(bgs)<br />
  end<br />
<br />
  def steal_bgs!(map_id=nil)<br />
    map_id ||= &#36;game_map.map_id<br />
    @stolen_bgs |= [map_id]<br />
    @stolen_bgs = @stolen_bgs.sort<br />
    map_id<br />
  end<br />
<br />
  def free_bgs!(map_id=nil)<br />
    map_id ||= &#36;game_map.map_id<br />
    @stolen_bgs.delete(map_id)<br />
  end<br />
  attr_reader :stolen_bgm, :stolen_bgs<br />
end</code></div></div><span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Under the MIT License.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[DubeAlex's Text Scroll Script - Updated]]></title>
			<link>https://www.save-point.org/thread-13600.html</link>
			<pubDate>Thu, 18 Jun 2026 04:54:14 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13600.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">DubeAlex's Text Scroll Script - Updated</span><br />
Based on Text Scroll Script - Release 3</span><br />
<span style="font-size: medium;" class="mycode_size">by Dubealex (Nov 19 2004)</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Original Features</span></span><ul class="mycode_list"><li>Takes text from a text file in the Text directory of your projects.<br />
</li>
<li>Can show the scrolling anywhere, on the map or in another scene.<br />
</li>
<li>Live Scroll option: Allow full map interactivity while scrolling.<br />
</li>
<li>Can control scrolling speed for standard text scrolling options.<br />
</li>
<li>Can create virtual books allowing LEFT/RIGHT keys to cycle pages.<br />
</li>
<li>Can change line colors from within the text file.<br />
</li>
<li>The ability to use foreign characters (as French and German).<br />
</li>
<li>Easy to use, fast, and small.</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Updated Features</span></span><ul class="mycode_list"><li>Can accept .rxdata files in the Data\Text directory, even compressed.<br />
</li>
<li>Can be set for non-standard window sizes if a Resolution script is in use.<br />
</li>
<li>Define the system's default font, font size, font color and line height.<br />
</li>
<li>Option to use sound effects for book pages.<br />
</li>
<li>New Book Cycling option. Able to cycle continuously was originally fixed.<br />
</li>
<li>Includes new script calls to set 1-time font options (resets after use).<br />
</li>
<li>BONUS:  Simple script calls to convert txt files to/from rxdata files.</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<a href="https://app.box.com/s/vf5ogfs5pps9z6s2xzgersdh21fz7u2g" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">CLICK HERE</span></a><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
Inside the Header/Instruction page in the demo.  It should be familiar to users of the original version, but some changes have been made to the syntax.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
Should be quite compliant, merely adding content to existing scripts rather than editing/rewriting.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
Credit to Dubealex for the original version.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
This rewrite was due to a series of script requests.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
Due credit is required, both for myself and Dubealex of Creation Asylum.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">DubeAlex's Text Scroll Script - Updated</span><br />
Based on Text Scroll Script - Release 3</span><br />
<span style="font-size: medium;" class="mycode_size">by Dubealex (Nov 19 2004)</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Original Features</span></span><ul class="mycode_list"><li>Takes text from a text file in the Text directory of your projects.<br />
</li>
<li>Can show the scrolling anywhere, on the map or in another scene.<br />
</li>
<li>Live Scroll option: Allow full map interactivity while scrolling.<br />
</li>
<li>Can control scrolling speed for standard text scrolling options.<br />
</li>
<li>Can create virtual books allowing LEFT/RIGHT keys to cycle pages.<br />
</li>
<li>Can change line colors from within the text file.<br />
</li>
<li>The ability to use foreign characters (as French and German).<br />
</li>
<li>Easy to use, fast, and small.</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Updated Features</span></span><ul class="mycode_list"><li>Can accept .rxdata files in the Data\Text directory, even compressed.<br />
</li>
<li>Can be set for non-standard window sizes if a Resolution script is in use.<br />
</li>
<li>Define the system's default font, font size, font color and line height.<br />
</li>
<li>Option to use sound effects for book pages.<br />
</li>
<li>New Book Cycling option. Able to cycle continuously was originally fixed.<br />
</li>
<li>Includes new script calls to set 1-time font options (resets after use).<br />
</li>
<li>BONUS:  Simple script calls to convert txt files to/from rxdata files.</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<a href="https://app.box.com/s/vf5ogfs5pps9z6s2xzgersdh21fz7u2g" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">CLICK HERE</span></a><br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
Inside the Header/Instruction page in the demo.  It should be familiar to users of the original version, but some changes have been made to the syntax.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
Should be quite compliant, merely adding content to existing scripts rather than editing/rewriting.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
Credit to Dubealex for the original version.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
This rewrite was due to a series of script requests.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
Due credit is required, both for myself and Dubealex of Creation Asylum.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Ring Menu Advanced]]></title>
			<link>https://www.save-point.org/thread-13496.html</link>
			<pubDate>Thu, 04 Jun 2026 22:37:09 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13496.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Ring Menu Advanced</span><br />
Based upon the <br />
XRXS Ring Menu Implementation<br />
by Kazuki (2007)</span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.1</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This is another Ring Menu based upon the classic. But with new options:<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>All editable options now in a single configuration page<br />
</li>
<li>Customize the speed, size and options in the ring menu<br />
</li>
<li>Able to add and/or remove menu options by configuration<br />
</li>
<li>Flexible menu system that can begin with even 0(zero) options shown<br />
</li>
<li>Able to execute/switch-to custom scenes or common events<br />
</li>
<li>Able to use either the original or Dubealex-styled status window<br />
</li>
<li>Able to enable/disable a gold window, either XRXS or Dubealex-styled<br />
</li>
<li>Able to enable/disable a Dubealex-styled location window<br />
</li>
<li>Set the font, windowskin and opacity levels of most any window<br />
 <br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">BONUS:</span>  The Targeted Return Patch included<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> Yep... this time</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.imgur.com/4WN6QAW.jpg" loading="lazy"  alt="[Image: 4WN6QAW.jpg]" class="mycode_img" /><br />
<span style="font-size: small;" class="mycode_size">A typical Ring Menu for those familiar with Dubealex's version.<br />
It includes the Location and Gold window he designed and his version<br />
of the Party Select window replacing the Window_MenuStatus code.<br />
Note that Hilda is not present.</span><br />
 <br />
<img src="https://i.imgur.com/oAgYECw.jpg" loading="lazy"  alt="[Image: oAgYECw.jpg]" class="mycode_img" /><br />
<span style="font-size: small;" class="mycode_size">Oops? There are only five menu items?  Indeed.<br />
Hilda is still not around, and the menu is set to only show SKILLS when she's around.<br />
The Location window has been removed, and the default Gold Menu is in use.<br />
The Save Menu option is disabled.<br />
There is a faint haze of Golden Ember (or Gomashio Yellow) across the screen, Kazuki's color choice and not mine.<br />
And this time the Party Select window is Kazuki's</span></div>
</div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/0ywqdknznk3bhbjwd1jieynrstg444gf" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Here it is!  <span style="color: #E82A1F;" class="mycode_color">A Box.Com</span> Link</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Completely within the demo.  The header page is dedicated to the instructions while compact instructions are in the configuration page.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">FAQ</span></span><br />
<br />
Believe it or not, I had this working with game windows larger than 640x480.<br />
I also added a nice and sporty little NOT/CANCEL icon.  Took like... 2 minutes to sprite?<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
This will overwrite Scene_Menu. And it uses its own Window_MenuStatus code.  So add-ons that affect the window in the main menu showing the party won't function.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
My thanks to Kazuki who created the original version of the Ring Menu.  Thanks to Dubealex for the Location and Gold windows, and the center forced Menu command display. And thanks to Ouga Zaitou who provided some bitmap content for Kazuki's original work.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Though Kazuki ended support for the Ring Menu nearly two decades ago, actively placing this within an actual 'abandoned' script list, I ask for due credit for myself, Kazuki and Ouga Zaitou.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Ring Menu Advanced</span><br />
Based upon the <br />
XRXS Ring Menu Implementation<br />
by Kazuki (2007)</span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.1</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This is another Ring Menu based upon the classic. But with new options:<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>All editable options now in a single configuration page<br />
</li>
<li>Customize the speed, size and options in the ring menu<br />
</li>
<li>Able to add and/or remove menu options by configuration<br />
</li>
<li>Flexible menu system that can begin with even 0(zero) options shown<br />
</li>
<li>Able to execute/switch-to custom scenes or common events<br />
</li>
<li>Able to use either the original or Dubealex-styled status window<br />
</li>
<li>Able to enable/disable a gold window, either XRXS or Dubealex-styled<br />
</li>
<li>Able to enable/disable a Dubealex-styled location window<br />
</li>
<li>Set the font, windowskin and opacity levels of most any window<br />
 <br />
</li>
<li><span style="font-weight: bold;" class="mycode_b">BONUS:</span>  The Targeted Return Patch included<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> Yep... this time</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.imgur.com/4WN6QAW.jpg" loading="lazy"  alt="[Image: 4WN6QAW.jpg]" class="mycode_img" /><br />
<span style="font-size: small;" class="mycode_size">A typical Ring Menu for those familiar with Dubealex's version.<br />
It includes the Location and Gold window he designed and his version<br />
of the Party Select window replacing the Window_MenuStatus code.<br />
Note that Hilda is not present.</span><br />
 <br />
<img src="https://i.imgur.com/oAgYECw.jpg" loading="lazy"  alt="[Image: oAgYECw.jpg]" class="mycode_img" /><br />
<span style="font-size: small;" class="mycode_size">Oops? There are only five menu items?  Indeed.<br />
Hilda is still not around, and the menu is set to only show SKILLS when she's around.<br />
The Location window has been removed, and the default Gold Menu is in use.<br />
The Save Menu option is disabled.<br />
There is a faint haze of Golden Ember (or Gomashio Yellow) across the screen, Kazuki's color choice and not mine.<br />
And this time the Party Select window is Kazuki's</span></div>
</div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/0ywqdknznk3bhbjwd1jieynrstg444gf" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Here it is!  <span style="color: #E82A1F;" class="mycode_color">A Box.Com</span> Link</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Completely within the demo.  The header page is dedicated to the instructions while compact instructions are in the configuration page.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">FAQ</span></span><br />
<br />
Believe it or not, I had this working with game windows larger than 640x480.<br />
I also added a nice and sporty little NOT/CANCEL icon.  Took like... 2 minutes to sprite?<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
This will overwrite Scene_Menu. And it uses its own Window_MenuStatus code.  So add-ons that affect the window in the main menu showing the party won't function.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
My thanks to Kazuki who created the original version of the Ring Menu.  Thanks to Dubealex for the Location and Gold windows, and the center forced Menu command display. And thanks to Ouga Zaitou who provided some bitmap content for Kazuki's original work.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Though Kazuki ended support for the Ring Menu nearly two decades ago, actively placing this within an actual 'abandoned' script list, I ask for due credit for myself, Kazuki and Ouga Zaitou.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[XRXS_MP 6. Ring Menu Implementation]]></title>
			<link>https://www.save-point.org/thread-13495.html</link>
			<pubDate>Tue, 02 Jun 2026 21:09:26 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13495.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">XRXS_MP 6. Ring Menu Implementation</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version:  1.2<br />
by Kazuki</span><br />
<span style="font-size: xx-small;" class="mycode_size">&copy; 2007<br />
Version 1.0 Release &copy; 2005</span><br />
<span style="font-style: italic;" class="mycode_i">Yes, the creator's name is Kazuki, NOT XRXS</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
For years, I've seen the XRXS Ring Menu with additions by Dubealex and others.  But never a pure version of the original version. So I decided to use my lycanthropic werewolf hunting skills to track down a pure version untouched by western editors.<br />
<br />
And here it is.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Its a RING menu<br />
</li>
<li>Contains a compact actor menu when selecting choices like Equip or Skill<br />
</li>
<li>Able to customize the icons<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
I am providing BOTH the original version 1.2 (circa 2007 which Kazuki stated was abandoned) and an English version thanks to an hour's worth of wolfish translation.<br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> Japanese Original Version</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># ▼▲▼ XRXS_MP 6. リングメニュー導入 ver.1.2 ▼▲▼<br />
# by 和希<br />
<br />
#==============================================================================<br />
# □ カスタマイズポイント<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  STARTUP_FRAMES =  20 # 初期アニメーションのフレーム数<br />
  MOVING_FRAMES  = &nbsp;&nbsp;5 # リングを回した時のフレーム数<br />
  RING_R       &nbsp;&nbsp;=  64 # リングの半径<br />
  SE_STARTUP  = "056-Right02" # メニューを開いたときに鳴らすSE<br />
  ICON_ITEM &nbsp;&nbsp;= RPG::Cache.icon("034-Item03") &nbsp;&nbsp;# 「 アイテム 」メニューのアイコン<br />
  ICON_SKILL  = RPG::Cache.icon("044-Skill01")  # 「　スキル　」メニューのアイコン<br />
  ICON_EQUIP  = RPG::Cache.icon("001-Weapon01") # 「　 装備 　」メニューのアイコン<br />
  ICON_STATUS = RPG::Cache.icon("050-Skill07")  # 「ステータス」メニューのアイコン<br />
  ICON_SAVE &nbsp;&nbsp;= RPG::Cache.icon("038-Item07") &nbsp;&nbsp;# 「　セーブ　」メニューのアイコン<br />
  ICON_EXIT &nbsp;&nbsp;= RPG::Cache.icon("046-Skill03")  # 「　 終了 　」メニューのアイコン<br />
  ICON_DISABLE= RPG::Cache.icon("")           &nbsp;&nbsp;# 使用禁止項目に付くアイコン<br />
  BACKGROUND_COLOR = Color.new(0xcc,0x99,0x33,0x3f)<br />
end<br />
###############################################################################<br />
# リングメニュー導入スクリプト Ver. 1.2<br />
#               &nbsp;&nbsp;writen by 和希<br />
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
# ▽導入<br />
# &nbsp;&nbsp;０．先に XRXL 2. ビットマップ/アイコン描写 を入れて置いてください。<br />
# &nbsp;&nbsp;１．このスクリプトをMainセクションの上に作った新しいセクションにコピーする<br />
# &nbsp;&nbsp;２．Window_RingMenuの上部にある７つの RPG::Cache.icon("") の "" の中に<br />
#     &nbsp;&nbsp;右の説明に書いてあるコマンド用のアイコン名を書く。<br />
#     &nbsp;&nbsp;(一番下の使用禁止は選べないメニューに重ねるアイコンです。<br />
#        こんなのがいいかも→ φ )<br />
# &nbsp;&nbsp;３．アイコン設定のすぐ下にある SE_STARTUP = "" の "" の中にメニューを<br />
#     &nbsp;&nbsp;開いたときに鳴らしたいのSEの名前を書く。<br />
# ▽スクリプト触れる人へ<br />
# &nbsp;&nbsp;とりあえず動く物を目標に作ったものなので(志低いｗ)、座標の調整などが不完全です。<br />
# &nbsp;&nbsp;より正確にアクターの画面座標を取得する処理を追加したり、アクター一覧の位置を<br />
# &nbsp;&nbsp;変えたり、文字表示などなどを調整するといい感じに仕上がる気がします。<br />
###############################################################################<br />
<br />
#==============================================================================<br />
# ■ Window_RingMenu<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  #--------------------------------------------------------------------------<br />
  # ○ クラス定数<br />
  #--------------------------------------------------------------------------<br />
  MODE_START = 1 # スタートアップアニメーション<br />
  MODE_WAIT  = 2 # 待機<br />
  MODE_MOVER = 3 # 時計回り回転アニメーション<br />
  MODE_MOVEL = 4 # 反時計回り回転アニメーション<br />
  #--------------------------------------------------------------------------<br />
  # ○ アクセサ<br />
  #--------------------------------------------------------------------------<br />
  attr_accessor :index<br />
  attr_reader :commands<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #--------------------------------------------------------------------------<br />
  def initialize( center_x, center_y )<br />
    super(-16, -16, 640+32, 480+32)<br />
    self.contents = Bitmap.new(width-32, height-32)<br />
    self.opacity = 0<br />
    self.back_opacity = 0<br />
    s1 = &#36;data_system.words.item<br />
    s2 = &#36;data_system.words.skill<br />
    s3 = &#36;data_system.words.equip<br />
    s4 = "ステータス"<br />
    s5 = "セーブ"<br />
    s6 = "ゲーム終了"<br />
    @commands = [ s1, s2, s3, s4, s5, s6 ]<br />
    @item_max = 6<br />
    @index = 0<br />
    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]<br />
    @disabled = [ false, false, false, false, false, false ]<br />
    @cx = center_x<br />
    @cy = center_y<br />
    setup_move_start<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    super<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 画面再描画<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    # 背景描画<br />
    if BACKGROUND_COLOR.alpha &gt; 0<br />
      self.contents.fill_rect(0,0,640,480,BACKGROUND_COLOR)<br />
    end<br />
    # アイコンを描画<br />
    case @mode<br />
    when MODE_START<br />
      refresh_start<br />
    when MODE_WAIT<br />
      refresh_wait<br />
    when MODE_MOVER<br />
      refresh_move(1)<br />
    when MODE_MOVEL<br />
      refresh_move(0)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(初期化時)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_start<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = 1.0 * Math::PI / STARTUP_FRAMES<br />
    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( r * Math.sin( d ) ).to_i<br />
      y = @cy - ( r * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(待機時)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_wait<br />
    d = 2.0 * Math::PI / @item_max<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      x = @cx + ( RING_R * Math.sin( d * j ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d * j ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(回転時)<br />
  #  mode : 0=反時計回り 1=時計回り<br />
  #--------------------------------------------------------------------------<br />
  def refresh_move( mode )<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = d1 / MOVING_FRAMES<br />
    d2 *= -1 if mode != 0<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( RING_R * Math.sin( d ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 項目の描画<br />
  #   &nbsp;&nbsp;x : <br />
  #   &nbsp;&nbsp;y : <br />
  #   &nbsp;&nbsp;i : 項目番号<br />
  #--------------------------------------------------------------------------<br />
  def draw_item(x, y, i)<br />
    rect = Rect.new(0, 0, @items[i].width, @items[i].height)<br />
    x -= rect.width/2<br />
    y -= rect.height/2<br />
    if @index == i<br />
      self.contents.blt( x, y, @items[i], rect )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect )<br />
      end<br />
    else<br />
      self.contents.blt( x, y, @items[i], rect, 128 )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect, 128 )<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 項目を無効にする<br />
  #   &nbsp;&nbsp;index : 項目番号<br />
  #--------------------------------------------------------------------------<br />
  def disable_item(index)<br />
    @disabled[index] = true<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 初期化アニメーションの準備<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_start<br />
    @mode = MODE_START<br />
    @steps = STARTUP_FRAMES<br />
    if  SE_STARTUP != nil and SE_STARTUP != ""<br />
      Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 回転アニメーションの準備<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_move(mode)<br />
    if mode == MODE_MOVER<br />
      @index -= 1<br />
      @index = @items.size - 1 if @index &lt; 0<br />
    elsif mode == MODE_MOVEL<br />
      @index += 1<br />
      @index = 0 if @index &gt;= @items.size<br />
    else<br />
      return<br />
    end<br />
    @mode = mode<br />
    @steps = MOVING_FRAMES<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ アニメーション中かどうか<br />
  #--------------------------------------------------------------------------<br />
  def animation?<br />
    return @mode != MODE_WAIT<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
# 　メニュー画面でパーティメンバーのステータスを表示するウィンドウです。<br />
#==============================================================================<br />
<br />
class Window_RingMenuStatus &lt; Window_Selectable<br />
  attr_reader :max_index<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #--------------------------------------------------------------------------<br />
  def initialize<br />
    @max_index = &#36;game_party.actors.size - 1<br />
    h = 32 * (@max_index + 1) + 32<br />
    h = 416 if h &gt; 416<br />
    x = 0<br />
    x = 456 if &#36;game_player.screen_x &lt; 200 + Window_RingMenu::RING_R<br />
    super(x, 64, 184, h)<br />
    self.contents = Bitmap.new(width - 32, &#36;game_party.actors.size * 32)<br />
    refresh<br />
    self.active = false<br />
    self.index = -1<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● リフレッシュ<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    @item_max = &#36;game_party.actors.size<br />
    for i in 0...&#36;game_party.actors.size<br />
      x = 32<br />
      y = 32 * i<br />
      actor = &#36;game_party.actors[i]<br />
      self.contents.draw_facesquare(actor.character_name, actor.character_hue,<br />
                                    4, y + 4 )<br />
      draw_actor_name(actor, x, y)<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Scene_Menu<br />
#------------------------------------------------------------------------------<br />
# 　メニュー画面の処理を行うクラスです。<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #   &nbsp;&nbsp;menu_index : コマンドのカーソル初期位置<br />
  #--------------------------------------------------------------------------<br />
  def initialize(menu_index = 0)<br />
    @menu_index = menu_index<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● メイン処理<br />
  #--------------------------------------------------------------------------<br />
  def main<br />
    # スプライトセットを作成<br />
    @spriteset = Spriteset_Map.new<br />
    # コマンドウィンドウを作成<br />
    bmp = RPG::Cache.character(&#36;game_party.actors[0].character_name, 0)<br />
    px = &#36;game_player.screen_x<br />
    py = &#36;game_player.screen_y - bmp.rect.height / 4 / 2<br />
    @command_window = Window_RingMenu.new(px,py)<br />
    @command_window.index = @menu_index<br />
    # パーティ人数が 0 人の場合<br />
    if &#36;game_party.actors.size == 0<br />
      # アイテム、スキル、装備、ステータスを無効化<br />
      @command_window.disable_item(0)<br />
      @command_window.disable_item(1)<br />
      @command_window.disable_item(2)<br />
      @command_window.disable_item(3)<br />
    end<br />
    @command_window.z = 100<br />
    # セーブ禁止の場合<br />
    if &#36;game_system.save_disabled<br />
      # セーブを無効にする<br />
      @command_window.disable_item(4)<br />
    end<br />
    # ステータスウィンドウを作成<br />
    @status_window = Window_RingMenuStatus.new<br />
    @status_window.z = 200<br />
    @status_window.visible = false<br />
    # ヘルプウィンドウを作成<br />
    @help_window = Window_Help.new<br />
    @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
    # トランジション実行<br />
    Graphics.transition<br />
    # メインループ<br />
    loop do<br />
      # ゲーム画面を更新<br />
      Graphics.update<br />
      # 入力情報を更新<br />
      Input.update<br />
      # フレーム更新<br />
      update<br />
      # 画面が切り替わったらループを中断<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    # トランジション準備<br />
    Graphics.freeze<br />
    # スプライトセットを解放<br />
    @spriteset.dispose<br />
    # ウィンドウを解放<br />
    @command_window.dispose<br />
    @status_window.dispose<br />
    @help_window.dispose<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    # ウィンドウを更新<br />
    @command_window.update<br />
    @status_window.update<br />
    @help_window.update<br />
    # コマンドウィンドウがアクティブの場合: update_command を呼ぶ<br />
    if @command_window.active<br />
      update_command<br />
      return<br />
    end<br />
    # ステータスウィンドウがアクティブの場合: update_status を呼ぶ<br />
    if @status_window.active<br />
      update_status<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新 (コマンドウィンドウがアクティブの場合)<br />
  #--------------------------------------------------------------------------<br />
  def update_command<br />
    # B ボタンが押された場合<br />
    if Input.trigger?(Input::B)<br />
      # キャンセル SE を演奏<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # マップ画面に切り替え<br />
      &#36;scene = Scene_Map.new<br />
      return<br />
    end<br />
    # C ボタンが押された場合<br />
    if Input.trigger?(Input::C)<br />
      # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合<br />
      if &#36;game_party.actors.size == 0 and @command_window.index &lt; 4<br />
        # ブザー SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      # コマンドウィンドウのカーソル位置で分岐<br />
      case @command_window.index<br />
      when 0  # アイテム<br />
        # 決定  SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # アイテム画面に切り替え<br />
        &#36;scene = Scene_Item.new<br />
      when 1  # スキル<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 2  # 装備<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 3  # ステータス<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 4  # セーブ<br />
        # セーブ禁止の場合<br />
        if &#36;game_system.save_disabled<br />
          # ブザー SE を演奏<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # セーブ画面に切り替え<br />
        &#36;scene = Scene_Save.new<br />
      when 5  # ゲーム終了<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ゲーム終了画面に切り替え<br />
        &#36;scene = Scene_End.new<br />
      end<br />
      return<br />
    end<br />
    # アニメーション中ならカーソルの処理を行わない<br />
    return if @command_window.animation?<br />
    # ↑or← ボタンが押された場合<br />
    if Input.press?(Input::UP) or  Input.press?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
    # ↓or→ ボタンが押された場合<br />
    if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新 (ステータスウィンドウがアクティブの場合)<br />
  #--------------------------------------------------------------------------<br />
  def update_status<br />
    # B ボタンが押された場合<br />
    if Input.trigger?(Input::B)<br />
      # キャンセル SE を演奏<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # コマンドウィンドウをアクティブにする<br />
      @command_window.active = true<br />
      @status_window.active = false<br />
      @status_window.visible = false<br />
      @status_window.index = -1<br />
      return<br />
    end<br />
    # C ボタンが押された場合<br />
    if Input.trigger?(Input::C)<br />
      # コマンドウィンドウのカーソル位置で分岐<br />
      case @command_window.index<br />
      when 1  # スキル<br />
        # このアクターの行動制限が 2 以上の場合<br />
        if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
          # ブザー SE を演奏<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # スキル画面に切り替え<br />
        &#36;scene = Scene_Skill.new(@status_window.index)<br />
      when 2  # 装備<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # 装備画面に切り替え<br />
        &#36;scene = Scene_Equip.new(@status_window.index)<br />
      when 3  # ステータス<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータス画面に切り替え<br />
        &#36;scene = Scene_Status.new(@status_window.index)<br />
      end<br />
      return<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ◇ 外部ライブラリ<br />
#==============================================================================<br />
class Bitmap<br />
# ▼▲▼ XRXL 1. ライン・図形描写 ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● ライン描画 by 桜雅 在土<br />
  #--------------------------------------------------------------------------<br />
  def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)<br />
    # 描写距離の計算。大きめに直角時の長さ。<br />
    distance = (start_x - end_x).abs + (start_y - end_y).abs<br />
    # 描写開始<br />
    if end_color == start_color<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        if width == 1<br />
          self.set_pixel(x, y, start_color) <br />
        else<br />
          self.fill_rect(x, y, width, width, start_color) <br />
        end<br />
      end<br />
    else<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        r = start_color.red &nbsp;&nbsp;* (distance-i)/distance + end_color.red &nbsp;&nbsp;* i/distance<br />
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance<br />
        b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance<br />
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance<br />
        if width == 1<br />
          self.set_pixel(x, y, Color.new(r, g, b, a))<br />
        else<br />
          self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) <br />
        end<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 多角形の描画(塗りつぶしなし) by 和希<br />
  #    peaks    : 頂点座標の配列 [[x1,y1],[x2,y2],[x3,y3], ... ]<br />
  #    color    : 線の色<br />
  #    width    : 線の幅<br />
  #--------------------------------------------------------------------------<br />
  def draw_polygon(peaks, color, width = 1)<br />
    # 辺(=頂点)の個数分だけ辺を描く<br />
    for i in 0 ... (peaks.size - 1)<br />
      # 頂点同士を線で結ぶ<br />
      draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )<br />
    end<br />
    # 最後の頂点と最初の頂点を結ぶ<br />
    draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )<br />
  end<br />
# ▼▲▼ XRXL 2. ビットマップ/アイコン描写 ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● 顔＆枠の描画 by 桜雅 在土<br />
  #   &nbsp;&nbsp;character_name : 描写に利用するキャラクターグラフィック<br />
  #   &nbsp;&nbsp;character_hue  : 描写の色合い<br />
  #   &nbsp;&nbsp;x     &nbsp;&nbsp;: 描画先 X 座標<br />
  #   &nbsp;&nbsp;y     &nbsp;&nbsp;: 描画先 Y 座標<br />
  #--------------------------------------------------------------------------<br />
  def draw_facesquare(character_name, character_hue, x, y, size = 24)<br />
    bitmap = RPG::Cache.character(character_name, character_hue)<br />
    src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)<br />
    self.blt(x, y, bitmap, src_rect)<br />
    self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))<br />
  end<br />
end</code></div></div></div>
		</div>
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> English Translated Version</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># ▼▲▼ XRXS_MP 6. Ring Menu Implementation ver.1.2 ▼▲▼<br />
# By Kazuki<br />
<br />
#==============================================================================<br />
# □ Customization Points<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  STARTUP_FRAMES =  20 # Number of frames in the initial animation<br />
  MOVING_FRAMES  = &nbsp;&nbsp;5 # The number of frames when rotating the ring<br />
  RING_R       &nbsp;&nbsp;=  64 # Radius of the ring<br />
  SE_STARTUP  = "056-Right02" # The sound effect played when opening the menu<br />
  ICON_ITEM &nbsp;&nbsp;= RPG::Cache.icon("034-Item03") &nbsp;&nbsp;# Icons in the "Items" Menu<br />
  ICON_SKILL  = RPG::Cache.icon("044-Skill01")  # Icons in the "Skills" Menu<br />
  ICON_EQUIP  = RPG::Cache.icon("001-Weapon01") # "Equipment" Menu Icon<br />
  ICON_STATUS = RPG::Cache.icon("050-Skill07")  # "Status" Menu Icons<br />
  ICON_SAVE &nbsp;&nbsp;= RPG::Cache.icon("038-Item07") &nbsp;&nbsp;# "Save" Menu Icon<br />
  ICON_EXIT &nbsp;&nbsp;= RPG::Cache.icon("046-Skill03")  # "Exit" Menu Icon<br />
  ICON_DISABLE= RPG::Cache.icon("")           &nbsp;&nbsp;# Icons for Prohibited Items<br />
  BACKGROUND_COLOR = Color.new(0xcc,0x99,0x33,0x3f)<br />
end<br />
###############################################################################<br />
# Ring Menu Implementation Script Ver. 1.2<br />
#               &nbsp;&nbsp;writen by Kazuki<br />
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
# ▽ Introduction<br />
# &nbsp;&nbsp;0. Please install "XRXL 2. Bitmap/Icon Rendering" beforehand.<br />
# &nbsp;&nbsp;1. Copy this script into a new section created above the Main section.<br />
# &nbsp;&nbsp;2. Inside the double quotas (`""`) of the sevenRPG::Cache.icon("") entries<br />
#      located at the top of `Window_RingMenu, enter the icon for each command.<br />
#      Follow as they are described in the comments to the right.<br />
#      The "Disabled" icon at the bottom is an icon that overlays atop the<br />
#      menu icons that cannot be selected. Recommended is something like: φ<br />
# &nbsp;&nbsp;3. Inside the "" of the TSE_STARTUP value, place the sound effect that you<br />
#      want to sound when the menu opens<br />
# ▽ For those comfortable working with scripts<br />
# &nbsp;&nbsp;Since I built this with the sole goal of getting something—anything—up and<br />
# &nbsp;&nbsp;running (yeah, I set the bar pretty low!), the coordinate alignment and<br />
# &nbsp;&nbsp;similar details are still incomplete.<br />
# &nbsp;&nbsp;We added a process to obtain the actor's screen coordinates more accurately,<br />
# &nbsp;&nbsp;and the position of the actor list.<br />
# &nbsp;&nbsp;I feel like if you tweak things—such as making changes or adjusting the text<br />
# &nbsp;&nbsp;display—it will turn out really nicely.<br />
###############################################################################<br />
<br />
#==============================================================================<br />
# ■ Window_RingMenu<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  #--------------------------------------------------------------------------<br />
  # ○ Class Constants<br />
  #--------------------------------------------------------------------------<br />
  MODE_START = 1 # Startup Animation<br />
  MODE_WAIT  = 2 # Stand By<br />
  MODE_MOVER = 3 # Clockwise Rotation Animation<br />
  MODE_MOVEL = 4 # Counter-clockwise Rotation Animation<br />
  #--------------------------------------------------------------------------<br />
  # ○ Public Instance Variables<br />
  #--------------------------------------------------------------------------<br />
  attr_accessor :index<br />
  attr_reader :commands<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #--------------------------------------------------------------------------<br />
  def initialize( center_x, center_y )<br />
    super(-16, -16, 640+32, 480+32)<br />
    self.contents = Bitmap.new(width-32, height-32)<br />
    self.opacity = 0<br />
    self.back_opacity = 0<br />
    s1 = &#36;data_system.words.item<br />
    s2 = &#36;data_system.words.skill<br />
    s3 = &#36;data_system.words.equip<br />
    s4 = "Status"<br />
    s5 = "Save"<br />
    s6 = "Game Over"<br />
    @commands = [ s1, s2, s3, s4, s5, s6 ]<br />
    @item_max = 6<br />
    @index = 0<br />
    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]<br />
    @disabled = [ false, false, false, false, false, false ]<br />
    @cx = center_x<br />
    @cy = center_y<br />
    setup_move_start<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    super<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Refresh<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    # Draw background<br />
    if BACKGROUND_COLOR.alpha &gt; 0<br />
      self.contents.fill_rect(0,0,640,480,BACKGROUND_COLOR)<br />
    end<br />
    # Draw Icon<br />
    case @mode<br />
    when MODE_START<br />
      refresh_start<br />
    when MODE_WAIT<br />
      refresh_wait<br />
    when MODE_MOVER<br />
      refresh_move(1)<br />
    when MODE_MOVEL<br />
      refresh_move(0)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen redraw (at initialization)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_start<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = 1.0 * Math::PI / STARTUP_FRAMES<br />
    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( r * Math.sin( d ) ).to_i<br />
      y = @cy - ( r * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen redraw (standby)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_wait<br />
    d = 2.0 * Math::PI / @item_max<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      x = @cx + ( RING_R * Math.sin( d * j ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d * j ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen Redraw (on Rotation)<br />
  #  mode : 0=Counter-clockwise 1=Clockwise<br />
  #--------------------------------------------------------------------------<br />
  def refresh_move( mode )<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = d1 / MOVING_FRAMES<br />
    d2 *= -1 if mode != 0<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( RING_R * Math.sin( d ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Draw Item<br />
  #   &nbsp;&nbsp;x : <br />
  #   &nbsp;&nbsp;y : <br />
  #   &nbsp;&nbsp;i : Item number<br />
  #--------------------------------------------------------------------------<br />
  def draw_item(x, y, i)<br />
    rect = Rect.new(0, 0, @items[i].width, @items[i].height)<br />
    x -= rect.width/2<br />
    y -= rect.height/2<br />
    if @index == i<br />
      self.contents.blt( x, y, @items[i], rect )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect )<br />
      end<br />
    else<br />
      self.contents.blt( x, y, @items[i], rect, 128 )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect, 128 )<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Disable Item<br />
  #   &nbsp;&nbsp;index : Item number<br />
  #--------------------------------------------------------------------------<br />
  def disable_item(index)<br />
    @disabled[index] = true<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Preparing the Initialization Animation<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_start<br />
    @mode = MODE_START<br />
    @steps = STARTUP_FRAMES<br />
    if  SE_STARTUP != nil and SE_STARTUP != ""<br />
      Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Preparing the Rotation Animation<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_move(mode)<br />
    if mode == MODE_MOVER<br />
      @index -= 1<br />
      @index = @items.size - 1 if @index &lt; 0<br />
    elsif mode == MODE_MOVEL<br />
      @index += 1<br />
      @index = 0 if @index &gt;= @items.size<br />
    else<br />
      return<br />
    end<br />
    @mode = mode<br />
    @steps = MOVING_FRAMES<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Whether currently animating<br />
  #--------------------------------------------------------------------------<br />
  def animation?<br />
    return @mode != MODE_WAIT<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
# 　This window displays party member status on the menu screen.<br />
#==============================================================================<br />
<br />
class Window_RingMenuStatus &lt; Window_Selectable<br />
  attr_reader :max_index<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #--------------------------------------------------------------------------<br />
  def initialize<br />
    @max_index = &#36;game_party.actors.size - 1<br />
    h = 32 * (@max_index + 1) + 32<br />
    h = 416 if h &gt; 416<br />
    x = 0<br />
    x = 456 if &#36;game_player.screen_x &lt; 200 + Window_RingMenu::RING_R<br />
    super(x, 64, 184, h)<br />
    self.contents = Bitmap.new(width - 32, &#36;game_party.actors.size * 32)<br />
    refresh<br />
    self.active = false<br />
    self.index = -1<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Refresh<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    @item_max = &#36;game_party.actors.size<br />
    for i in 0...&#36;game_party.actors.size<br />
      x = 32<br />
      y = 32 * i<br />
      actor = &#36;game_party.actors[i]<br />
      self.contents.draw_facesquare(actor.character_name, actor.character_hue,<br />
                                    4, y + 4 )<br />
      draw_actor_name(actor, x, y)<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Scene_Menu<br />
#------------------------------------------------------------------------------<br />
# 　This class performs menu screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #   &nbsp;&nbsp;menu_index : command cursor's initial position<br />
  #--------------------------------------------------------------------------<br />
  def initialize(menu_index = 0)<br />
    @menu_index = menu_index<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Main Processing<br />
  #--------------------------------------------------------------------------<br />
  def main<br />
    # Make spriteset<br />
    @spriteset = Spriteset_Map.new<br />
    # Make command window<br />
    bmp = RPG::Cache.character(&#36;game_party.actors[0].character_name, 0)<br />
    px = &#36;game_player.screen_x<br />
    py = &#36;game_player.screen_y - bmp.rect.height / 4 / 2<br />
    @command_window = Window_RingMenu.new(px,py)<br />
    @command_window.index = @menu_index<br />
    # If number of party members is 0<br />
    if &#36;game_party.actors.size == 0<br />
      # Disable items, skills, equipment, and status<br />
      @command_window.disable_item(0)<br />
      @command_window.disable_item(1)<br />
      @command_window.disable_item(2)<br />
      @command_window.disable_item(3)<br />
    end<br />
    @command_window.z = 100<br />
    # If save is forbidden<br />
    if &#36;game_system.save_disabled<br />
      # Disable save<br />
      @command_window.disable_item(4)<br />
    end<br />
    # Make status window<br />
    @status_window = Window_RingMenuStatus.new<br />
    @status_window.z = 200<br />
    @status_window.visible = false<br />
    # Make help window<br />
    @help_window = Window_Help.new<br />
    @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
    # Execute transition<br />
    Graphics.transition<br />
    # Main loop<br />
    loop do<br />
      # Update game screen<br />
      Graphics.update<br />
      # Update input information<br />
      Input.update<br />
      # Frame update<br />
      update<br />
      # Abort loop if screen is changed<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    # Prepare for transition<br />
    Graphics.freeze<br />
    # Dispose of spriteset<br />
    @spriteset.dispose<br />
    # Dispose of windows<br />
    @command_window.dispose<br />
    @status_window.dispose<br />
    @help_window.dispose<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    # Update windows<br />
    @command_window.update<br />
    @status_window.update<br />
    @help_window.update<br />
    # If command window is active: call update_command<br />
    if @command_window.active<br />
      update_command<br />
      return<br />
    end<br />
    # If status window is active: call update_status<br />
    if @status_window.active<br />
      update_status<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update (when command window is active)<br />
  #--------------------------------------------------------------------------<br />
  def update_command<br />
    # If B button was pressed<br />
    if Input.trigger?(Input::B)<br />
      # Play cancel SE<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # Switch to map screen<br />
      &#36;scene = Scene_Map.new<br />
      return<br />
    end<br />
    # If C button was pressed<br />
    if Input.trigger?(Input::C)<br />
      # If command other than save or end game, and party members = 0<br />
      if &#36;game_party.actors.size == 0 and @command_window.index &lt; 4<br />
        # Play buzzer SE<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      # Branch by command window cursor position<br />
      case @command_window.index<br />
      when 0  # item<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to item screen<br />
        &#36;scene = Scene_Item.new<br />
      when 1  # skill<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 2  # equipment<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 3  # status<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 4  # save<br />
        # If saving is forbidden<br />
        if &#36;game_system.save_disabled<br />
          # Play buzzer SE<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to save screen<br />
        &#36;scene = Scene_Save.new<br />
      when 5  # Game Over<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to end game screen<br />
        &#36;scene = Scene_End.new<br />
      end<br />
      return<br />
    end<br />
    # Do not process the cursor while an animation is in progress.<br />
    return if @command_window.animation?<br />
    # ↑or← ボタンが押された場合<br />
    if Input.press?(Input::UP) or  Input.press?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
    # If the ↓ or → button is pressed<br />
    if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update (when status window is active)<br />
  #--------------------------------------------------------------------------<br />
  def update_status<br />
    # If B button was pressed<br />
    if Input.trigger?(Input::B)<br />
      # Play cancel SE<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # Make command window active<br />
      @command_window.active = true<br />
      @status_window.active = false<br />
      @status_window.visible = false<br />
      @status_window.index = -1<br />
      return<br />
    end<br />
    # If C button was pressed<br />
    if Input.trigger?(Input::C)<br />
      # Branch by command window cursor position<br />
      case @command_window.index<br />
      when 1  # skill<br />
        # If this actor's action limit is 2 or more<br />
        if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
          # Play buzzer SE<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to skill screen<br />
        &#36;scene = Scene_Skill.new(@status_window.index)<br />
      when 2  # equipment<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to equipment screen<br />
        &#36;scene = Scene_Equip.new(@status_window.index)<br />
      when 3  # status<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to status screen<br />
        &#36;scene = Scene_Status.new(@status_window.index)<br />
      end<br />
      return<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ◇ External Libraries<br />
#==============================================================================<br />
class Bitmap<br />
# ▼▲▼ XRXL 1. Line and Shape Drawing ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● Line drawing by Ouga Zaitou<br />
  #--------------------------------------------------------------------------<br />
  def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)<br />
    # Calculation of rendering distance. A generous estimate for the length at a right angle.<br />
    distance = (start_x - end_x).abs + (start_y - end_y).abs<br />
    # Start drawing<br />
    if end_color == start_color<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        if width == 1<br />
          self.set_pixel(x, y, start_color) <br />
        else<br />
          self.fill_rect(x, y, width, width, start_color) <br />
        end<br />
      end<br />
    else<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        r = start_color.red &nbsp;&nbsp;* (distance-i)/distance + end_color.red &nbsp;&nbsp;* i/distance<br />
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance<br />
        b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance<br />
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance<br />
        if width == 1<br />
          self.set_pixel(x, y, Color.new(r, g, b, a))<br />
        else<br />
          self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) <br />
        end<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Drawing a Polygon (Unfilled) by Kazuki<br />
  #    peaks    : Array of vertex coordinates [[x1,y1],[x2,y2],[x3,y3], ... ]<br />
  #    color    : Line Color<br />
  #    width    : Line width<br />
  #--------------------------------------------------------------------------<br />
  def draw_polygon(peaks, color, width = 1)<br />
    # Draw a number of edges equal to the number of edges (or vertices).<br />
    for i in 0 ... (peaks.size - 1)<br />
      # Connect the vertices with lines.<br />
      draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )<br />
    end<br />
    # Connect the last vertex to the first vertex.<br />
    draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )<br />
  end<br />
# ▼▲▼ XRXL 2. Bitmap/Icon Rendering ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● Face and frame drawing by Ouga Zaitou<br />
  #   &nbsp;&nbsp;character_name : Character Graphics Used for Depiction<br />
  #   &nbsp;&nbsp;character_hue  : The Hue of the Character<br />
  #   &nbsp;&nbsp;x     &nbsp;&nbsp;: Drawing Destination X-Coordinate<br />
  #   &nbsp;&nbsp;y     &nbsp;&nbsp;: Drawing Destination Y-Coordinate<br />
  #--------------------------------------------------------------------------<br />
  def draw_facesquare(character_name, character_hue, x, y, size = 24)<br />
    bitmap = RPG::Cache.character(character_name, character_hue)<br />
    src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)<br />
    self.blt(x, y, bitmap, src_rect)<br />
    self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))<br />
  end<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
From the translation:<ul class="mycode_list"><li>Please install "XRXL 2. Bitmap/Icon Rendering" beforehand.<br />
</li>
<li>Copy this script into a new section created above the Main section.<br />
</li>
<li>Inside the double quotas (`""`) of the sevenRPG::Cache.icon("") entries located at the top of `Window_RingMenu, enter the icon for each command.<ul class="mycode_list"><li>Follow as they are described in the comments to the right.<br />
</li>
<li>The "Disabled" icon at the bottom is an icon that overlays atop the menu icons that cannot be selected. Recommended is something like: φ<br />
</li>
</ul>
</li>
<li>Inside the "" of the TSE_STARTUP value, place the sound effect that you want to sound when the menu opens<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Code courtesy of Kazuki, the creator of the XRXS script.<br />
Line Drawing and Face and frame drawing by Ouga Zaitou]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">XRXS_MP 6. Ring Menu Implementation</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version:  1.2<br />
by Kazuki</span><br />
<span style="font-size: xx-small;" class="mycode_size">&copy; 2007<br />
Version 1.0 Release &copy; 2005</span><br />
<span style="font-style: italic;" class="mycode_i">Yes, the creator's name is Kazuki, NOT XRXS</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
For years, I've seen the XRXS Ring Menu with additions by Dubealex and others.  But never a pure version of the original version. So I decided to use my lycanthropic werewolf hunting skills to track down a pure version untouched by western editors.<br />
<br />
And here it is.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><ul class="mycode_list"><li>Its a RING menu<br />
</li>
<li>Contains a compact actor menu when selecting choices like Equip or Skill<br />
</li>
<li>Able to customize the icons<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
I am providing BOTH the original version 1.2 (circa 2007 which Kazuki stated was abandoned) and an English version thanks to an hour's worth of wolfish translation.<br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> Japanese Original Version</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># ▼▲▼ XRXS_MP 6. リングメニュー導入 ver.1.2 ▼▲▼<br />
# by 和希<br />
<br />
#==============================================================================<br />
# □ カスタマイズポイント<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  STARTUP_FRAMES =  20 # 初期アニメーションのフレーム数<br />
  MOVING_FRAMES  = &nbsp;&nbsp;5 # リングを回した時のフレーム数<br />
  RING_R       &nbsp;&nbsp;=  64 # リングの半径<br />
  SE_STARTUP  = "056-Right02" # メニューを開いたときに鳴らすSE<br />
  ICON_ITEM &nbsp;&nbsp;= RPG::Cache.icon("034-Item03") &nbsp;&nbsp;# 「 アイテム 」メニューのアイコン<br />
  ICON_SKILL  = RPG::Cache.icon("044-Skill01")  # 「　スキル　」メニューのアイコン<br />
  ICON_EQUIP  = RPG::Cache.icon("001-Weapon01") # 「　 装備 　」メニューのアイコン<br />
  ICON_STATUS = RPG::Cache.icon("050-Skill07")  # 「ステータス」メニューのアイコン<br />
  ICON_SAVE &nbsp;&nbsp;= RPG::Cache.icon("038-Item07") &nbsp;&nbsp;# 「　セーブ　」メニューのアイコン<br />
  ICON_EXIT &nbsp;&nbsp;= RPG::Cache.icon("046-Skill03")  # 「　 終了 　」メニューのアイコン<br />
  ICON_DISABLE= RPG::Cache.icon("")           &nbsp;&nbsp;# 使用禁止項目に付くアイコン<br />
  BACKGROUND_COLOR = Color.new(0xcc,0x99,0x33,0x3f)<br />
end<br />
###############################################################################<br />
# リングメニュー導入スクリプト Ver. 1.2<br />
#               &nbsp;&nbsp;writen by 和希<br />
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
# ▽導入<br />
# &nbsp;&nbsp;０．先に XRXL 2. ビットマップ/アイコン描写 を入れて置いてください。<br />
# &nbsp;&nbsp;１．このスクリプトをMainセクションの上に作った新しいセクションにコピーする<br />
# &nbsp;&nbsp;２．Window_RingMenuの上部にある７つの RPG::Cache.icon("") の "" の中に<br />
#     &nbsp;&nbsp;右の説明に書いてあるコマンド用のアイコン名を書く。<br />
#     &nbsp;&nbsp;(一番下の使用禁止は選べないメニューに重ねるアイコンです。<br />
#        こんなのがいいかも→ φ )<br />
# &nbsp;&nbsp;３．アイコン設定のすぐ下にある SE_STARTUP = "" の "" の中にメニューを<br />
#     &nbsp;&nbsp;開いたときに鳴らしたいのSEの名前を書く。<br />
# ▽スクリプト触れる人へ<br />
# &nbsp;&nbsp;とりあえず動く物を目標に作ったものなので(志低いｗ)、座標の調整などが不完全です。<br />
# &nbsp;&nbsp;より正確にアクターの画面座標を取得する処理を追加したり、アクター一覧の位置を<br />
# &nbsp;&nbsp;変えたり、文字表示などなどを調整するといい感じに仕上がる気がします。<br />
###############################################################################<br />
<br />
#==============================================================================<br />
# ■ Window_RingMenu<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  #--------------------------------------------------------------------------<br />
  # ○ クラス定数<br />
  #--------------------------------------------------------------------------<br />
  MODE_START = 1 # スタートアップアニメーション<br />
  MODE_WAIT  = 2 # 待機<br />
  MODE_MOVER = 3 # 時計回り回転アニメーション<br />
  MODE_MOVEL = 4 # 反時計回り回転アニメーション<br />
  #--------------------------------------------------------------------------<br />
  # ○ アクセサ<br />
  #--------------------------------------------------------------------------<br />
  attr_accessor :index<br />
  attr_reader :commands<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #--------------------------------------------------------------------------<br />
  def initialize( center_x, center_y )<br />
    super(-16, -16, 640+32, 480+32)<br />
    self.contents = Bitmap.new(width-32, height-32)<br />
    self.opacity = 0<br />
    self.back_opacity = 0<br />
    s1 = &#36;data_system.words.item<br />
    s2 = &#36;data_system.words.skill<br />
    s3 = &#36;data_system.words.equip<br />
    s4 = "ステータス"<br />
    s5 = "セーブ"<br />
    s6 = "ゲーム終了"<br />
    @commands = [ s1, s2, s3, s4, s5, s6 ]<br />
    @item_max = 6<br />
    @index = 0<br />
    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]<br />
    @disabled = [ false, false, false, false, false, false ]<br />
    @cx = center_x<br />
    @cy = center_y<br />
    setup_move_start<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    super<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 画面再描画<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    # 背景描画<br />
    if BACKGROUND_COLOR.alpha &gt; 0<br />
      self.contents.fill_rect(0,0,640,480,BACKGROUND_COLOR)<br />
    end<br />
    # アイコンを描画<br />
    case @mode<br />
    when MODE_START<br />
      refresh_start<br />
    when MODE_WAIT<br />
      refresh_wait<br />
    when MODE_MOVER<br />
      refresh_move(1)<br />
    when MODE_MOVEL<br />
      refresh_move(0)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(初期化時)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_start<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = 1.0 * Math::PI / STARTUP_FRAMES<br />
    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( r * Math.sin( d ) ).to_i<br />
      y = @cy - ( r * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(待機時)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_wait<br />
    d = 2.0 * Math::PI / @item_max<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      x = @cx + ( RING_R * Math.sin( d * j ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d * j ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 画面再描画(回転時)<br />
  #  mode : 0=反時計回り 1=時計回り<br />
  #--------------------------------------------------------------------------<br />
  def refresh_move( mode )<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = d1 / MOVING_FRAMES<br />
    d2 *= -1 if mode != 0<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( RING_R * Math.sin( d ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 項目の描画<br />
  #   &nbsp;&nbsp;x : <br />
  #   &nbsp;&nbsp;y : <br />
  #   &nbsp;&nbsp;i : 項目番号<br />
  #--------------------------------------------------------------------------<br />
  def draw_item(x, y, i)<br />
    rect = Rect.new(0, 0, @items[i].width, @items[i].height)<br />
    x -= rect.width/2<br />
    y -= rect.height/2<br />
    if @index == i<br />
      self.contents.blt( x, y, @items[i], rect )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect )<br />
      end<br />
    else<br />
      self.contents.blt( x, y, @items[i], rect, 128 )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect, 128 )<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 項目を無効にする<br />
  #   &nbsp;&nbsp;index : 項目番号<br />
  #--------------------------------------------------------------------------<br />
  def disable_item(index)<br />
    @disabled[index] = true<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 初期化アニメーションの準備<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_start<br />
    @mode = MODE_START<br />
    @steps = STARTUP_FRAMES<br />
    if  SE_STARTUP != nil and SE_STARTUP != ""<br />
      Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ 回転アニメーションの準備<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_move(mode)<br />
    if mode == MODE_MOVER<br />
      @index -= 1<br />
      @index = @items.size - 1 if @index &lt; 0<br />
    elsif mode == MODE_MOVEL<br />
      @index += 1<br />
      @index = 0 if @index &gt;= @items.size<br />
    else<br />
      return<br />
    end<br />
    @mode = mode<br />
    @steps = MOVING_FRAMES<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ アニメーション中かどうか<br />
  #--------------------------------------------------------------------------<br />
  def animation?<br />
    return @mode != MODE_WAIT<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
# 　メニュー画面でパーティメンバーのステータスを表示するウィンドウです。<br />
#==============================================================================<br />
<br />
class Window_RingMenuStatus &lt; Window_Selectable<br />
  attr_reader :max_index<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #--------------------------------------------------------------------------<br />
  def initialize<br />
    @max_index = &#36;game_party.actors.size - 1<br />
    h = 32 * (@max_index + 1) + 32<br />
    h = 416 if h &gt; 416<br />
    x = 0<br />
    x = 456 if &#36;game_player.screen_x &lt; 200 + Window_RingMenu::RING_R<br />
    super(x, 64, 184, h)<br />
    self.contents = Bitmap.new(width - 32, &#36;game_party.actors.size * 32)<br />
    refresh<br />
    self.active = false<br />
    self.index = -1<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● リフレッシュ<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    @item_max = &#36;game_party.actors.size<br />
    for i in 0...&#36;game_party.actors.size<br />
      x = 32<br />
      y = 32 * i<br />
      actor = &#36;game_party.actors[i]<br />
      self.contents.draw_facesquare(actor.character_name, actor.character_hue,<br />
                                    4, y + 4 )<br />
      draw_actor_name(actor, x, y)<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Scene_Menu<br />
#------------------------------------------------------------------------------<br />
# 　メニュー画面の処理を行うクラスです。<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
  #--------------------------------------------------------------------------<br />
  # ● オブジェクト初期化<br />
  #   &nbsp;&nbsp;menu_index : コマンドのカーソル初期位置<br />
  #--------------------------------------------------------------------------<br />
  def initialize(menu_index = 0)<br />
    @menu_index = menu_index<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● メイン処理<br />
  #--------------------------------------------------------------------------<br />
  def main<br />
    # スプライトセットを作成<br />
    @spriteset = Spriteset_Map.new<br />
    # コマンドウィンドウを作成<br />
    bmp = RPG::Cache.character(&#36;game_party.actors[0].character_name, 0)<br />
    px = &#36;game_player.screen_x<br />
    py = &#36;game_player.screen_y - bmp.rect.height / 4 / 2<br />
    @command_window = Window_RingMenu.new(px,py)<br />
    @command_window.index = @menu_index<br />
    # パーティ人数が 0 人の場合<br />
    if &#36;game_party.actors.size == 0<br />
      # アイテム、スキル、装備、ステータスを無効化<br />
      @command_window.disable_item(0)<br />
      @command_window.disable_item(1)<br />
      @command_window.disable_item(2)<br />
      @command_window.disable_item(3)<br />
    end<br />
    @command_window.z = 100<br />
    # セーブ禁止の場合<br />
    if &#36;game_system.save_disabled<br />
      # セーブを無効にする<br />
      @command_window.disable_item(4)<br />
    end<br />
    # ステータスウィンドウを作成<br />
    @status_window = Window_RingMenuStatus.new<br />
    @status_window.z = 200<br />
    @status_window.visible = false<br />
    # ヘルプウィンドウを作成<br />
    @help_window = Window_Help.new<br />
    @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
    # トランジション実行<br />
    Graphics.transition<br />
    # メインループ<br />
    loop do<br />
      # ゲーム画面を更新<br />
      Graphics.update<br />
      # 入力情報を更新<br />
      Input.update<br />
      # フレーム更新<br />
      update<br />
      # 画面が切り替わったらループを中断<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    # トランジション準備<br />
    Graphics.freeze<br />
    # スプライトセットを解放<br />
    @spriteset.dispose<br />
    # ウィンドウを解放<br />
    @command_window.dispose<br />
    @status_window.dispose<br />
    @help_window.dispose<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    # ウィンドウを更新<br />
    @command_window.update<br />
    @status_window.update<br />
    @help_window.update<br />
    # コマンドウィンドウがアクティブの場合: update_command を呼ぶ<br />
    if @command_window.active<br />
      update_command<br />
      return<br />
    end<br />
    # ステータスウィンドウがアクティブの場合: update_status を呼ぶ<br />
    if @status_window.active<br />
      update_status<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新 (コマンドウィンドウがアクティブの場合)<br />
  #--------------------------------------------------------------------------<br />
  def update_command<br />
    # B ボタンが押された場合<br />
    if Input.trigger?(Input::B)<br />
      # キャンセル SE を演奏<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # マップ画面に切り替え<br />
      &#36;scene = Scene_Map.new<br />
      return<br />
    end<br />
    # C ボタンが押された場合<br />
    if Input.trigger?(Input::C)<br />
      # パーティ人数が 0 人で、セーブ、ゲーム終了以外のコマンドの場合<br />
      if &#36;game_party.actors.size == 0 and @command_window.index &lt; 4<br />
        # ブザー SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      # コマンドウィンドウのカーソル位置で分岐<br />
      case @command_window.index<br />
      when 0  # アイテム<br />
        # 決定  SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # アイテム画面に切り替え<br />
        &#36;scene = Scene_Item.new<br />
      when 1  # スキル<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 2  # 装備<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 3  # ステータス<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータスウィンドウをアクティブにする<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 4  # セーブ<br />
        # セーブ禁止の場合<br />
        if &#36;game_system.save_disabled<br />
          # ブザー SE を演奏<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # セーブ画面に切り替え<br />
        &#36;scene = Scene_Save.new<br />
      when 5  # ゲーム終了<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ゲーム終了画面に切り替え<br />
        &#36;scene = Scene_End.new<br />
      end<br />
      return<br />
    end<br />
    # アニメーション中ならカーソルの処理を行わない<br />
    return if @command_window.animation?<br />
    # ↑or← ボタンが押された場合<br />
    if Input.press?(Input::UP) or  Input.press?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
    # ↓or→ ボタンが押された場合<br />
    if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● フレーム更新 (ステータスウィンドウがアクティブの場合)<br />
  #--------------------------------------------------------------------------<br />
  def update_status<br />
    # B ボタンが押された場合<br />
    if Input.trigger?(Input::B)<br />
      # キャンセル SE を演奏<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # コマンドウィンドウをアクティブにする<br />
      @command_window.active = true<br />
      @status_window.active = false<br />
      @status_window.visible = false<br />
      @status_window.index = -1<br />
      return<br />
    end<br />
    # C ボタンが押された場合<br />
    if Input.trigger?(Input::C)<br />
      # コマンドウィンドウのカーソル位置で分岐<br />
      case @command_window.index<br />
      when 1  # スキル<br />
        # このアクターの行動制限が 2 以上の場合<br />
        if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
          # ブザー SE を演奏<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # スキル画面に切り替え<br />
        &#36;scene = Scene_Skill.new(@status_window.index)<br />
      when 2  # 装備<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # 装備画面に切り替え<br />
        &#36;scene = Scene_Equip.new(@status_window.index)<br />
      when 3  # ステータス<br />
        # 決定 SE を演奏<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # ステータス画面に切り替え<br />
        &#36;scene = Scene_Status.new(@status_window.index)<br />
      end<br />
      return<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ◇ 外部ライブラリ<br />
#==============================================================================<br />
class Bitmap<br />
# ▼▲▼ XRXL 1. ライン・図形描写 ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● ライン描画 by 桜雅 在土<br />
  #--------------------------------------------------------------------------<br />
  def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)<br />
    # 描写距離の計算。大きめに直角時の長さ。<br />
    distance = (start_x - end_x).abs + (start_y - end_y).abs<br />
    # 描写開始<br />
    if end_color == start_color<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        if width == 1<br />
          self.set_pixel(x, y, start_color) <br />
        else<br />
          self.fill_rect(x, y, width, width, start_color) <br />
        end<br />
      end<br />
    else<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        r = start_color.red &nbsp;&nbsp;* (distance-i)/distance + end_color.red &nbsp;&nbsp;* i/distance<br />
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance<br />
        b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance<br />
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance<br />
        if width == 1<br />
          self.set_pixel(x, y, Color.new(r, g, b, a))<br />
        else<br />
          self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) <br />
        end<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● 多角形の描画(塗りつぶしなし) by 和希<br />
  #    peaks    : 頂点座標の配列 [[x1,y1],[x2,y2],[x3,y3], ... ]<br />
  #    color    : 線の色<br />
  #    width    : 線の幅<br />
  #--------------------------------------------------------------------------<br />
  def draw_polygon(peaks, color, width = 1)<br />
    # 辺(=頂点)の個数分だけ辺を描く<br />
    for i in 0 ... (peaks.size - 1)<br />
      # 頂点同士を線で結ぶ<br />
      draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )<br />
    end<br />
    # 最後の頂点と最初の頂点を結ぶ<br />
    draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )<br />
  end<br />
# ▼▲▼ XRXL 2. ビットマップ/アイコン描写 ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● 顔＆枠の描画 by 桜雅 在土<br />
  #   &nbsp;&nbsp;character_name : 描写に利用するキャラクターグラフィック<br />
  #   &nbsp;&nbsp;character_hue  : 描写の色合い<br />
  #   &nbsp;&nbsp;x     &nbsp;&nbsp;: 描画先 X 座標<br />
  #   &nbsp;&nbsp;y     &nbsp;&nbsp;: 描画先 Y 座標<br />
  #--------------------------------------------------------------------------<br />
  def draw_facesquare(character_name, character_hue, x, y, size = 24)<br />
    bitmap = RPG::Cache.character(character_name, character_hue)<br />
    src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)<br />
    self.blt(x, y, bitmap, src_rect)<br />
    self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))<br />
  end<br />
end</code></div></div></div>
		</div>
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> English Translated Version</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># ▼▲▼ XRXS_MP 6. Ring Menu Implementation ver.1.2 ▼▲▼<br />
# By Kazuki<br />
<br />
#==============================================================================<br />
# □ Customization Points<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  STARTUP_FRAMES =  20 # Number of frames in the initial animation<br />
  MOVING_FRAMES  = &nbsp;&nbsp;5 # The number of frames when rotating the ring<br />
  RING_R       &nbsp;&nbsp;=  64 # Radius of the ring<br />
  SE_STARTUP  = "056-Right02" # The sound effect played when opening the menu<br />
  ICON_ITEM &nbsp;&nbsp;= RPG::Cache.icon("034-Item03") &nbsp;&nbsp;# Icons in the "Items" Menu<br />
  ICON_SKILL  = RPG::Cache.icon("044-Skill01")  # Icons in the "Skills" Menu<br />
  ICON_EQUIP  = RPG::Cache.icon("001-Weapon01") # "Equipment" Menu Icon<br />
  ICON_STATUS = RPG::Cache.icon("050-Skill07")  # "Status" Menu Icons<br />
  ICON_SAVE &nbsp;&nbsp;= RPG::Cache.icon("038-Item07") &nbsp;&nbsp;# "Save" Menu Icon<br />
  ICON_EXIT &nbsp;&nbsp;= RPG::Cache.icon("046-Skill03")  # "Exit" Menu Icon<br />
  ICON_DISABLE= RPG::Cache.icon("")           &nbsp;&nbsp;# Icons for Prohibited Items<br />
  BACKGROUND_COLOR = Color.new(0xcc,0x99,0x33,0x3f)<br />
end<br />
###############################################################################<br />
# Ring Menu Implementation Script Ver. 1.2<br />
#               &nbsp;&nbsp;writen by Kazuki<br />
# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -<br />
# ▽ Introduction<br />
# &nbsp;&nbsp;0. Please install "XRXL 2. Bitmap/Icon Rendering" beforehand.<br />
# &nbsp;&nbsp;1. Copy this script into a new section created above the Main section.<br />
# &nbsp;&nbsp;2. Inside the double quotas (`""`) of the sevenRPG::Cache.icon("") entries<br />
#      located at the top of `Window_RingMenu, enter the icon for each command.<br />
#      Follow as they are described in the comments to the right.<br />
#      The "Disabled" icon at the bottom is an icon that overlays atop the<br />
#      menu icons that cannot be selected. Recommended is something like: φ<br />
# &nbsp;&nbsp;3. Inside the "" of the TSE_STARTUP value, place the sound effect that you<br />
#      want to sound when the menu opens<br />
# ▽ For those comfortable working with scripts<br />
# &nbsp;&nbsp;Since I built this with the sole goal of getting something—anything—up and<br />
# &nbsp;&nbsp;running (yeah, I set the bar pretty low!), the coordinate alignment and<br />
# &nbsp;&nbsp;similar details are still incomplete.<br />
# &nbsp;&nbsp;We added a process to obtain the actor's screen coordinates more accurately,<br />
# &nbsp;&nbsp;and the position of the actor list.<br />
# &nbsp;&nbsp;I feel like if you tweak things—such as making changes or adjusting the text<br />
# &nbsp;&nbsp;display—it will turn out really nicely.<br />
###############################################################################<br />
<br />
#==============================================================================<br />
# ■ Window_RingMenu<br />
#==============================================================================<br />
class Window_RingMenu &lt; Window_Base<br />
  #--------------------------------------------------------------------------<br />
  # ○ Class Constants<br />
  #--------------------------------------------------------------------------<br />
  MODE_START = 1 # Startup Animation<br />
  MODE_WAIT  = 2 # Stand By<br />
  MODE_MOVER = 3 # Clockwise Rotation Animation<br />
  MODE_MOVEL = 4 # Counter-clockwise Rotation Animation<br />
  #--------------------------------------------------------------------------<br />
  # ○ Public Instance Variables<br />
  #--------------------------------------------------------------------------<br />
  attr_accessor :index<br />
  attr_reader :commands<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #--------------------------------------------------------------------------<br />
  def initialize( center_x, center_y )<br />
    super(-16, -16, 640+32, 480+32)<br />
    self.contents = Bitmap.new(width-32, height-32)<br />
    self.opacity = 0<br />
    self.back_opacity = 0<br />
    s1 = &#36;data_system.words.item<br />
    s2 = &#36;data_system.words.skill<br />
    s3 = &#36;data_system.words.equip<br />
    s4 = "Status"<br />
    s5 = "Save"<br />
    s6 = "Game Over"<br />
    @commands = [ s1, s2, s3, s4, s5, s6 ]<br />
    @item_max = 6<br />
    @index = 0<br />
    @items = [ ICON_ITEM, ICON_SKILL, ICON_EQUIP, ICON_STATUS, ICON_SAVE, ICON_EXIT ]<br />
    @disabled = [ false, false, false, false, false, false ]<br />
    @cx = center_x<br />
    @cy = center_y<br />
    setup_move_start<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    super<br />
    refresh<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Refresh<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    # Draw background<br />
    if BACKGROUND_COLOR.alpha &gt; 0<br />
      self.contents.fill_rect(0,0,640,480,BACKGROUND_COLOR)<br />
    end<br />
    # Draw Icon<br />
    case @mode<br />
    when MODE_START<br />
      refresh_start<br />
    when MODE_WAIT<br />
      refresh_wait<br />
    when MODE_MOVER<br />
      refresh_move(1)<br />
    when MODE_MOVEL<br />
      refresh_move(0)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen redraw (at initialization)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_start<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = 1.0 * Math::PI / STARTUP_FRAMES<br />
    r = RING_R - 1.0 * RING_R * @steps / STARTUP_FRAMES<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( r * Math.sin( d ) ).to_i<br />
      y = @cy - ( r * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen redraw (standby)<br />
  #--------------------------------------------------------------------------<br />
  def refresh_wait<br />
    d = 2.0 * Math::PI / @item_max<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      x = @cx + ( RING_R * Math.sin( d * j ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d * j ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Screen Redraw (on Rotation)<br />
  #  mode : 0=Counter-clockwise 1=Clockwise<br />
  #--------------------------------------------------------------------------<br />
  def refresh_move( mode )<br />
    d1 = 2.0 * Math::PI / @item_max<br />
    d2 = d1 / MOVING_FRAMES<br />
    d2 *= -1 if mode != 0<br />
    for i in 0...@item_max<br />
      j = i - @index<br />
      d = d1 * j + d2 * @steps<br />
      x = @cx + ( RING_R * Math.sin( d ) ).to_i<br />
      y = @cy - ( RING_R * Math.cos( d ) ).to_i<br />
      draw_item(x, y, i)<br />
    end<br />
    @steps -= 1<br />
    if @steps &lt; 1<br />
      @mode = MODE_WAIT<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Draw Item<br />
  #   &nbsp;&nbsp;x : <br />
  #   &nbsp;&nbsp;y : <br />
  #   &nbsp;&nbsp;i : Item number<br />
  #--------------------------------------------------------------------------<br />
  def draw_item(x, y, i)<br />
    rect = Rect.new(0, 0, @items[i].width, @items[i].height)<br />
    x -= rect.width/2<br />
    y -= rect.height/2<br />
    if @index == i<br />
      self.contents.blt( x, y, @items[i], rect )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect )<br />
      end<br />
    else<br />
      self.contents.blt( x, y, @items[i], rect, 128 )<br />
      if @disabled[@index]<br />
        self.contents.blt( x, y, ICON_DISABLE, rect, 128 )<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Disable Item<br />
  #   &nbsp;&nbsp;index : Item number<br />
  #--------------------------------------------------------------------------<br />
  def disable_item(index)<br />
    @disabled[index] = true<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Preparing the Initialization Animation<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_start<br />
    @mode = MODE_START<br />
    @steps = STARTUP_FRAMES<br />
    if  SE_STARTUP != nil and SE_STARTUP != ""<br />
      Audio.se_play("Audio/SE/" + SE_STARTUP, 80, 100)<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Preparing the Rotation Animation<br />
  #--------------------------------------------------------------------------<br />
  def setup_move_move(mode)<br />
    if mode == MODE_MOVER<br />
      @index -= 1<br />
      @index = @items.size - 1 if @index &lt; 0<br />
    elsif mode == MODE_MOVEL<br />
      @index += 1<br />
      @index = 0 if @index &gt;= @items.size<br />
    else<br />
      return<br />
    end<br />
    @mode = mode<br />
    @steps = MOVING_FRAMES<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ○ Whether currently animating<br />
  #--------------------------------------------------------------------------<br />
  def animation?<br />
    return @mode != MODE_WAIT<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
# 　This window displays party member status on the menu screen.<br />
#==============================================================================<br />
<br />
class Window_RingMenuStatus &lt; Window_Selectable<br />
  attr_reader :max_index<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #--------------------------------------------------------------------------<br />
  def initialize<br />
    @max_index = &#36;game_party.actors.size - 1<br />
    h = 32 * (@max_index + 1) + 32<br />
    h = 416 if h &gt; 416<br />
    x = 0<br />
    x = 456 if &#36;game_player.screen_x &lt; 200 + Window_RingMenu::RING_R<br />
    super(x, 64, 184, h)<br />
    self.contents = Bitmap.new(width - 32, &#36;game_party.actors.size * 32)<br />
    refresh<br />
    self.active = false<br />
    self.index = -1<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Refresh<br />
  #--------------------------------------------------------------------------<br />
  def refresh<br />
    self.contents.clear<br />
    @item_max = &#36;game_party.actors.size<br />
    for i in 0...&#36;game_party.actors.size<br />
      x = 32<br />
      y = 32 * i<br />
      actor = &#36;game_party.actors[i]<br />
      self.contents.draw_facesquare(actor.character_name, actor.character_hue,<br />
                                    4, y + 4 )<br />
      draw_actor_name(actor, x, y)<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ■ Scene_Menu<br />
#------------------------------------------------------------------------------<br />
# 　This class performs menu screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
  #--------------------------------------------------------------------------<br />
  # ● Object Initialization<br />
  #   &nbsp;&nbsp;menu_index : command cursor's initial position<br />
  #--------------------------------------------------------------------------<br />
  def initialize(menu_index = 0)<br />
    @menu_index = menu_index<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Main Processing<br />
  #--------------------------------------------------------------------------<br />
  def main<br />
    # Make spriteset<br />
    @spriteset = Spriteset_Map.new<br />
    # Make command window<br />
    bmp = RPG::Cache.character(&#36;game_party.actors[0].character_name, 0)<br />
    px = &#36;game_player.screen_x<br />
    py = &#36;game_player.screen_y - bmp.rect.height / 4 / 2<br />
    @command_window = Window_RingMenu.new(px,py)<br />
    @command_window.index = @menu_index<br />
    # If number of party members is 0<br />
    if &#36;game_party.actors.size == 0<br />
      # Disable items, skills, equipment, and status<br />
      @command_window.disable_item(0)<br />
      @command_window.disable_item(1)<br />
      @command_window.disable_item(2)<br />
      @command_window.disable_item(3)<br />
    end<br />
    @command_window.z = 100<br />
    # If save is forbidden<br />
    if &#36;game_system.save_disabled<br />
      # Disable save<br />
      @command_window.disable_item(4)<br />
    end<br />
    # Make status window<br />
    @status_window = Window_RingMenuStatus.new<br />
    @status_window.z = 200<br />
    @status_window.visible = false<br />
    # Make help window<br />
    @help_window = Window_Help.new<br />
    @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
    # Execute transition<br />
    Graphics.transition<br />
    # Main loop<br />
    loop do<br />
      # Update game screen<br />
      Graphics.update<br />
      # Update input information<br />
      Input.update<br />
      # Frame update<br />
      update<br />
      # Abort loop if screen is changed<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    # Prepare for transition<br />
    Graphics.freeze<br />
    # Dispose of spriteset<br />
    @spriteset.dispose<br />
    # Dispose of windows<br />
    @command_window.dispose<br />
    @status_window.dispose<br />
    @help_window.dispose<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update<br />
  #--------------------------------------------------------------------------<br />
  def update<br />
    # Update windows<br />
    @command_window.update<br />
    @status_window.update<br />
    @help_window.update<br />
    # If command window is active: call update_command<br />
    if @command_window.active<br />
      update_command<br />
      return<br />
    end<br />
    # If status window is active: call update_status<br />
    if @status_window.active<br />
      update_status<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update (when command window is active)<br />
  #--------------------------------------------------------------------------<br />
  def update_command<br />
    # If B button was pressed<br />
    if Input.trigger?(Input::B)<br />
      # Play cancel SE<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # Switch to map screen<br />
      &#36;scene = Scene_Map.new<br />
      return<br />
    end<br />
    # If C button was pressed<br />
    if Input.trigger?(Input::C)<br />
      # If command other than save or end game, and party members = 0<br />
      if &#36;game_party.actors.size == 0 and @command_window.index &lt; 4<br />
        # Play buzzer SE<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      # Branch by command window cursor position<br />
      case @command_window.index<br />
      when 0  # item<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to item screen<br />
        &#36;scene = Scene_Item.new<br />
      when 1  # skill<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 2  # equipment<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 3  # status<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Make status window active<br />
        @command_window.active = false<br />
        @status_window.active = true<br />
        @status_window.visible = true<br />
        @status_window.index = 0<br />
      when 4  # save<br />
        # If saving is forbidden<br />
        if &#36;game_system.save_disabled<br />
          # Play buzzer SE<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to save screen<br />
        &#36;scene = Scene_Save.new<br />
      when 5  # Game Over<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to end game screen<br />
        &#36;scene = Scene_End.new<br />
      end<br />
      return<br />
    end<br />
    # Do not process the cursor while an animation is in progress.<br />
    return if @command_window.animation?<br />
    # ↑or← ボタンが押された場合<br />
    if Input.press?(Input::UP) or  Input.press?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVEL)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
    # If the ↓ or → button is pressed<br />
    if Input.press?(Input::DOWN) or  Input.press?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @command_window.setup_move_move(Window_RingMenu::MODE_MOVER)<br />
      @help_window.set_text(@command_window.commands[@command_window.index],1)<br />
      return<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Frame Update (when status window is active)<br />
  #--------------------------------------------------------------------------<br />
  def update_status<br />
    # If B button was pressed<br />
    if Input.trigger?(Input::B)<br />
      # Play cancel SE<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      # Make command window active<br />
      @command_window.active = true<br />
      @status_window.active = false<br />
      @status_window.visible = false<br />
      @status_window.index = -1<br />
      return<br />
    end<br />
    # If C button was pressed<br />
    if Input.trigger?(Input::C)<br />
      # Branch by command window cursor position<br />
      case @command_window.index<br />
      when 1  # skill<br />
        # If this actor's action limit is 2 or more<br />
        if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
          # Play buzzer SE<br />
          &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
          return<br />
        end<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to skill screen<br />
        &#36;scene = Scene_Skill.new(@status_window.index)<br />
      when 2  # equipment<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to equipment screen<br />
        &#36;scene = Scene_Equip.new(@status_window.index)<br />
      when 3  # status<br />
        # Play decision SE<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        # Switch to status screen<br />
        &#36;scene = Scene_Status.new(@status_window.index)<br />
      end<br />
      return<br />
    end<br />
  end<br />
end<br />
#==============================================================================<br />
# ◇ External Libraries<br />
#==============================================================================<br />
class Bitmap<br />
# ▼▲▼ XRXL 1. Line and Shape Drawing ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● Line drawing by Ouga Zaitou<br />
  #--------------------------------------------------------------------------<br />
  def draw_line(start_x, start_y, end_x, end_y, start_color, width = 1, end_color = start_color)<br />
    # Calculation of rendering distance. A generous estimate for the length at a right angle.<br />
    distance = (start_x - end_x).abs + (start_y - end_y).abs<br />
    # Start drawing<br />
    if end_color == start_color<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        if width == 1<br />
          self.set_pixel(x, y, start_color) <br />
        else<br />
          self.fill_rect(x, y, width, width, start_color) <br />
        end<br />
      end<br />
    else<br />
      for i in 1..distance<br />
        x = (start_x + 1.0 * (end_x - start_x) * i / distance).to_i<br />
        y = (start_y + 1.0 * (end_y - start_y) * i / distance).to_i<br />
        r = start_color.red &nbsp;&nbsp;* (distance-i)/distance + end_color.red &nbsp;&nbsp;* i/distance<br />
        g = start_color.green * (distance-i)/distance + end_color.green * i/distance<br />
        b = start_color.blue  * (distance-i)/distance + end_color.blue  * i/distance<br />
        a = start_color.alpha * (distance-i)/distance + end_color.alpha * i/distance<br />
        if width == 1<br />
          self.set_pixel(x, y, Color.new(r, g, b, a))<br />
        else<br />
          self.fill_rect(x, y, width, width, Color.new(r, g, b, a)) <br />
        end<br />
      end<br />
    end<br />
  end<br />
  #--------------------------------------------------------------------------<br />
  # ● Drawing a Polygon (Unfilled) by Kazuki<br />
  #    peaks    : Array of vertex coordinates [[x1,y1],[x2,y2],[x3,y3], ... ]<br />
  #    color    : Line Color<br />
  #    width    : Line width<br />
  #--------------------------------------------------------------------------<br />
  def draw_polygon(peaks, color, width = 1)<br />
    # Draw a number of edges equal to the number of edges (or vertices).<br />
    for i in 0 ... (peaks.size - 1)<br />
      # Connect the vertices with lines.<br />
      draw_line( peaks[i][0], peaks[i][1], peaks[i+1][0], peaks[i+1][1], color, width )<br />
    end<br />
    # Connect the last vertex to the first vertex.<br />
    draw_line( peaks[peaks.size - 1][0], peaks[peaks.size - 1][1], peaks[0][0], peaks[0][1], color, width )<br />
  end<br />
# ▼▲▼ XRXL 2. Bitmap/Icon Rendering ▼▲▼<br />
  #--------------------------------------------------------------------------<br />
  # ● Face and frame drawing by Ouga Zaitou<br />
  #   &nbsp;&nbsp;character_name : Character Graphics Used for Depiction<br />
  #   &nbsp;&nbsp;character_hue  : The Hue of the Character<br />
  #   &nbsp;&nbsp;x     &nbsp;&nbsp;: Drawing Destination X-Coordinate<br />
  #   &nbsp;&nbsp;y     &nbsp;&nbsp;: Drawing Destination Y-Coordinate<br />
  #--------------------------------------------------------------------------<br />
  def draw_facesquare(character_name, character_hue, x, y, size = 24)<br />
    bitmap = RPG::Cache.character(character_name, character_hue)<br />
    src_rect = Rect.new((bitmap.width/4 - size)/2, 0, size, size)<br />
    self.blt(x, y, bitmap, src_rect)<br />
    self.draw_polygon([[x,y],[x+size,y],[x+size,y+size],[x,y+size]], Color.new(255,255,255,128))<br />
  end<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
From the translation:<ul class="mycode_list"><li>Please install "XRXL 2. Bitmap/Icon Rendering" beforehand.<br />
</li>
<li>Copy this script into a new section created above the Main section.<br />
</li>
<li>Inside the double quotas (`""`) of the sevenRPG::Cache.icon("") entries located at the top of `Window_RingMenu, enter the icon for each command.<ul class="mycode_list"><li>Follow as they are described in the comments to the right.<br />
</li>
<li>The "Disabled" icon at the bottom is an icon that overlays atop the menu icons that cannot be selected. Recommended is something like: φ<br />
</li>
</ul>
</li>
<li>Inside the "" of the TSE_STARTUP value, place the sound effect that you want to sound when the menu opens<br />
</li>
</ul>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Code courtesy of Kazuki, the creator of the XRXS script.<br />
Line Drawing and Face and frame drawing by Ouga Zaitou]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[MUSIC EFFECT FADE  (A small Scriptette)]]></title>
			<link>https://www.save-point.org/thread-13490.html</link>
			<pubDate>Fri, 29 May 2026 13:56:51 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13490.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">MUSIC EFFECT FADE</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This simple scriptette takes advantage of a feature built into RPGMaker's built-in Audio module,  and allows you to  fade out music events  in much the same way as you could background music and ambient sound effects.<br />
<br />
Indeed, no alteration was made to the Audio class.  However, this feature has always  been available  despite no method  defined for it  within the Game_System class nor any map event akin to [Fade Out BGM] or the like.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> I can't believe EnterBrain neglected to include THIS</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** MUSIC EFFECT FADE<br />
#------------------------------------------------------------------------------<br />
#    by DerVVulfman<br />
#    version 1.0<br />
#    05-29-2026 (mm/dd/yyyy)<br />
#    RGSS / RPGMaker XP<br />
#==============================================================================<br />
#<br />
#  INTRODUCTION:<br />
#<br />
#  This simple scriptette takes advantage of a feature built into RPGMaker's<br />
#  built-in Audio module,  and allows you to  fade out music events  in much<br />
#  the same way as you could background music and ambient sound effects.<br />
#<br />
#  Indeed, no alteration was made to the Audio class.  However, this feature<br />
#  has always  been available  despite no method  defined for it  within the<br />
#  Game_System class nor any map event akin to [Fade Out BGM] or the like.<br />
#<br />
#  To use upon an already playing ME/Music Event, run either script call:<br />
#<br />
#        * &#36;game_system.me_fade(time)<br />
#        * me_fade(time)<br />
#          - time : duration in seconds<br />
#<br />
#        EX: &#36;game_system.me_fade(0.5)<br />
#          - Fades out the currently playing ME in 1/2 a second<br />
#<br />
#  This is to be executed after music events are already playing, and inten-<br />
#  def for music events that are considered longer than normal.  Such longer<br />
#  music events would be akin to victory music from a Final Fantasy game.<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_System<br />
#------------------------------------------------------------------------------<br />
#  This class handles data surrounding the system. Backround music, etc.<br />
#  is managed here as well. Refer to "&#36;game_system" for the instance of <br />
#  this class.<br />
#==============================================================================<br />
<br />
class Game_System<br />
<br />
  #--------------------------------------------------------------------------<br />
  # * Fade Out Music Effect<br />
  #   &nbsp;&nbsp;time : fade-out time (in seconds)<br />
  #--------------------------------------------------------------------------<br />
  def me_fade(time)<br />
    Audio.me_fade(time * 1000)<br />
  end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#  This interpreter runs event commands. This class is used within the<br />
#  Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
  #--------------------------------------------------------------------------<br />
  # * Fade Out Music Effect<br />
  #   &nbsp;&nbsp;time : fade-out time (in seconds)<br />
  #--------------------------------------------------------------------------<br />
  def me_fade(time)<br />
    &#36;game_system.me_fade(time)<br />
  end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Just paste this below Scene_Debug and above Main.  And use either script command noted in the script to fade out the music event effect.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
ABSOLUTELY NO INCOMPATABILITIES!  I don't think anyone noticed this.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
<br />
<span style="color: #B20080;" class="mycode_color"><span style="font-family: Comic Sans MS;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">WHY HAD NO ONE NOTICED THIS!?!?</span></span></span>  <img src="https://www.save-point.org/images/smilies/ejlol/Thud.gif" alt="Head-desk Thud" title="Head-desk Thud" class="smilie smilie_56" /> <br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Yell at Enterbrainless for not including this in the base system even though I did no alteration to the Audio class itself.  THEY HAD THIS FEATURE POSSIBLE ALL THESE YEARS!!!]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">MUSIC EFFECT FADE</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This simple scriptette takes advantage of a feature built into RPGMaker's built-in Audio module,  and allows you to  fade out music events  in much the same way as you could background music and ambient sound effects.<br />
<br />
Indeed, no alteration was made to the Audio class.  However, this feature has always  been available  despite no method  defined for it  within the Game_System class nor any map event akin to [Fade Out BGM] or the like.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> I can't believe EnterBrain neglected to include THIS</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# ** MUSIC EFFECT FADE<br />
#------------------------------------------------------------------------------<br />
#    by DerVVulfman<br />
#    version 1.0<br />
#    05-29-2026 (mm/dd/yyyy)<br />
#    RGSS / RPGMaker XP<br />
#==============================================================================<br />
#<br />
#  INTRODUCTION:<br />
#<br />
#  This simple scriptette takes advantage of a feature built into RPGMaker's<br />
#  built-in Audio module,  and allows you to  fade out music events  in much<br />
#  the same way as you could background music and ambient sound effects.<br />
#<br />
#  Indeed, no alteration was made to the Audio class.  However, this feature<br />
#  has always  been available  despite no method  defined for it  within the<br />
#  Game_System class nor any map event akin to [Fade Out BGM] or the like.<br />
#<br />
#  To use upon an already playing ME/Music Event, run either script call:<br />
#<br />
#        * &#36;game_system.me_fade(time)<br />
#        * me_fade(time)<br />
#          - time : duration in seconds<br />
#<br />
#        EX: &#36;game_system.me_fade(0.5)<br />
#          - Fades out the currently playing ME in 1/2 a second<br />
#<br />
#  This is to be executed after music events are already playing, and inten-<br />
#  def for music events that are considered longer than normal.  Such longer<br />
#  music events would be akin to victory music from a Final Fantasy game.<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_System<br />
#------------------------------------------------------------------------------<br />
#  This class handles data surrounding the system. Backround music, etc.<br />
#  is managed here as well. Refer to "&#36;game_system" for the instance of <br />
#  this class.<br />
#==============================================================================<br />
<br />
class Game_System<br />
<br />
  #--------------------------------------------------------------------------<br />
  # * Fade Out Music Effect<br />
  #   &nbsp;&nbsp;time : fade-out time (in seconds)<br />
  #--------------------------------------------------------------------------<br />
  def me_fade(time)<br />
    Audio.me_fade(time * 1000)<br />
  end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#  This interpreter runs event commands. This class is used within the<br />
#  Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
  #--------------------------------------------------------------------------<br />
  # * Fade Out Music Effect<br />
  #   &nbsp;&nbsp;time : fade-out time (in seconds)<br />
  #--------------------------------------------------------------------------<br />
  def me_fade(time)<br />
    &#36;game_system.me_fade(time)<br />
  end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Just paste this below Scene_Debug and above Main.  And use either script command noted in the script to fade out the music event effect.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
ABSOLUTELY NO INCOMPATABILITIES!  I don't think anyone noticed this.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Author's Notes</span></span><br />
<br />
<span style="color: #B20080;" class="mycode_color"><span style="font-family: Comic Sans MS;" class="mycode_font"><span style="font-weight: bold;" class="mycode_b">WHY HAD NO ONE NOTICED THIS!?!?</span></span></span>  <img src="https://www.save-point.org/images/smilies/ejlol/Thud.gif" alt="Head-desk Thud" title="Head-desk Thud" class="smilie smilie_56" /> <br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Yell at Enterbrainless for not including this in the base system even though I did no alteration to the Audio class itself.  THEY HAD THIS FEATURE POSSIBLE ALL THESE YEARS!!!]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Reserve Party Tools]]></title>
			<link>https://www.save-point.org/thread-13488.html</link>
			<pubDate>Wed, 27 May 2026 18:01:15 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13488.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Reserve Party Tools</span></span><br />
<span style="font-size: medium;" class="mycode_size">Original Version by RPG Advocate 4/12/2005<br />
Edit and repairs by DerVVulfman</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This script enables support  for a "reserve" party of arbitrary size.  These characters don't fight in battle.  You are able to remove party members  and place them within the reserves by use of a new menu designed in the system. And adding new party members (with "Change Party Member") while the party is full will add them to the reserves.<br />
<br />
The original version required rewrites everywhere and expected the end-user to perform direct edits to the default scripts.  This version fixes some errors and oversights . And while still containing some direct alterations of default scripts, has those edited areas clearly marked for reference.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> The Script</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# Reserve Party Tools<br />
#------------------------------------------------------------------------------<br />
# by RPG Advocate 4/12/2005<br />
# Edit and repairs by DerVVulfman 6/27/2026<br />
# RGSS / RPGMaker XP<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# THE RESERVE PARTY MENU<br />
#<br />
# This script enables support&nbsp;&nbsp;for a "reserve" party of arbitrary size.&nbsp;&nbsp;These<br />
# characters don't fight in battle. If you want to give the player the ability<br />
# to switch characters between the party and reserve party,&nbsp;&nbsp;use either script<br />
# call shown below:<br />
#<br />
# *&nbsp;&nbsp;&#36;scene = Scene_PartyChange.new(value)<br />
# *&nbsp;&nbsp;change_party(value)<br />
#<br />
# The 'value' represents&nbsp;&nbsp;the maximun number of members you want in the party,<br />
# and can be left empty if using the default party size of '4'. You may set it<br />
# the range from 0-4, with 0 indicating full default party size of '4'. Values<br />
# beyond that range are invalid.<br />
#<br />
# *&nbsp;&nbsp;&#36;scene = Scene_PartyChange.new<br />
# *&nbsp;&nbsp;change_party<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# RESERVIST BATTLE EXPERIENCE<br />
#<br />
# By default, inactive party members gain experience at the same rate as active<br />
# members. To change this,&nbsp;&nbsp;edit the EXP_PERCENT constant&nbsp;&nbsp;in the RPGAdvReserve<br />
# module to the percentage of experience you want the inactive party to gain.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# REQUIRED / PERMANENT PARTY MEMBERS<br />
#<br />
# This script supports required party members, actors that have been classified<br />
# as necessary within the party&nbsp;&nbsp;and cannot be removed.&nbsp;&nbsp;To make a party member<br />
# required or remove its required status, you may use either script calls:<br />
#<br />
# *&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = true/false<br />
# *&nbsp;&nbsp;required_actor(actor_id, true/false)<br />
#<br />
# Both calls requests you&nbsp;&nbsp;to set a value of true,&nbsp;&nbsp;or false in order to remove<br />
# the required status.&nbsp;&nbsp;And within the Change Member menu,&nbsp;&nbsp;these party members<br />
# will appear with a predefined color in their names, default to Goldenrod.<br />
#<br />
# You should only make a character already in the party required. <br />
#<br />
# Making a reserve member 'required' will not work.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# CHANGING PARTY MEMBERS<br />
#<br />
# This script changes how the "Change Party Members" event command works.<br />
#<br />
# If you try to add a charater to the party when the party is full, that char-<br />
# acter will automatically be added to the reserve party.&nbsp;&nbsp;And if you remove a<br />
# party member, that character will be removed if they are in either the party<br />
# or the reserve party. However, it only recognizes a 4-party system when this<br />
# is applied, and does not recognize alternate party sizes.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# SCRIPT CALLS<br />
#<br />
# Initially,&nbsp;&nbsp;the only script calls noted were lenghty&nbsp;&nbsp;and direct commands to<br />
# the Game_Party class&nbsp;&nbsp;or direct calls&nbsp;&nbsp;to &#36;scene itself.&nbsp;&nbsp;Other script calls<br />
# were possible but not given. Here, we view all relevant script calls showing<br />
# both original and newer quick commands found in the Interpreter class:<br />
#<br />
#&nbsp;&nbsp; The Menu Command<br />
#&nbsp;&nbsp; ----------------<br />
#&nbsp;&nbsp; Used to bring up the actual Party/Reservist changing menu<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;scene = Scene_ChangeParty.new(max_size)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;change_party(max_size)<br />
#<br />
#&nbsp;&nbsp; Set Actor Required Status<br />
#&nbsp;&nbsp; -------------------------<br />
#&nbsp;&nbsp; Used to define an in-party&nbsp;&nbsp;(not a reservist member)&nbsp;&nbsp;as a fixed member of<br />
#&nbsp;&nbsp; the current party.&nbsp;&nbsp;The 'actor_id' value is from the database ID.&nbsp;&nbsp;And the<br />
#&nbsp;&nbsp; 'flag' value is either true or false.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = flag<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;required_actor(actor_id, flag)<br />
#<br />
#&nbsp;&nbsp; Swap Actors by database ID<br />
#&nbsp;&nbsp; --------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; both the party and reserve party, this command lets you exchange one actor<br />
#&nbsp;&nbsp; from the party with one from the reserves.<br />
#&nbsp;&nbsp; IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.swap_by_id(party_actor_id, reserve_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;swap_by_id(party_actor_id, reserve_actor_id)<br />
#<br />
#&nbsp;&nbsp; Transfer Reservist to the Party by ID<br />
#&nbsp;&nbsp; -------------------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; the reserve party, this command lets you remove the actor from the reserve<br />
#&nbsp;&nbsp; party and places it into the main/active party.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.transfer_to_party_by_id(reserve_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;transfer_to_party_by_id(reserve_actor_id)<br />
#<br />
#&nbsp;&nbsp; Transfer Party Member to the Reserves by ID<br />
#&nbsp;&nbsp; -------------------------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; main/active party,&nbsp;&nbsp;this command lets you remove the actor&nbsp;&nbsp;from the party<br />
#&nbsp;&nbsp; and places it into the reserves.<br />
#&nbsp;&nbsp; IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.transfer_to_reserve_by_id(party_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;transfer_to_reserve_by_id(party_actor_id)<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# CHANGES FROM THE ORIGINAL<br />
#<br />
# This revision creates an RPGAdvReserve module where configuration values are<br />
# found.&nbsp;&nbsp;Originally, the script had only two values to adjust, but these were<br />
# actively situated&nbsp;&nbsp;within the script itself.&nbsp;&nbsp;And this would&nbsp;&nbsp;require you to<br />
# navigate through the script to find those values. The creation of the module<br />
# should make it easier to define what settings are desired.<br />
#<br />
# The system had values that were hardwired into the original script, be these<br />
# the color settings for Required Actor displays&nbsp;&nbsp;or the descriptive texts and<br />
# warning notices within.&nbsp;&nbsp;These have also been&nbsp;&nbsp;migrated to the configuration<br />
# section so you have no need to search within the scripts.<br />
#<br />
# Repairs had to be performed.&nbsp;&nbsp;You could previously exit&nbsp;&nbsp;the above described<br />
# Party Changing menu&nbsp;&nbsp;with a party containing no members at all.&nbsp;&nbsp;This effec-<br />
# tively would prevent&nbsp;&nbsp;the game to continue.&nbsp;&nbsp;The configuration section has a<br />
# switch to permit this, but not recommended.<br />
#<br />
# Likewise, there were issues&nbsp;&nbsp;with identifying required and reservist members<br />
# in the change party menu. RPG Advorate indeed created the Goldenrod Required<br />
# member color, but never applied its use in the menu. This has been corrected<br />
# while also creating a like color for reserve members appearing in the menus.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# COMPATABILITY / SCRIPT ATTACHED CODE AND REWRITES<br />
#<br />
# This script, when initially released, was not designed to paste the contents<br />
# in place,&nbsp;&nbsp;but instead instructed you&nbsp;&nbsp;to directly edit the default scripts.<br />
# At the time of release,&nbsp;&nbsp;there was little knowledge&nbsp;&nbsp;of the 'alias' property<br />
# which would allow the insertion of new code into methods. And this rework of<br />
# his script takes advantage of the alias technique where it was possible.<br />
# the default scripts. It was not released as a script to insert into <br />
#<br />
# Not all sections were able to benefit of the alias technique,&nbsp;&nbsp;those methods<br />
# still requiring their code rewritten/overwritten. However, said methods have<br />
# the rewritten sections identified.<br />
#<br />
# New Script Content:<br />
#&nbsp;&nbsp;* RPGAdvReserve&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (New) Used to hold configuration values<br />
#&nbsp;&nbsp;* Game_Party&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : (Used by ChangeParty) Methods made to swap members<br />
#&nbsp;&nbsp;* Window_Base&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (Used by ChangeParty) Makes color identified names<br />
#&nbsp;&nbsp;* Window_ChangeMain&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (Used by ChangeParty) Draws the current party<br />
#&nbsp;&nbsp;* Window_ChangeReserve&nbsp;&nbsp; : (Used by ChangeParty) Draws the reserve party<br />
#&nbsp;&nbsp;* Window_PartyChangeInfo : (Used by ChangeParty) Draws recommended party size<br />
#&nbsp;&nbsp;* Interpreter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Shortcut script calls made for the system<br />
#&nbsp;&nbsp;* Scene_ChangeParty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Engine that switches party and reservists around<br />
#<br />
# Aliased Script Content:<br />
#&nbsp;&nbsp;* Game_Actor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Adds the required member status variable<br />
#&nbsp;&nbsp;* Game_Party&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Makes the reserve array &amp; alters add/remove member<br />
#<br />
# Rewritten Script Content:<br />
#&nbsp;&nbsp;* Scene_Menu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : update_status edited for reservist restrictions<br />
#&nbsp;&nbsp;* Scene_Skill&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: main method altered to allow access to reserves<br />
#&nbsp;&nbsp;* Scene_Equip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: main method altered to allow access to reserves<br />
#&nbsp;&nbsp;* Scene_Battle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : start_phase5 altered to allow reserve EXP gains<br />
#<br />
# All scripts that are rewrites of the default scripts have their new code in<br />
# defined areas&nbsp;&nbsp;beginning with&nbsp;&nbsp;either "Beginning of Replaced Code"&nbsp;&nbsp;or with<br />
# "Beginning of Inserted Code",&nbsp;&nbsp;and ending&nbsp;&nbsp;with a like commented statement.<br />
# In many cases, the original code is still available,&nbsp;&nbsp;but commented out for<br />
# end-user recognition.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
module RPGAdvReserve<br />
<br />
<br />
&nbsp;&nbsp;# FEATURE SETTINGS<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# If Reserve members appear in the menu status screen.<br />
&nbsp;&nbsp;&nbsp;&nbsp;MENU_STATUS = true<br />
<br />
&nbsp;&nbsp;# The percent of Exp reserve members get compared to active.<br />
&nbsp;&nbsp;&nbsp;&nbsp;EXP_PERCENT = 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;# (NEW) Allow party to be emptied by Party Changer (not recommended)<br />
&nbsp;&nbsp;# Original did not have a block to prevent emptying ... what a flaw!<br />
&nbsp;&nbsp;&nbsp;&nbsp;PERMIT_EMPTY = true<br />
<br />
<br />
&nbsp;&nbsp;# COLOR SETTINGS<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# Color of actor name when required to be in party.<br />
&nbsp;&nbsp;# Default 216,150,20,255:&nbsp;&nbsp;Goldenrod<br />
&nbsp;&nbsp;&nbsp;&nbsp;COLOR_REQUIRED = Color.new(216, 150, 20, 255)<br />
<br />
&nbsp;&nbsp;# Color of actor name in menu status if a reserve member.<br />
&nbsp;&nbsp;# Default 152, 181, 100, 255:&nbsp;&nbsp;Olive<br />
&nbsp;&nbsp;&nbsp;&nbsp;COLOR_RESERVIST = Color.new(152, 181, 100, 255)<br />
<br />
<br />
&nbsp;&nbsp;# ACTOR WARNING MESSAGES<br />
&nbsp;&nbsp;# =======================================================================<br />
&nbsp;&nbsp;# A carte-blanch error if actor IDs values given are invalid<br />
&nbsp;&nbsp;&nbsp;&nbsp;ID_INVALID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "ID given is invalid."<br />
&nbsp;&nbsp;# Define the text used to show at least one invalid party or reservist ID.<br />
&nbsp;&nbsp;&nbsp;&nbsp;SWAP_Invalid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Cannot swap members. One or both are invalid."<br />
&nbsp;&nbsp;# Define the text used to show the actor ID is not in the reservist party.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_PARTY_Invalid&nbsp;&nbsp;&nbsp;&nbsp;= "Warning: Character is not in the reserve party."<br />
&nbsp;&nbsp;# Define the text used to show the party is full.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_PARTY_Full&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Warning: Main party is full."<br />
&nbsp;&nbsp;# Define the text used to show the actor ID is not in the current party.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_RESERVE_Invalid&nbsp;&nbsp;= "Warning: Character is not in the main party."<br />
<br />
<br />
&nbsp;&nbsp;# PARTY CHANGER MESSAGES<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# Single-line text used to request a party be formed to default.<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Please form a party."<br />
&nbsp;&nbsp;# Dual-line text used to request a custom sized party. Must include {size}.<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request2a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Please form a party"<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "of up to {size} members."<br />
&nbsp;&nbsp;# Warning to note max size setting is invalid.<br />
&nbsp;&nbsp;&nbsp;&nbsp;SIZE_Invalid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Warning: Invalid max size for party."<br />
&nbsp;&nbsp;# Text used to indicate empty position in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;EMPTY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "- Empty -"<br />
&nbsp;&nbsp;&nbsp;&nbsp;DISALLOWED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "- Disallowed -"<br />
<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Actor<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles the actor. It's used within the Game_Actors class<br />
#&nbsp;&nbsp;(&#36;game_actors) and refers to the Game_Party class (&#36;game_party).<br />
#==============================================================================<br />
<br />
class Game_Actor &lt; Game_Battler<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :required&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # required party member flag<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_actor_setup setup<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Setup<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def setup(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_actor_setup(actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@required = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add the additional flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Party<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles the party. It includes information on amount of gold<br />
#&nbsp;&nbsp;and items. Refer to "&#36;game_party" for the instance of this class.<br />
#==============================================================================<br />
<br />
class Game_Party<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :reserve_actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # reserve actors array<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_init initialize<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_setup_add add_actor<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_setup_remove remove_actor<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add the additional array<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Add an Actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def add_actor(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actors.size &gt;= 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If the party is full<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in party&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_setup_add(actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Remove Actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def remove_actor(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(&#36;game_actors[actor_id])&nbsp;&nbsp;# Delete actor from reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_setup_remove(actor_id)&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor1 : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor2 : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap(actor1, actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;error = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set no error<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If actor1 not in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set error <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If actor2 not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set error <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if error&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in error<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::SWAP_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add party actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actors.delete(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;add_actor(actor2.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add reserve actor to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party(actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_PARTY_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actors.size == 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is full<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_PARTY_Full)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;add_actor(actor.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add reservist to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Delete from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve(actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_RESERVE_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;remove_actor(actor.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add party actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id&nbsp;&nbsp; : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap_by_id(party_actor_id, reserve_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(party_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid actor ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(reserve_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid reserve ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor1 = &#36;game_actors[party_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get party member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor2 = &#36;game_actors[reserve_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get reserve member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;swap(actor1, actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Swap the actors<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party_by_id(reserve_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(reserve_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid reserve ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[reserve_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get reserve member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;transfer_to_party(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer actor to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; main_party_actor : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve_by_id(party_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(party_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid actor ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[party_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get party member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;transfer_to_reserve(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Test for valid values above 0<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def valid_id?(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume passes<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false if actor_id.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Fail if nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false unless actor_id.is_a?(Numeric)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Fail if not numeric<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false if actor_id &lt;= 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid value<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true&nbsp;&nbsp;if test&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true if passes<br />
&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::ID_INVALID)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Render ID alert<br />
&nbsp;&nbsp;&nbsp;&nbsp;return false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit method false<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_Base<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class is for all in-game windows.<br />
#==============================================================================<br />
<br />
class Window_Base &lt; Window<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Required Color (Goldenrod)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def required_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;return RPGAdvReserve::COLOR_REQUIRED<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Required Color (Olive)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def reservist_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;return RPGAdvReserve::COLOR_RESERVIST<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Draw Required Name<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp; : draw spot x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp; : draw spot y-coordinate<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def draw_actor_required(actor, x, y)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = required_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(x, y, 120, 32, actor.name)<br />
&nbsp;&nbsp;end&nbsp;&nbsp;<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Draw Reservist Name<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp; : draw spot x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp; : draw spot y-coordinate<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def draw_actor_reservist(actor, x, y)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = reservist_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(x, y, 120, 32, actor.name)<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays party member status on the menu screen.<br />
#==============================================================================<br />
<br />
class Window_MenuStatus &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase contents at start<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = &#36;game_party.actors.size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set max size by party<br />
&nbsp;&nbsp;&nbsp;&nbsp;if RPGAdvReserve::MENU_STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If Switch engaged&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@item_max += &#36;game_party.reserve_actors.size&nbsp;&nbsp;&nbsp;&nbsp;# Add reserves to size<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;&nbsp;&nbsp;= width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set width<br />
&nbsp;&nbsp;&nbsp;&nbsp;ht&nbsp;&nbsp;&nbsp;&nbsp;= @item_max * 120 - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set height by max size<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(wd, ht)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor_array = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# create actor array<br />
&nbsp;&nbsp;&nbsp;&nbsp;for actor in &#36;game_party.actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor_array.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # and push actors in array<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if RPGAdvReserve::MENU_STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If Switch engaged<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for actor in &#36;game_party.reserve_actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through reserves<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor_array.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # and push actors in array<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_idx_max = &#36;game_party.actors.size - 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get last ID for party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for id in 0...@item_max&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle total actor size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set X Coordinate<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = id * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set Y coord by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = actor_array[id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get actor by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw character<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if id &gt; party_idx_max&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If counter past party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_reservist(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw reservist name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_class(actor, x + 144, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw class<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_state(actor, x + 90, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw state<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_exp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x + 236, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw hp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x + 236, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw sp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116 - self.oy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position less than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy -= 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reduce origin <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &gt; 348&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position over 348<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy += 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Increase origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_ChangeMain<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays the current party members in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_ChangeMain &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size=3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(0, 0, 320, 480)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.index&nbsp;&nbsp;= -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size&nbsp;&nbsp; = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set max&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for idx in 0..3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through party max<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set text x coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = idx * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set Y coords by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[idx] != nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a valid actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.actors[idx]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if idx &gt; @max_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If space above max size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::DISALLOWED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set disallowed text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::EMPTY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set empty space text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(0,y+32,288,32,text,1) # Display the text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And skip to next actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Graphic<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.required == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a required actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_required(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Redraw Required name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x + 160, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw HP<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw SP<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_ChangeReserve<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays the reserve party members in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_ChangeReserve &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(320, 0, 320, 360)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.index = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = &#36;game_party.reserve_actors.size + 1&nbsp;&nbsp; # Get reservist party max<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= 96 + @item_max * 96 - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set reservist area size<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= 328 if size &lt; 328&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Limit size to window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase contents area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, size)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for idx in 0...&#36;game_party.reserve_actors.size&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through reservists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set text x coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = idx * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set Y coords by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.reserve_actors[idx]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get reservist actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw character<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x + 160, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw HP<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw SP<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116 - self.oy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position less than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy -= 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reduce origin <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &gt; 232&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position over 232<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy += 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Increase origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
#==============================================================================<br />
# ** Window_PartyChangeInfo<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays help information in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_PartyChangeInfo &lt; Window_Base<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_reader&nbsp;&nbsp; :max_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # maximum party size<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(320, 360, 320, 120)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;text1 = RPGAdvReserve::INFO_Request1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get Full Party Size note<br />
&nbsp;&nbsp;&nbsp;&nbsp;text2 = RPGAdvReserve::INFO_Request2a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get 1st Set party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;tempt = RPGAdvReserve::INFO_Request2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get 2nd Set party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;text3 = tempt.gsub(/{size}/) {(@max_size.to_s) }&nbsp;&nbsp;# Replace string with size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @max_size == 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If max size default<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 0, 240, 32, text1)&nbsp;&nbsp; # Show full party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @max_size &gt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If alternate size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 0, 240, 32, text2)&nbsp;&nbsp; # Show 1st party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 32, 240, 32, text3)&nbsp;&nbsp;# Show 2nd party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This interpreter runs event commands. This class is used within the<br />
#&nbsp;&nbsp;Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id&nbsp;&nbsp; : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap_by_id(party_actor_id=1, reserve_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.swap_by_id(party_actor_id, reserve_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party_by_id(reserve_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_party_by_id(reserve_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve_by_id(party_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve_by_id(party_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set required actor flag<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; flag&nbsp;&nbsp;&nbsp;&nbsp; : boolean value (true/false)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def required_actor(actor_id=0, flag=true)<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if actor_id.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless value.is_a?(Numeric)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if not numeric<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if actor_id &lt;= 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid value<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if &#36;game_party.actors[actor_id] == nil&nbsp;&nbsp;&nbsp;&nbsp; # Exit if no actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless (flag == true || flag == false)&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not boolean<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = flag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Apply the flag<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Party Changer Menu<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; max_size : party size maximum<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def change_party(max_size=0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_ChangeParty.new(max_size)<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Menu<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs menu screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when status window is active)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_status<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make command window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@command_window.active = true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.index = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Branch by command window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case @command_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 1&nbsp;&nbsp;# skill<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## If this actor's action limit is 2 or more<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#--------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Check actor restriction if index points to active party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @status_window.index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_actor = &#36;game_party.actors[@status_window.index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Or check actor restriction for reserve party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size = &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_actor = &#36;game_party.reserve_actors[@status_window.index - size]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If this actor's action limit is 2 or more<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if check_actor.restriction &gt;= 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#--------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to skill screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Skill.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 2&nbsp;&nbsp;# equipment<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to equipment screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Equip.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 3&nbsp;&nbsp;# status<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to status screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Status.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Skill<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs skill screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Skill<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;## Get actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If actor index within party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actor_index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise get actor from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idx = @actor_index - &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.reserve_actors[idx]<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make help window, status window, and skill window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window = Window_Help.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@status_window = Window_SkillStatus.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window = Window_Skill.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Associate help window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make target window (set to invisible / inactive)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window = Window_Target.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.visible = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@status_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.dispose<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Equip<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs equipment screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Equip<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;## Get actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If actor index within party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actor_index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise get actor from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idx = @actor_index - &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.reserve_actors[idx]<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window = Window_Help.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@left_window = Window_EquipLeft.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window = Window_EquipRight.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1 = Window_EquipItem.new(@actor, 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2 = Window_EquipItem.new(@actor, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3 = Window_EquipItem.new(@actor, 2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4 = Window_EquipItem.new(@actor, 3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5 = Window_EquipItem.new(@actor, 4)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Associate help window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.index = @equip_index<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@left_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Battle<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs battle screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Battle<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Start After Battle Phase<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def start_phase5<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Shift to phase 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;@phase = 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Play battle end ME<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.me_play(&#36;game_system.battle_end_me)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Return to BGM before battle started<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.bgm_play(&#36;game_temp.map_bgm)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Initialize EXP, amount of gold, and treasure<br />
&nbsp;&nbsp;&nbsp;&nbsp;exp = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;gold = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;treasures = []<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;for enemy in &#36;game_troop.enemies<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If enemy is not hidden<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless enemy.hidden<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add EXP and amount of gold obtained<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exp += enemy.exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gold += enemy.gold<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Determine if treasure appears<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if rand(100) &lt; enemy.treasure_prob<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.item_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_items[enemy.item_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.weapon_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_weapons[enemy.weapon_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.armor_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_armors[enemy.armor_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Treasure is limited to a maximum of 6 items<br />
&nbsp;&nbsp;&nbsp;&nbsp;treasures = treasures[0..5]<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining EXP<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in 0...&#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.actors[i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.cant_get_exp? == false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last_level = actor.level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor.exp += exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.level &gt; last_level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.level_up(i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Inserted Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtain Reserve Character Exp Percentage<br />
&nbsp;&nbsp;&nbsp;&nbsp;perc = RPGAdvReserve::EXP_PERCENT<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Reserve Characters Obtaining EXP&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in 0...&#36;game_party.reserve_actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.reserve_actors[i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.cant_get_exp? == false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor.exp += exp * perc / 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Inserted&nbsp;&nbsp;Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining gold<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_gold(gold)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining treasure<br />
&nbsp;&nbsp;&nbsp;&nbsp;for item in treasures<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_item(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Weapon<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_weapon(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Armor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_armor(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make battle result window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@result_window = Window_BattleResult.new(exp, gold, treasures)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set wait count<br />
&nbsp;&nbsp;&nbsp;&nbsp;@phase5_wait_count = 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_ChangeParty<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs party management processing.<br />
#==============================================================================<br />
<br />
class Scene_ChangeParty<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; max_size : max size of party<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size=0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtain text warning<br />
&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::SIZE_Invalid<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set message and exit If below 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;if max_size &lt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set message and exit if above standard limit of 4<br />
&nbsp;&nbsp;&nbsp;&nbsp;if max_size &gt; 4<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set max size based on index positions (0-3) rather than (1-4)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Define party max for Change Party menu (0-3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; = @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; = 4 if party_max == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; -= 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window&nbsp;&nbsp; = Window_ChangeMain.new(party_max)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window = Window_ChangeReserve.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window&nbsp;&nbsp;&nbsp;&nbsp;= Window_PartyChangeInfo.new(@max_size)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set window values<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.index&nbsp;&nbsp;&nbsp;&nbsp; = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Clear memorized actors<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actor1 = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window.dispose<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Update windows&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If party window is active: call update_party<br />
&nbsp;&nbsp;&nbsp;&nbsp;return update_party&nbsp;&nbsp;&nbsp;&nbsp; if @party_window.active<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If reserve window is active: call update_reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;return update_reserve&nbsp;&nbsp; if @reserve_window.active<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when updating the party window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_party<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is empty and not permitted to empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors.size == 0 &amp;&amp; !RPGAdvReserve::PERMIT_EMPTY<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is larger than maximum size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val = @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val = 4 if val == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors.size &gt; val<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to map screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Map.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set party window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place = @party_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if cursor goes beyond party size and no one in that spot<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @max_size &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if place &gt;= @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place].nil?<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party member exists at cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place] != nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And if party is required (cannot remove)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place].required<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there are no reserve party members<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.reserve_actors.size == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer the actor to the reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve(&#36;game_party.actors[place])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Refresh both windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@party_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If reserve party members exist<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.reserve_actors.size &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make reserve window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor1 = &#36;game_party.actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when updating the reserve window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set reserve window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place = @reserve_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if cursor goes beyond reserve party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if place == &#36;game_party.reserve_actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If no memorized party actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @actor1 == nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer stored party member to reserves<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve(@actor1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there is no stored party actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @actor1 == nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize reserve member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = &#36;game_party.reserve_actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer reserve member to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_party(@actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there a stored party actor exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize reserve member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = &#36;game_party.reserve_actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Swap both party and reserve party members<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.swap(@actor1, @actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when making the party window active)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
Place below Scene_Debug and above Main.  It rewrites methods in four Scene_ classes, so it should be high in your list of custom scripts. Be aware it may conflict with the menu, skill, equip and battle treasure systems.<br />
<br />
Detailed instructions are included in the script itself.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
As noted, there are major rewrites.  Be warned.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
RPGAdvocate for the original version.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
There were no terms of use listed at RPG Advocate's site, Phylomortis.com. However, I would think it would be prudent to give him credit for the work.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Reserve Party Tools</span></span><br />
<span style="font-size: medium;" class="mycode_size">Original Version by RPG Advocate 4/12/2005<br />
Edit and repairs by DerVVulfman</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This script enables support  for a "reserve" party of arbitrary size.  These characters don't fight in battle.  You are able to remove party members  and place them within the reserves by use of a new menu designed in the system. And adding new party members (with "Change Party Member") while the party is full will add them to the reserves.<br />
<br />
The original version required rewrites everywhere and expected the end-user to perform direct edits to the default scripts.  This version fixes some errors and oversights . And while still containing some direct alterations of default scripts, has those edited areas clearly marked for reference.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Script</span></span><br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> The Script</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;"><div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>#==============================================================================<br />
# Reserve Party Tools<br />
#------------------------------------------------------------------------------<br />
# by RPG Advocate 4/12/2005<br />
# Edit and repairs by DerVVulfman 6/27/2026<br />
# RGSS / RPGMaker XP<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# THE RESERVE PARTY MENU<br />
#<br />
# This script enables support&nbsp;&nbsp;for a "reserve" party of arbitrary size.&nbsp;&nbsp;These<br />
# characters don't fight in battle. If you want to give the player the ability<br />
# to switch characters between the party and reserve party,&nbsp;&nbsp;use either script<br />
# call shown below:<br />
#<br />
# *&nbsp;&nbsp;&#36;scene = Scene_PartyChange.new(value)<br />
# *&nbsp;&nbsp;change_party(value)<br />
#<br />
# The 'value' represents&nbsp;&nbsp;the maximun number of members you want in the party,<br />
# and can be left empty if using the default party size of '4'. You may set it<br />
# the range from 0-4, with 0 indicating full default party size of '4'. Values<br />
# beyond that range are invalid.<br />
#<br />
# *&nbsp;&nbsp;&#36;scene = Scene_PartyChange.new<br />
# *&nbsp;&nbsp;change_party<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# RESERVIST BATTLE EXPERIENCE<br />
#<br />
# By default, inactive party members gain experience at the same rate as active<br />
# members. To change this,&nbsp;&nbsp;edit the EXP_PERCENT constant&nbsp;&nbsp;in the RPGAdvReserve<br />
# module to the percentage of experience you want the inactive party to gain.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# REQUIRED / PERMANENT PARTY MEMBERS<br />
#<br />
# This script supports required party members, actors that have been classified<br />
# as necessary within the party&nbsp;&nbsp;and cannot be removed.&nbsp;&nbsp;To make a party member<br />
# required or remove its required status, you may use either script calls:<br />
#<br />
# *&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = true/false<br />
# *&nbsp;&nbsp;required_actor(actor_id, true/false)<br />
#<br />
# Both calls requests you&nbsp;&nbsp;to set a value of true,&nbsp;&nbsp;or false in order to remove<br />
# the required status.&nbsp;&nbsp;And within the Change Member menu,&nbsp;&nbsp;these party members<br />
# will appear with a predefined color in their names, default to Goldenrod.<br />
#<br />
# You should only make a character already in the party required. <br />
#<br />
# Making a reserve member 'required' will not work.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# CHANGING PARTY MEMBERS<br />
#<br />
# This script changes how the "Change Party Members" event command works.<br />
#<br />
# If you try to add a charater to the party when the party is full, that char-<br />
# acter will automatically be added to the reserve party.&nbsp;&nbsp;And if you remove a<br />
# party member, that character will be removed if they are in either the party<br />
# or the reserve party. However, it only recognizes a 4-party system when this<br />
# is applied, and does not recognize alternate party sizes.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# SCRIPT CALLS<br />
#<br />
# Initially,&nbsp;&nbsp;the only script calls noted were lenghty&nbsp;&nbsp;and direct commands to<br />
# the Game_Party class&nbsp;&nbsp;or direct calls&nbsp;&nbsp;to &#36;scene itself.&nbsp;&nbsp;Other script calls<br />
# were possible but not given. Here, we view all relevant script calls showing<br />
# both original and newer quick commands found in the Interpreter class:<br />
#<br />
#&nbsp;&nbsp; The Menu Command<br />
#&nbsp;&nbsp; ----------------<br />
#&nbsp;&nbsp; Used to bring up the actual Party/Reservist changing menu<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;scene = Scene_ChangeParty.new(max_size)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;change_party(max_size)<br />
#<br />
#&nbsp;&nbsp; Set Actor Required Status<br />
#&nbsp;&nbsp; -------------------------<br />
#&nbsp;&nbsp; Used to define an in-party&nbsp;&nbsp;(not a reservist member)&nbsp;&nbsp;as a fixed member of<br />
#&nbsp;&nbsp; the current party.&nbsp;&nbsp;The 'actor_id' value is from the database ID.&nbsp;&nbsp;And the<br />
#&nbsp;&nbsp; 'flag' value is either true or false.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = flag<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;required_actor(actor_id, flag)<br />
#<br />
#&nbsp;&nbsp; Swap Actors by database ID<br />
#&nbsp;&nbsp; --------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; both the party and reserve party, this command lets you exchange one actor<br />
#&nbsp;&nbsp; from the party with one from the reserves.<br />
#&nbsp;&nbsp; IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.swap_by_id(party_actor_id, reserve_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;swap_by_id(party_actor_id, reserve_actor_id)<br />
#<br />
#&nbsp;&nbsp; Transfer Reservist to the Party by ID<br />
#&nbsp;&nbsp; -------------------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; the reserve party, this command lets you remove the actor from the reserve<br />
#&nbsp;&nbsp; party and places it into the main/active party.<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.transfer_to_party_by_id(reserve_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;transfer_to_party_by_id(reserve_actor_id)<br />
#<br />
#&nbsp;&nbsp; Transfer Party Member to the Reserves by ID<br />
#&nbsp;&nbsp; -------------------------------------------<br />
#&nbsp;&nbsp; Assuming there is a system&nbsp;&nbsp;tracking what actors&nbsp;&nbsp;(by database ID)&nbsp;&nbsp;are in<br />
#&nbsp;&nbsp; main/active party,&nbsp;&nbsp;this command lets you remove the actor&nbsp;&nbsp;from the party<br />
#&nbsp;&nbsp; and places it into the reserves.<br />
#&nbsp;&nbsp; IT DOES NOT RECOGNIZE THE 'REQUIRED" ACTOR STATUS<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;&#36;game_party.transfer_to_reserve_by_id(party_actor_id)<br />
#&nbsp;&nbsp;&nbsp;&nbsp; *&nbsp;&nbsp;transfer_to_reserve_by_id(party_actor_id)<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# CHANGES FROM THE ORIGINAL<br />
#<br />
# This revision creates an RPGAdvReserve module where configuration values are<br />
# found.&nbsp;&nbsp;Originally, the script had only two values to adjust, but these were<br />
# actively situated&nbsp;&nbsp;within the script itself.&nbsp;&nbsp;And this would&nbsp;&nbsp;require you to<br />
# navigate through the script to find those values. The creation of the module<br />
# should make it easier to define what settings are desired.<br />
#<br />
# The system had values that were hardwired into the original script, be these<br />
# the color settings for Required Actor displays&nbsp;&nbsp;or the descriptive texts and<br />
# warning notices within.&nbsp;&nbsp;These have also been&nbsp;&nbsp;migrated to the configuration<br />
# section so you have no need to search within the scripts.<br />
#<br />
# Repairs had to be performed.&nbsp;&nbsp;You could previously exit&nbsp;&nbsp;the above described<br />
# Party Changing menu&nbsp;&nbsp;with a party containing no members at all.&nbsp;&nbsp;This effec-<br />
# tively would prevent&nbsp;&nbsp;the game to continue.&nbsp;&nbsp;The configuration section has a<br />
# switch to permit this, but not recommended.<br />
#<br />
# Likewise, there were issues&nbsp;&nbsp;with identifying required and reservist members<br />
# in the change party menu. RPG Advorate indeed created the Goldenrod Required<br />
# member color, but never applied its use in the menu. This has been corrected<br />
# while also creating a like color for reserve members appearing in the menus.<br />
#<br />
#<br />
#------------------------------------------------------------------------------<br />
#<br />
# COMPATABILITY / SCRIPT ATTACHED CODE AND REWRITES<br />
#<br />
# This script, when initially released, was not designed to paste the contents<br />
# in place,&nbsp;&nbsp;but instead instructed you&nbsp;&nbsp;to directly edit the default scripts.<br />
# At the time of release,&nbsp;&nbsp;there was little knowledge&nbsp;&nbsp;of the 'alias' property<br />
# which would allow the insertion of new code into methods. And this rework of<br />
# his script takes advantage of the alias technique where it was possible.<br />
# the default scripts. It was not released as a script to insert into <br />
#<br />
# Not all sections were able to benefit of the alias technique,&nbsp;&nbsp;those methods<br />
# still requiring their code rewritten/overwritten. However, said methods have<br />
# the rewritten sections identified.<br />
#<br />
# New Script Content:<br />
#&nbsp;&nbsp;* RPGAdvReserve&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (New) Used to hold configuration values<br />
#&nbsp;&nbsp;* Game_Party&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : (Used by ChangeParty) Methods made to swap members<br />
#&nbsp;&nbsp;* Window_Base&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (Used by ChangeParty) Makes color identified names<br />
#&nbsp;&nbsp;* Window_ChangeMain&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: (Used by ChangeParty) Draws the current party<br />
#&nbsp;&nbsp;* Window_ChangeReserve&nbsp;&nbsp; : (Used by ChangeParty) Draws the reserve party<br />
#&nbsp;&nbsp;* Window_PartyChangeInfo : (Used by ChangeParty) Draws recommended party size<br />
#&nbsp;&nbsp;* Interpreter&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Shortcut script calls made for the system<br />
#&nbsp;&nbsp;* Scene_ChangeParty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: Engine that switches party and reservists around<br />
#<br />
# Aliased Script Content:<br />
#&nbsp;&nbsp;* Game_Actor&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Adds the required member status variable<br />
#&nbsp;&nbsp;* Game_Party&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : Makes the reserve array &amp; alters add/remove member<br />
#<br />
# Rewritten Script Content:<br />
#&nbsp;&nbsp;* Scene_Menu&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : update_status edited for reservist restrictions<br />
#&nbsp;&nbsp;* Scene_Skill&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: main method altered to allow access to reserves<br />
#&nbsp;&nbsp;* Scene_Equip&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;: main method altered to allow access to reserves<br />
#&nbsp;&nbsp;* Scene_Battle&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; : start_phase5 altered to allow reserve EXP gains<br />
#<br />
# All scripts that are rewrites of the default scripts have their new code in<br />
# defined areas&nbsp;&nbsp;beginning with&nbsp;&nbsp;either "Beginning of Replaced Code"&nbsp;&nbsp;or with<br />
# "Beginning of Inserted Code",&nbsp;&nbsp;and ending&nbsp;&nbsp;with a like commented statement.<br />
# In many cases, the original code is still available,&nbsp;&nbsp;but commented out for<br />
# end-user recognition.<br />
#<br />
#<br />
#==============================================================================<br />
<br />
<br />
<br />
module RPGAdvReserve<br />
<br />
<br />
&nbsp;&nbsp;# FEATURE SETTINGS<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# If Reserve members appear in the menu status screen.<br />
&nbsp;&nbsp;&nbsp;&nbsp;MENU_STATUS = true<br />
<br />
&nbsp;&nbsp;# The percent of Exp reserve members get compared to active.<br />
&nbsp;&nbsp;&nbsp;&nbsp;EXP_PERCENT = 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;# (NEW) Allow party to be emptied by Party Changer (not recommended)<br />
&nbsp;&nbsp;# Original did not have a block to prevent emptying ... what a flaw!<br />
&nbsp;&nbsp;&nbsp;&nbsp;PERMIT_EMPTY = true<br />
<br />
<br />
&nbsp;&nbsp;# COLOR SETTINGS<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# Color of actor name when required to be in party.<br />
&nbsp;&nbsp;# Default 216,150,20,255:&nbsp;&nbsp;Goldenrod<br />
&nbsp;&nbsp;&nbsp;&nbsp;COLOR_REQUIRED = Color.new(216, 150, 20, 255)<br />
<br />
&nbsp;&nbsp;# Color of actor name in menu status if a reserve member.<br />
&nbsp;&nbsp;# Default 152, 181, 100, 255:&nbsp;&nbsp;Olive<br />
&nbsp;&nbsp;&nbsp;&nbsp;COLOR_RESERVIST = Color.new(152, 181, 100, 255)<br />
<br />
<br />
&nbsp;&nbsp;# ACTOR WARNING MESSAGES<br />
&nbsp;&nbsp;# =======================================================================<br />
&nbsp;&nbsp;# A carte-blanch error if actor IDs values given are invalid<br />
&nbsp;&nbsp;&nbsp;&nbsp;ID_INVALID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "ID given is invalid."<br />
&nbsp;&nbsp;# Define the text used to show at least one invalid party or reservist ID.<br />
&nbsp;&nbsp;&nbsp;&nbsp;SWAP_Invalid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Cannot swap members. One or both are invalid."<br />
&nbsp;&nbsp;# Define the text used to show the actor ID is not in the reservist party.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_PARTY_Invalid&nbsp;&nbsp;&nbsp;&nbsp;= "Warning: Character is not in the reserve party."<br />
&nbsp;&nbsp;# Define the text used to show the party is full.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_PARTY_Full&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Warning: Main party is full."<br />
&nbsp;&nbsp;# Define the text used to show the actor ID is not in the current party.<br />
&nbsp;&nbsp;&nbsp;&nbsp;TO_RESERVE_Invalid&nbsp;&nbsp;= "Warning: Character is not in the main party."<br />
<br />
<br />
&nbsp;&nbsp;# PARTY CHANGER MESSAGES<br />
&nbsp;&nbsp;# =======================================================================<br />
<br />
&nbsp;&nbsp;# Single-line text used to request a party be formed to default.<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "Please form a party."<br />
&nbsp;&nbsp;# Dual-line text used to request a custom sized party. Must include {size}.<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request2a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Please form a party"<br />
&nbsp;&nbsp;&nbsp;&nbsp;INFO_Request2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "of up to {size} members."<br />
&nbsp;&nbsp;# Warning to note max size setting is invalid.<br />
&nbsp;&nbsp;&nbsp;&nbsp;SIZE_Invalid&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "Warning: Invalid max size for party."<br />
&nbsp;&nbsp;# Text used to indicate empty position in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;EMPTY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; = "- Empty -"<br />
&nbsp;&nbsp;&nbsp;&nbsp;DISALLOWED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;= "- Disallowed -"<br />
<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Actor<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles the actor. It's used within the Game_Actors class<br />
#&nbsp;&nbsp;(&#36;game_actors) and refers to the Game_Party class (&#36;game_party).<br />
#==============================================================================<br />
<br />
class Game_Actor &lt; Game_Battler<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :required&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # required party member flag<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_actor_setup setup<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Setup<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def setup(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_actor_setup(actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@required = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add the additional flag<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
#==============================================================================<br />
# ** Game_Party<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class handles the party. It includes information on amount of gold<br />
#&nbsp;&nbsp;and items. Refer to "&#36;game_party" for the instance of this class.<br />
#==============================================================================<br />
<br />
class Game_Party<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_accessor :reserve_actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # reserve actors array<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Alias Listings<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_init initialize<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_setup_add add_actor<br />
&nbsp;&nbsp;alias rpgadv_reserve_g_party_setup_remove remove_actor<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_init&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add the additional array<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Add an Actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def add_actor(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actors.size &gt;= 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If the party is full<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in party&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_setup_add(actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Remove Actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def remove_actor(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(&#36;game_actors[actor_id])&nbsp;&nbsp;# Delete actor from reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;rpgadv_reserve_g_party_setup_remove(actor_id)&nbsp;&nbsp; # Run the original method<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor1 : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor2 : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap(actor1, actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;error = false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set no error<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If actor1 not in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set error <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If actor2 not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set error <br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if error&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If in error<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::SWAP_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add party actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actors.delete(actor1)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;add_actor(actor2.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add reserve actor to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party(actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @reserve_actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_PARTY_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actors.size == 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is full<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_PARTY_Full)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;add_actor(actor.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add reservist to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.delete(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Delete from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve(actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if not @actors.include?(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If actor not in party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::TO_RESERVE_Invalid)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Display error message<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And exit method<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;remove_actor(actor.id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Delete actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_actors.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Add party actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id&nbsp;&nbsp; : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap_by_id(party_actor_id, reserve_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(party_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid actor ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(reserve_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid reserve ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor1 = &#36;game_actors[party_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get party member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor2 = &#36;game_actors[reserve_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get reserve member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;swap(actor1, actor2)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Swap the actors<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party_by_id(reserve_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(reserve_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid reserve ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[reserve_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get reserve member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;transfer_to_party(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer actor to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve by ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; main_party_actor : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve_by_id(party_actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless valid_id?(party_actor_id)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid actor ID<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_actors[party_actor_id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get party member actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;transfer_to_reserve(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer actor to reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Test for valid values above 0<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def valid_id?(actor_id)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Assume passes<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false if actor_id.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Fail if nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false unless actor_id.is_a?(Numeric)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Fail if not numeric<br />
&nbsp;&nbsp;&nbsp;&nbsp;test = false if actor_id &lt;= 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid value<br />
&nbsp;&nbsp;&nbsp;&nbsp;return true&nbsp;&nbsp;if test&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit true if passes<br />
&nbsp;&nbsp;&nbsp;&nbsp;print(RPGAdvReserve::ID_INVALID)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Render ID alert<br />
&nbsp;&nbsp;&nbsp;&nbsp;return false&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit method false<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_Base<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class is for all in-game windows.<br />
#==============================================================================<br />
<br />
class Window_Base &lt; Window<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Required Color (Goldenrod)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def required_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;return RPGAdvReserve::COLOR_REQUIRED<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Required Color (Olive)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def reservist_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;return RPGAdvReserve::COLOR_RESERVIST<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Draw Required Name<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp; : draw spot x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp; : draw spot y-coordinate<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def draw_actor_required(actor, x, y)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = required_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(x, y, 120, 32, actor.name)<br />
&nbsp;&nbsp;end&nbsp;&nbsp;<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Draw Reservist Name<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor : actor<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; x&nbsp;&nbsp;&nbsp;&nbsp; : draw spot x-coordinate<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; y&nbsp;&nbsp;&nbsp;&nbsp; : draw spot y-coordinate<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def draw_actor_reservist(actor, x, y)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.font.color = reservist_color<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(x, y, 120, 32, actor.name)<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_MenuStatus<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays party member status on the menu screen.<br />
#==============================================================================<br />
<br />
class Window_MenuStatus &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase contents at start<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = &#36;game_party.actors.size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set max size by party<br />
&nbsp;&nbsp;&nbsp;&nbsp;if RPGAdvReserve::MENU_STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If Switch engaged&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@item_max += &#36;game_party.reserve_actors.size&nbsp;&nbsp;&nbsp;&nbsp;# Add reserves to size<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;&nbsp;&nbsp;= width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set width<br />
&nbsp;&nbsp;&nbsp;&nbsp;ht&nbsp;&nbsp;&nbsp;&nbsp;= @item_max * 120 - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set height by max size<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(wd, ht)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;actor_array = []&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# create actor array<br />
&nbsp;&nbsp;&nbsp;&nbsp;for actor in &#36;game_party.actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor_array.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # and push actors in array<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if RPGAdvReserve::MENU_STATUS&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If Switch engaged<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;for actor in &#36;game_party.reserve_actors&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through reserves<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor_array.push(actor)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # and push actors in array<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_idx_max = &#36;game_party.actors.size - 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get last ID for party<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for id in 0...@item_max&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle total actor size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set X Coordinate<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = id * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set Y coord by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = actor_array[id]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get actor by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw character<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if id &gt; party_idx_max&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If counter past party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_reservist(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw reservist name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_class(actor, x + 144, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw class<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_state(actor, x + 90, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw state<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_exp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x + 236, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw hp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x + 236, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw sp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end&nbsp;&nbsp;<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116 - self.oy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position less than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy -= 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reduce origin <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &gt; 348&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position over 348<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy += 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Increase origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_ChangeMain<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays the current party members in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_ChangeMain &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size=3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(0, 0, 320, 480)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.index&nbsp;&nbsp;= -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size&nbsp;&nbsp; = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = 4&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set max&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for idx in 0..3&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Cycle through party max<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set text x coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = idx * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set Y coords by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[idx] != nil&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a valid actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.actors[idx]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if idx &gt; @max_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If space above max size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::DISALLOWED&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set disallowed text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::EMPTY&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set empty space text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(0,y+32,288,32,text,1) # Display the text<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;next&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And skip to next actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Graphic<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.required == true&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If a required actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_required(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Redraw Required name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x + 160, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw HP<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw SP<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Window_ChangeReserve<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays the reserve party members in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_ChangeReserve &lt; Window_Selectable<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(320, 0, 320, 360)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.index = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_max = &#36;game_party.reserve_actors.size + 1&nbsp;&nbsp; # Get reservist party max<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= 96 + @item_max * 96 - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set reservist area size<br />
&nbsp;&nbsp;&nbsp;&nbsp;size&nbsp;&nbsp;= 328 if size &lt; 328&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Limit size to window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.dispose&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Erase contents area<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, size)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;for idx in 0...&#36;game_party.reserve_actors.size&nbsp;&nbsp;&nbsp;&nbsp;# Cycle through reservists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;x = 64&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set text x coordinates<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y = idx * 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Set Y coords by counter<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.reserve_actors[idx]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get reservist actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_graphic(actor, x - 40, y + 80)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw character<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_name(actor, x, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Draw name<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_level(actor, x + 160, y)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw Level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_hp(actor, x, y + 32)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw HP<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;draw_actor_sp(actor, x, y + 64)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Draw SP<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Cursor Rectangle Update<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_cursor_rect<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @index &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If no valid index <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.empty&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Remove cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;else&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;y&nbsp;&nbsp; = @index * 116 - self.oy&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get y-position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;wd&nbsp;&nbsp;= self.width - 32&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get width <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.cursor_rect.set(0, y, wd, 96)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And set cursor dimension<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &lt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position less than 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy -= 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Reduce origin <br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if self.cursor_rect.y &gt; 232&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If position over 232<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.oy += 116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Increase origin<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;refresh&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Refresh menu contents<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_cursor_rect&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And redraw cursor<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
#==============================================================================<br />
# ** Window_PartyChangeInfo<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This window displays help information in the Party Changer scene<br />
#==============================================================================<br />
<br />
class Window_PartyChangeInfo &lt; Window_Base<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Public Instance Variables<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;attr_reader&nbsp;&nbsp; :max_size&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # maximum party size<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;super(320, 360, 320, 120)<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents = Bitmap.new(width - 32, height - 32)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Refresh<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;self.contents.clear&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # And make contents clear<br />
&nbsp;&nbsp;&nbsp;&nbsp;text1 = RPGAdvReserve::INFO_Request1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get Full Party Size note<br />
&nbsp;&nbsp;&nbsp;&nbsp;text2 = RPGAdvReserve::INFO_Request2a&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get 1st Set party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;tempt = RPGAdvReserve::INFO_Request2b&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Get 2nd Set party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;text3 = tempt.gsub(/{size}/) {(@max_size.to_s) }&nbsp;&nbsp;# Replace string with size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @max_size == 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # If max size default<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 0, 240, 32, text1)&nbsp;&nbsp; # Show full party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @max_size &gt; 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If alternate size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 0, 240, 32, text2)&nbsp;&nbsp; # Show 1st party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;self.contents.draw_text(4, 32, 240, 32, text3)&nbsp;&nbsp;# Show 2nd party note<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Interpreter<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This interpreter runs event commands. This class is used within the<br />
#&nbsp;&nbsp;Game_System class and the Game_Event class.<br />
#==============================================================================<br />
<br />
class Interpreter<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Swap Actors by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id&nbsp;&nbsp; : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def swap_by_id(party_actor_id=1, reserve_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.swap_by_id(party_actor_id, reserve_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Party by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; reserve_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_party_by_id(reserve_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_party_by_id(reserve_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Transfer to Reserve by database ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; party_actor_id : actor ID<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def transfer_to_reserve_by_id(party_actor_id=1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve_by_id(party_actor_id)<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Set required actor flag<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; actor_id : actor ID<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; flag&nbsp;&nbsp;&nbsp;&nbsp; : boolean value (true/false)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def required_actor(actor_id=0, flag=true)<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if actor_id.nil?&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless value.is_a?(Numeric)&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Exit if not numeric<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if actor_id &lt;= 0&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; # Exit if invalid value<br />
&nbsp;&nbsp;&nbsp;&nbsp;return if &#36;game_party.actors[actor_id] == nil&nbsp;&nbsp;&nbsp;&nbsp; # Exit if no actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;return unless (flag == true || flag == false)&nbsp;&nbsp;&nbsp;&nbsp; # Exit if not boolean<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.actors[actor_id].required = flag&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Apply the flag<br />
&nbsp;&nbsp;end<br />
&nbsp;&nbsp;<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Party Changer Menu<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; max_size : party size maximum<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def change_party(max_size=0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_ChangeParty.new(max_size)<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Menu<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs menu screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Menu<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when status window is active)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_status<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make command window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@command_window.active = true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.index = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Branch by command window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case @command_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 1&nbsp;&nbsp;# skill<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;## If this actor's action limit is 2 or more<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#if &#36;game_party.actors[@status_window.index].restriction &gt;= 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#--------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Check actor restriction if index points to active party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @status_window.index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_actor = &#36;game_party.actors[@status_window.index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Or check actor restriction for reserve party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;size = &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;check_actor = &#36;game_party.reserve_actors[@status_window.index - size]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If this actor's action limit is 2 or more<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if check_actor.restriction &gt;= 2<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#--------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to skill screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Skill.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 2&nbsp;&nbsp;# equipment<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to equipment screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Equip.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when 3&nbsp;&nbsp;# status<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to status screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Status.new(@status_window.index)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Skill<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs skill screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Skill<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;## Get actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If actor index within party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actor_index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise get actor from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idx = @actor_index - &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.reserve_actors[idx]<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make help window, status window, and skill window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window = Window_Help.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@status_window = Window_SkillStatus.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window = Window_Skill.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Associate help window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make target window (set to invisible / inactive)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window = Window_Target.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.visible = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.active = false<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@status_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@skill_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@target_window.dispose<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Equip<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs equipment screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Equip<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;## Get actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;#@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Replaced Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If actor index within party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;if @actor_index &lt; &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Get actor from party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.actors[@actor_index]<br />
&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Otherwise get actor from reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;idx = @actor_index - &#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor = &#36;game_party.reserve_actors[idx]<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Replaced Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window = Window_Help.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@left_window = Window_EquipLeft.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window = Window_EquipRight.new(@actor)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1 = Window_EquipItem.new(@actor, 0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2 = Window_EquipItem.new(@actor, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3 = Window_EquipItem.new(@actor, 2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4 = Window_EquipItem.new(@actor, 3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5 = Window_EquipItem.new(@actor, 4)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Associate help window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5.help_window = @help_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.index = @equip_index<br />
&nbsp;&nbsp;&nbsp;&nbsp;refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@help_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@left_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@right_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window1.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window2.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window3.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window4.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@item_window5.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_Battle<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs battle screen processing.<br />
#==============================================================================<br />
<br />
class Scene_Battle<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Start After Battle Phase<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def start_phase5<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Shift to phase 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;@phase = 5<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Play battle end ME<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.me_play(&#36;game_system.battle_end_me)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Return to BGM before battle started<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.bgm_play(&#36;game_temp.map_bgm)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Initialize EXP, amount of gold, and treasure<br />
&nbsp;&nbsp;&nbsp;&nbsp;exp = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;gold = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;treasures = []<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;for enemy in &#36;game_troop.enemies<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If enemy is not hidden<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;unless enemy.hidden<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Add EXP and amount of gold obtained<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exp += enemy.exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;gold += enemy.gold<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Determine if treasure appears<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if rand(100) &lt; enemy.treasure_prob<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.item_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_items[enemy.item_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.weapon_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_weapons[enemy.weapon_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if enemy.armor_id &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;treasures.push(&#36;data_armors[enemy.armor_id])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Treasure is limited to a maximum of 6 items<br />
&nbsp;&nbsp;&nbsp;&nbsp;treasures = treasures[0..5]<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining EXP<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in 0...&#36;game_party.actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.actors[i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.cant_get_exp? == false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;last_level = actor.level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor.exp += exp<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.level &gt; last_level<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@status_window.level_up(i)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Beginning of Inserted Code<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtain Reserve Character Exp Percentage<br />
&nbsp;&nbsp;&nbsp;&nbsp;perc = RPGAdvReserve::EXP_PERCENT<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Reserve Characters Obtaining EXP&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;for i in 0...&#36;game_party.reserve_actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor = &#36;game_party.reserve_actors[i]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if actor.cant_get_exp? == false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;actor.exp += exp * perc / 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;#------------------------------------------------------------------------<br />
&nbsp;&nbsp;&nbsp;&nbsp;# * Inserted&nbsp;&nbsp;Code End<br />
&nbsp;&nbsp;&nbsp;&nbsp;#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining gold<br />
&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_gold(gold)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtaining treasure<br />
&nbsp;&nbsp;&nbsp;&nbsp;for item in treasures<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;case item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Item<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_item(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Weapon<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_weapon(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;when RPG::Armor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.gain_armor(item.id, 1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make battle result window<br />
&nbsp;&nbsp;&nbsp;&nbsp;@result_window = Window_BattleResult.new(exp, gold, treasures)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set wait count<br />
&nbsp;&nbsp;&nbsp;&nbsp;@phase5_wait_count = 100<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end<br />
<br />
<br />
<br />
#==============================================================================<br />
# ** Scene_ChangeParty<br />
#------------------------------------------------------------------------------<br />
#&nbsp;&nbsp;This class performs party management processing.<br />
#==============================================================================<br />
<br />
class Scene_ChangeParty<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Object Initialization<br />
&nbsp;&nbsp;#&nbsp;&nbsp;&nbsp;&nbsp; max_size : max size of party<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def initialize(max_size=0)<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Obtain text warning<br />
&nbsp;&nbsp;&nbsp;&nbsp;text = RPGAdvReserve::SIZE_Invalid<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set message and exit If below 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;if max_size &lt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set message and exit if above standard limit of 4<br />
&nbsp;&nbsp;&nbsp;&nbsp;if max_size &gt; 4<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;print(text)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set max size based on index positions (0-3) rather than (1-4)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@max_size = max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def main<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Define party max for Change Party menu (0-3)<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; = @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; = 4 if party_max == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;party_max&nbsp;&nbsp; -= 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window&nbsp;&nbsp; = Window_ChangeMain.new(party_max)<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window = Window_ChangeReserve.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window&nbsp;&nbsp;&nbsp;&nbsp;= Window_PartyChangeInfo.new(@max_size)<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Set window values<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.index&nbsp;&nbsp;&nbsp;&nbsp; = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Clear memorized actors<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actor1 = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Execute transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Main loop<br />
&nbsp;&nbsp;&nbsp;&nbsp;loop do<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update game screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Graphics.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Update input information<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Input.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Frame update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Abort loop if screen is changed<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;scene != self<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;break<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Prepare for transition<br />
&nbsp;&nbsp;&nbsp;&nbsp;Graphics.freeze<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Dispose of windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.dispose<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window.dispose<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Main Processing<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Update windows&nbsp;&nbsp;&nbsp;&nbsp;<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;@info_window.update<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If party window is active: call update_party<br />
&nbsp;&nbsp;&nbsp;&nbsp;return update_party&nbsp;&nbsp;&nbsp;&nbsp; if @party_window.active<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If reserve window is active: call update_reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;return update_reserve&nbsp;&nbsp; if @reserve_window.active<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when updating the party window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_party<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is empty and not permitted to empty<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors.size == 0 &amp;&amp; !RPGAdvReserve::PERMIT_EMPTY<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party is larger than maximum size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val = @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;val = 4 if val == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors.size &gt; val<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Switch to map screen<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;scene = Scene_Map.new<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set party window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place = @party_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if cursor goes beyond party size and no one in that spot<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @max_size &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if place &gt;= @max_size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place].nil?<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If party member exists at cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place] != nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# And if party is required (cannot remove)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.actors[place].required<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there are no reserve party members<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.reserve_actors.size == 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer the actor to the reserve party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve(&#36;game_party.actors[place])<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Refresh both windows<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@party_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If reserve party members exist<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if &#36;game_party.reserve_actors.size &gt; 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make reserve window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = 0<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize party member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor1 = &#36;game_party.actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when updating the reserve window)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_reserve<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If B button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::B)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play cancel SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.cancel_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;# If C button was pressed<br />
&nbsp;&nbsp;&nbsp;&nbsp;if Input.trigger?(Input::C)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Set reserve window cursor position<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;place = @reserve_window.index<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# if cursor goes beyond reserve party size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if place == &#36;game_party.reserve_actors.size<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If no memorized party actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @actor1 == nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play buzzer SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer stored party member to reserves<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_reserve(@actor1)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there is no stored party actor<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;if @actor1 == nil<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize reserve member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = &#36;game_party.reserve_actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Transfer reserve member to party<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.transfer_to_party(@actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;return<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# If there a stored party actor exists<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;else<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Play decision SE<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_system.se_play(&#36;data_system.decision_se)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Memorize reserve member<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;@actor2 = &#36;game_party.reserve_actors[place]<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Swap both party and reserve party members<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&#36;game_party.swap(@actor1, @actor2)<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;&nbsp;&nbsp;end<br />
&nbsp;&nbsp;end<br />
<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;# * Frame Update (when making the party window active)<br />
&nbsp;&nbsp;#--------------------------------------------------------------------------<br />
&nbsp;&nbsp;def update_activate_party_window<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;&nbsp;&nbsp;# Make party window active<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.index&nbsp;&nbsp; = -1<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.active&nbsp;&nbsp;= false<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.active&nbsp;&nbsp;&nbsp;&nbsp;= true<br />
&nbsp;&nbsp;&nbsp;&nbsp;@party_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;@reserve_window.refresh<br />
&nbsp;&nbsp;&nbsp;&nbsp;#<br />
&nbsp;&nbsp;end<br />
<br />
end</code></div></div></div>
		</div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
Place below Scene_Debug and above Main.  It rewrites methods in four Scene_ classes, so it should be high in your list of custom scripts. Be aware it may conflict with the menu, skill, equip and battle treasure systems.<br />
<br />
Detailed instructions are included in the script itself.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
As noted, there are major rewrites.  Be warned.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
RPGAdvocate for the original version.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
There were no terms of use listed at RPG Advocate's site, Phylomortis.com. However, I would think it would be prudent to give him credit for the work.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KustomElemState XP]]></title>
			<link>https://www.save-point.org/thread-13485.html</link>
			<pubDate>Tue, 26 May 2026 03:36:40 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13485.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KustomElemState XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align">The Script is NOT COMPATIBLE With Other Element or State Related Scripts!</div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
It's a very brief one for sure. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /><br />
Alter a given Actor's element or state rate during gameplay! <img src="https://www.save-point.org/images/smilies/ejlol/gamer.gif" alt="Gamer" title="Gamer" class="smilie smilie_183" /> <br />
The script creates or loads the custom ranks based on the current class. <img src="https://www.save-point.org/images/smilies/ejlol/orson.gif" alt="Orson" title="Orson" class="smilie smilie_167" /> <img src="https://www.save-point.org/images/smilies/ejlol/ghim.gif" alt="Ghim" title="Ghim" class="smilie smilie_226" /> <img src="https://www.save-point.org/images/smilies/ejlol/slayne.gif" alt="Slayne" title="Slayne" class="smilie smilie_228" /> <br />
It will never try to alter the Classes database contents! <img src="https://www.save-point.org/images/smilies/ejlol/thumbs.gif" alt="Two Thumbs Up!" title="Two Thumbs Up!" class="smilie smilie_61" /> <br />
<br />
Element / State Efficiency Letter 2 Percentage Conversion Table<br />
<br />
<span style="font-weight: bold;" class="mycode_b">A</span> - 200% (Weak)<br />
<span style="font-weight: bold;" class="mycode_b">B</span> - 150%<br />
<span style="font-weight: bold;" class="mycode_b">C</span> - 100% (Default)<br />
<span style="font-weight: bold;" class="mycode_b">D</span> - 50%<br />
<span style="font-weight: bold;" class="mycode_b">E</span> - 0% (Immune)<br />
<span style="font-weight: bold;" class="mycode_b">F</span> - -100% (Gets Healed?)<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Script Calls</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">STEP 1</span><br />
Get an Actor first! - 2 Methods:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor = &#36;game_party.actors[Index]<br />
actor = &#36;game_actors[ActorID]</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">STEP 2</span><br />
Use any of the following calls.<br />
<br />
Check out the current Index of an Element Rate:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.find_element_rate(ElementID)</code></div></div><br />
Check out the current Effect % of an Element:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.element_effect(ElementID)</code></div></div><br />
Change an Actor's Element Rate!  Rate Indices: 1 through 6<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.custom_element_rank(ElementID, RateIndex)</code></div></div><br />
Change an Actor's State Rate!    Rate Indices: 1 through 6<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.custom_state_rank(StateID, RateIndex)</code></div></div><br />
Move Current Element State 1 Position to the Left<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.prev_element_rate!(ElementID)</code></div></div><br />
Move Current Element State 1 Position to the Right<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.next_element_rate!(ElementID)</code></div></div><br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> USAGE EXAMPLE</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/zfSdFYxM/kustomelemstate-xp001.jpg" loading="lazy"  alt="[Image: kustomelemstate-xp001.jpg]" class="mycode_img" /></div>
</div>
		</div>
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KustomElemState XP * #<br />
#   Scripter : Kyonides<br />
#   2025-05-25<br />
<br />
# * NOT COMPATIBLE With Other Element or State Related Scripts! * #<br />
<br />
# Alter a given Actor's element or state rate during gameplay!<br />
# The script creates / loads the custom ranks based on the current class.<br />
# It will never try to alter the Classes DB contents!<br />
<br />
# * Script Calls * #<br />
<br />
# STEP #1: Get an Actor first! - 2 Methods:<br />
# actor = &#36;game_party.actors[Index]<br />
# actor = &#36;game_actors[ActorID]<br />
<br />
# STEP #2: Use any of the following calls.<br />
# - Check out the current Index of an Element Rate:<br />
# actor.find_element_rate(ElementID)<br />
<br />
# - Check out the current Effect % of an Element:<br />
# actor.element_effect(ElementID)<br />
<br />
# - Change an Actor's Element Rate!  Rate Indices: 1 through 6<br />
# actor.custom_element_rank(ElementID, RateIndex)<br />
<br />
# - Change an Actor's State Rate!    Rate Indices: 1 through 6<br />
# actor.custom_state_rank(StateID, RateIndex)<br />
<br />
# - Move Current Element State 1 Position to the Left<br />
# actor.prev_element_rate!(ElementID)<br />
<br />
# - Move Current Element State 1 Position to the Right<br />
# actor.next_element_rate!(ElementID)<br />
<br />
class Game_Actor<br />
  ER_TABLE = [0,200,150,100,50,0,-100]<br />
  alias :kyon_kust_elem_stt_gm_act_setup :setup<br />
  alias :kyon_kust_elem_stt_gm_act_class_id_set :class_id=<br />
  def setup(actor_id)<br />
    kyon_kust_elem_stt_gm_act_setup(actor_id)<br />
    @element_ranks = {}<br />
    @state_ranks = {}<br />
    custom_element_ranks!<br />
    custom_state_ranks!<br />
  end<br />
<br />
  def custom_element_ranks!<br />
    @element_ranks[@class_id] ||= &#36;data_classes[@class_id].element_ranks.dup<br />
  end<br />
<br />
  def custom_state_ranks!<br />
    @state_ranks[@class_id] ||= &#36;data_classes[@class_id].state_ranks.dup<br />
  end<br />
<br />
  def find_element_rate(elem_id)<br />
    @element_ranks[@class_id][elem_id]<br />
  end<br />
<br />
  def element_effect(elem_id)<br />
    n = find_element_rate(elem_id)<br />
    ER_TABLE[n]<br />
  end<br />
<br />
  def armor_ids<br />
    [@armor1_id, @armor2_id, @armor3_id, @armor4_id]<br />
  end<br />
<br />
  def element_rate(element_id)<br />
    pos = find_element_rate(element_id)<br />
    result = ER_TABLE[pos]<br />
    armor_ids.each do |i|<br />
      armor = &#36;data_armors[i]<br />
      if armor != nil and armor.guard_element_set.include?(element_id)<br />
        result /= 2<br />
      end<br />
    end<br />
    @states.each do |i|<br />
      if &#36;data_states[i].guard_element_set.include?(element_id)<br />
        result /= 2<br />
      end<br />
    end<br />
    return result<br />
  end<br />
<br />
  def state_ranks<br />
    @state_ranks[@class_id]<br />
  end<br />
<br />
  def custom_element_rank(n, value)<br />
    @element_ranks[@class_id][n] = value<br />
  end<br />
<br />
  def custom_state_rank(n, value)<br />
    @state_ranks[@class_id][n] = value<br />
  end<br />
<br />
  def class_id=(class_id)<br />
    class_id_set(class_id)<br />
    custom_element_ranks!<br />
    custom_state_ranks!<br />
  end<br />
<br />
  def change_element_rate(elem_id, value, start)<br />
    pos = find_element_rate(elem_id)<br />
    pos = (pos + value) % 7<br />
    pos = start if pos == 0<br />
    custom_element_rank(elem_id, pos)<br />
    pos<br />
  end<br />
<br />
  def prev_element_rate!(elem_id)<br />
    change_element_rate(elem_id, -1, 6)<br />
  end<br />
<br />
  def next_element_rate!(elem_id)<br />
    change_element_rate(elem_id, 1, 1)<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Mention me in your game credits.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KustomElemState XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align">The Script is NOT COMPATIBLE With Other Element or State Related Scripts!</div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
It's a very brief one for sure. <img src="https://www.save-point.org/images/smilies/ejlol/wink.gif" alt="Winking" title="Winking" class="smilie smilie_33" /><br />
Alter a given Actor's element or state rate during gameplay! <img src="https://www.save-point.org/images/smilies/ejlol/gamer.gif" alt="Gamer" title="Gamer" class="smilie smilie_183" /> <br />
The script creates or loads the custom ranks based on the current class. <img src="https://www.save-point.org/images/smilies/ejlol/orson.gif" alt="Orson" title="Orson" class="smilie smilie_167" /> <img src="https://www.save-point.org/images/smilies/ejlol/ghim.gif" alt="Ghim" title="Ghim" class="smilie smilie_226" /> <img src="https://www.save-point.org/images/smilies/ejlol/slayne.gif" alt="Slayne" title="Slayne" class="smilie smilie_228" /> <br />
It will never try to alter the Classes database contents! <img src="https://www.save-point.org/images/smilies/ejlol/thumbs.gif" alt="Two Thumbs Up!" title="Two Thumbs Up!" class="smilie smilie_61" /> <br />
<br />
Element / State Efficiency Letter 2 Percentage Conversion Table<br />
<br />
<span style="font-weight: bold;" class="mycode_b">A</span> - 200% (Weak)<br />
<span style="font-weight: bold;" class="mycode_b">B</span> - 150%<br />
<span style="font-weight: bold;" class="mycode_b">C</span> - 100% (Default)<br />
<span style="font-weight: bold;" class="mycode_b">D</span> - 50%<br />
<span style="font-weight: bold;" class="mycode_b">E</span> - 0% (Immune)<br />
<span style="font-weight: bold;" class="mycode_b">F</span> - -100% (Gets Healed?)<br />
<br />
<span style="font-weight: bold;" class="mycode_b">Script Calls</span><br />
<br />
<span style="font-weight: bold;" class="mycode_b">STEP 1</span><br />
Get an Actor first! - 2 Methods:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor = &#36;game_party.actors[Index]<br />
actor = &#36;game_actors[ActorID]</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">STEP 2</span><br />
Use any of the following calls.<br />
<br />
Check out the current Index of an Element Rate:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.find_element_rate(ElementID)</code></div></div><br />
Check out the current Effect % of an Element:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.element_effect(ElementID)</code></div></div><br />
Change an Actor's Element Rate!  Rate Indices: 1 through 6<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.custom_element_rank(ElementID, RateIndex)</code></div></div><br />
Change an Actor's State Rate!    Rate Indices: 1 through 6<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.custom_state_rank(StateID, RateIndex)</code></div></div><br />
Move Current Element State 1 Position to the Left<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.prev_element_rate!(ElementID)</code></div></div><br />
Move Current Element State 1 Position to the Right<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>actor.next_element_rate!(ElementID)</code></div></div><br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> USAGE EXAMPLE</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/zfSdFYxM/kustomelemstate-xp001.jpg" loading="lazy"  alt="[Image: kustomelemstate-xp001.jpg]" class="mycode_img" /></div>
</div>
		</div>
<br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KustomElemState XP * #<br />
#   Scripter : Kyonides<br />
#   2025-05-25<br />
<br />
# * NOT COMPATIBLE With Other Element or State Related Scripts! * #<br />
<br />
# Alter a given Actor's element or state rate during gameplay!<br />
# The script creates / loads the custom ranks based on the current class.<br />
# It will never try to alter the Classes DB contents!<br />
<br />
# * Script Calls * #<br />
<br />
# STEP #1: Get an Actor first! - 2 Methods:<br />
# actor = &#36;game_party.actors[Index]<br />
# actor = &#36;game_actors[ActorID]<br />
<br />
# STEP #2: Use any of the following calls.<br />
# - Check out the current Index of an Element Rate:<br />
# actor.find_element_rate(ElementID)<br />
<br />
# - Check out the current Effect % of an Element:<br />
# actor.element_effect(ElementID)<br />
<br />
# - Change an Actor's Element Rate!  Rate Indices: 1 through 6<br />
# actor.custom_element_rank(ElementID, RateIndex)<br />
<br />
# - Change an Actor's State Rate!    Rate Indices: 1 through 6<br />
# actor.custom_state_rank(StateID, RateIndex)<br />
<br />
# - Move Current Element State 1 Position to the Left<br />
# actor.prev_element_rate!(ElementID)<br />
<br />
# - Move Current Element State 1 Position to the Right<br />
# actor.next_element_rate!(ElementID)<br />
<br />
class Game_Actor<br />
  ER_TABLE = [0,200,150,100,50,0,-100]<br />
  alias :kyon_kust_elem_stt_gm_act_setup :setup<br />
  alias :kyon_kust_elem_stt_gm_act_class_id_set :class_id=<br />
  def setup(actor_id)<br />
    kyon_kust_elem_stt_gm_act_setup(actor_id)<br />
    @element_ranks = {}<br />
    @state_ranks = {}<br />
    custom_element_ranks!<br />
    custom_state_ranks!<br />
  end<br />
<br />
  def custom_element_ranks!<br />
    @element_ranks[@class_id] ||= &#36;data_classes[@class_id].element_ranks.dup<br />
  end<br />
<br />
  def custom_state_ranks!<br />
    @state_ranks[@class_id] ||= &#36;data_classes[@class_id].state_ranks.dup<br />
  end<br />
<br />
  def find_element_rate(elem_id)<br />
    @element_ranks[@class_id][elem_id]<br />
  end<br />
<br />
  def element_effect(elem_id)<br />
    n = find_element_rate(elem_id)<br />
    ER_TABLE[n]<br />
  end<br />
<br />
  def armor_ids<br />
    [@armor1_id, @armor2_id, @armor3_id, @armor4_id]<br />
  end<br />
<br />
  def element_rate(element_id)<br />
    pos = find_element_rate(element_id)<br />
    result = ER_TABLE[pos]<br />
    armor_ids.each do |i|<br />
      armor = &#36;data_armors[i]<br />
      if armor != nil and armor.guard_element_set.include?(element_id)<br />
        result /= 2<br />
      end<br />
    end<br />
    @states.each do |i|<br />
      if &#36;data_states[i].guard_element_set.include?(element_id)<br />
        result /= 2<br />
      end<br />
    end<br />
    return result<br />
  end<br />
<br />
  def state_ranks<br />
    @state_ranks[@class_id]<br />
  end<br />
<br />
  def custom_element_rank(n, value)<br />
    @element_ranks[@class_id][n] = value<br />
  end<br />
<br />
  def custom_state_rank(n, value)<br />
    @state_ranks[@class_id][n] = value<br />
  end<br />
<br />
  def class_id=(class_id)<br />
    class_id_set(class_id)<br />
    custom_element_ranks!<br />
    custom_state_ranks!<br />
  end<br />
<br />
  def change_element_rate(elem_id, value, start)<br />
    pos = find_element_rate(elem_id)<br />
    pos = (pos + value) % 7<br />
    pos = start if pos == 0<br />
    custom_element_rank(elem_id, pos)<br />
    pos<br />
  end<br />
<br />
  def prev_element_rate!(elem_id)<br />
    change_element_rate(elem_id, -1, 6)<br />
  end<br />
<br />
  def next_element_rate!(elem_id)<br />
    change_element_rate(elem_id, 1, 1)<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Mention me in your game credits.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Aced Shops]]></title>
			<link>https://www.save-point.org/thread-13480.html</link>
			<pubDate>Sun, 17 May 2026 18:59:31 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13480.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Aced Shops</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.2</span><br />
<span style="font-size: xx-small;" class="mycode_size">Initial development began 5-16-2026</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This script lets one set up shops that may limit interactions. In general it permits these functions:<ul class="mycode_list"><li>Can make a store that only buys from the player or only does sales.<br />
</li>
<li>Can restrict items sold to inddividual stores based on the item IDs<br />
</li>
<li>Can set up a store to have custom prices for certain items<br />
</li>
<li>Can make a virtual Dynamic Shop with limited goods until restocked<br />
</li>
<li>Can have favorable or dissatisfied reactions affect store prices<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: xx-small;" class="mycode_size">I was always a fan of Bethesda Softwork's mercantile price alteration systems</span></span></li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">BONUS:</span> Demo includes the "Advanced Shop Status Window" script by RPG Advocate </li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<a href="https://app.box.com/s/lra7bkjqdctvemnzyz0gmsa4stbfpmmb" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">CLICK HERE</span></a>--  Box.Com link<br />
<span style="font-style: italic;" class="mycode_i">Look for the Download link in the top right of the screen</span><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
On this release, I was barebones on instructions. I will return later with more instructions.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">FAQ</span></span><br />
<br />
This was per a request by Ace_V, said request and development found here:<br />
<a href="https://www.save-point.org/thread-13478-lastpost.html" target="_blank" rel="noopener" class="mycode_url">https://www.save-point.org/thread-13478-lastpost.html</a><br />
<br />
While development began initially with RPG Advocate's Buy Only/Sell-Only script, little of it even remains.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Performs several rewrites throughout the shop system.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit is required.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Aced Shops</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.2</span><br />
<span style="font-size: xx-small;" class="mycode_size">Initial development began 5-16-2026</span></div>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
This script lets one set up shops that may limit interactions. In general it permits these functions:<ul class="mycode_list"><li>Can make a store that only buys from the player or only does sales.<br />
</li>
<li>Can restrict items sold to inddividual stores based on the item IDs<br />
</li>
<li>Can set up a store to have custom prices for certain items<br />
</li>
<li>Can make a virtual Dynamic Shop with limited goods until restocked<br />
</li>
<li>Can have favorable or dissatisfied reactions affect store prices<br />
<span style="font-style: italic;" class="mycode_i"><span style="font-size: xx-small;" class="mycode_size">I was always a fan of Bethesda Softwork's mercantile price alteration systems</span></span></li>
</ul>
<ul class="mycode_list"><li><span style="font-weight: bold;" class="mycode_b">BONUS:</span> Demo includes the "Advanced Shop Status Window" script by RPG Advocate </li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<a href="https://app.box.com/s/lra7bkjqdctvemnzyz0gmsa4stbfpmmb" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">CLICK HERE</span></a>--  Box.Com link<br />
<span style="font-style: italic;" class="mycode_i">Look for the Download link in the top right of the screen</span><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
On this release, I was barebones on instructions. I will return later with more instructions.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">FAQ</span></span><br />
<br />
This was per a request by Ace_V, said request and development found here:<br />
<a href="https://www.save-point.org/thread-13478-lastpost.html" target="_blank" rel="noopener" class="mycode_url">https://www.save-point.org/thread-13478-lastpost.html</a><br />
<br />
While development began initially with RPG Advocate's Buy Only/Sell-Only script, little of it even remains.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
Performs several rewrites throughout the shop system.<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free for use, even in commercial games.  Only due credit is required.]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[KustomPriceShop XP]]></title>
			<link>https://www.save-point.org/thread-13479.html</link>
			<pubDate>Sun, 17 May 2026 07:20:19 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=1471">kyonides</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13479.html</guid>
			<description><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KustomPriceShop XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
This script allows you to open a special shop on a given map that offers:<br />
<ul class="mycode_list"><li>Setting custom (buy or sale) prices for specific items.<br />
</li>
<li>Setting certain goods as highly undesirable, making the party lose friendship points at that shop.<br />
</li>
<li>Rewarding loyal customers with free gifts if they buy a given amount of items or weapons or armors.<br />
</li>
<li>Creating buy-only or sell-only shops.<br />
</li>
</ul>
<br />
To keep it separate from normal shops, set the shop's ID via a game variable.<br />
<br />
You can change the maximum number of units per item allowed in your game.<br />
<br />
Leaving the shop without doing anything will decrease the shop's friendship points by 1 (default value).<br />
Purchases and sales will increase those points in no time! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /> <br />
<br />
It also lets you to set a backdrop as well instead of the current map.<br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> SCREENSHOTS</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/d04B4wFx/kustompriceshop-xp001.jpg" loading="lazy"  alt="[Image: kustompriceshop-xp001.jpg]" class="mycode_img" /></div>
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/252w2rYt/kustompriceshop-xp002.jpg" loading="lazy"  alt="[Image: kustompriceshop-xp002.jpg]" class="mycode_img" /></div>
</div>
		</div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Optional Script Calls For The Active Shop</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">NOTE:</span> ItemID stands for an actual positive number, starting from 1 onwards.<br />
<br />
Add Items with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_items(ItemID1 =&gt; Price1, etc.)<br />
sell_price_items(ItemID1 =&gt; Price1, etc.)</code></div></div><br />
Add Weapons with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
sell_price_weapons(WeaponID1 =&gt; Price1, etc.)</code></div></div><br />
Add Armors with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
sell_price_armors(ArmorID1 =&gt; Price1, etc.)</code></div></div><br />
Change Custom Price Shop's Friendship Points - Number stands for any number, either positive or negative.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friend_points(Number)</code></div></div><br />
Set Minimum Friendship Level for Certain Items, Weapons or Armors - Types: 0 - Item, 1 - Weapon, 2 - Armor<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friendship_min(Mininum, Type, ItemID1, etc.)</code></div></div><br />
Set the Lowest Level The Friendship Points can reach: Number should be equal to 0 or less.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friend_floor(Number)</code></div></div><br />
Change Custom Price Shop's No Transaction Penalty - Number stands for 0 or any positive number. Default Value: 1.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_set_no_action_penalty(Number)</code></div></div><br />
Reward Your Loyal Customers with Items:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_items(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Reward Your Loyal Customers with Weapons:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_weapons(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Reward Your Loyal Customers with Armors:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_armors(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Punish the Player for Selling the "Wrong" Items: LostPoints stands for 1 or above.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_items(ItemID1 =&gt; LostPoints, etc.)</code></div></div><br />
Punish the Player for Selling the "Wrong" Weapons:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_weapons(WeaponID1 =&gt; LostPoints, etc.)</code></div></div><br />
Punish the Player for Selling the "Wrong" Armors:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_armors(ArmorID1 =&gt; LostPoints, etc.)</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KustomPriceShop XP * #<br />
#   Scripter : Kyonides<br />
#   v1.0.0 - 2026-05-23<br />
<br />
# Create a special shop that offers:<br />
# - Setting custom prices for specific items.<br />
# - Setting certain goods as highly undesirable, making the party lose<br />
#   friendship points at that shop.<br />
# - Rewarding loyal customers with free gifts if they buy a given amount of<br />
#   items or weapons or armors.<br />
# - Creating purchase-only or sell-only shops.<br />
<br />
# To keep it separate from normal shops, set the shop's ID via a game variable.<br />
# You can change the maximum number of units per item allowed in your game.<br />
# It also allows you to set a backdrop as well instead of the current map.<br />
# Leaving the shop without doing anything will decrease the shop's friendship<br />
# points by 1 (default value).<br />
<br />
# * Optional Script Calls For The Active Shop * #<br />
<br />
# - Add Items with Custom Prices:<br />
# buy_price_items(ItemID1 =&gt; Price1, etc.)<br />
# sell_price_items(ItemID1 =&gt; Price1, etc.)<br />
<br />
# - Add Weapons with Custom Prices:<br />
# buy_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
# sell_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
<br />
# - Add Armors with Custom Prices:<br />
# buy_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
# sell_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
<br />
# - Change Custom Price Shop's Friendship Points:<br />
#   Number stands for any number, either positive or negative.<br />
# price_shop_friend_points(Number)<br />
<br />
# - Set Minimum Friendship Level for Certain Items, Weapons or Armors:<br />
#   Types: 0 - Item, 1 - Weapon, 2 - Armor<br />
# price_shop_friendship_min(Mininum, Type, ItemID1, etc.)<br />
<br />
# - Set the Lowest Level The Friendship Points can reach: 0 or less.<br />
# price_shop_friend_floor(Number)<br />
<br />
# - Change Custom Price Shop's No Transaction Penalty:<br />
#   Number stands for 0 or any positive number. Default Value: 1.<br />
# price_shop_set_no_action_penalty(Number)<br />
<br />
# - Reward Your Loyal Customers with Items:<br />
# buy_gifts_items(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Reward Your Loyal Customers with Weapons:<br />
# buy_gifts_weapons(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Reward Your Loyal Customers with Armors:<br />
# buy_gifts_armors(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Punish the Player for Selling the Wrong Items:<br />
# sell_price_wrong_items(ItemID1 =&gt; LostPoints, etc.)<br />
<br />
# - Punish the Player for Selling the Wrong Weapons:<br />
# sell_price_wrong_weapons(WeaponID1 =&gt; LostPoints, etc.)<br />
<br />
# - Punish the Player for Selling the Wrong Armors:<br />
# sell_price_wrong_armors(ArmorID1 =&gt; LostPoints, etc.)<br />
<br />
module KustomPrice<br />
  ITEM_MAX = 99<br />
  BUY_ONLY_SWITCH  = 8<br />
  SELL_ONLY_SWITCH = 9<br />
  SHOP_ID_VAR = 10<br />
  DEFAULT_BACKDROP = "012-PortTown02"<br />
  FRIENDSHIP_LEVEL = "Friendship Level: %s"<br />
  SPECIAL_REWARDS  = "Special Rewards"<br />
<br />
  class Shop<br />
    class Gifts<br />
      def initialize(item_min, item_id, n)<br />
        @item_min = item_min<br />
        @item_id = item_id<br />
        @amount = n<br />
      end<br />
      attr_reader :item_min, :item_id, :amount<br />
    end<br />
<br />
    def initialize<br />
      @friendship = 0<br />
      @friendship_floor = 0<br />
      @no_action_penalty = 1<br />
      @friendship_min = {}<br />
      @buy_prices = {}<br />
      @sell_prices = {}<br />
      @buy_item_max = {}<br />
      @sell_item_max = {}<br />
      @buy_gifts = {}<br />
      @sell_wrong_goods = {}<br />
      @friendship_min.default = {}<br />
      @buy_prices.default = {}<br />
      @sell_prices.default = {}<br />
      @buy_gifts.default = {}<br />
      @sell_wrong_goods.default = {}<br />
      @buy_item_max.default = ITEM_MAX<br />
      @sell_item_max.default = ITEM_MAX<br />
    end<br />
<br />
    def friendship=(n)<br />
      @friendship = [@friendship + n, @friendship_floor].max<br />
    end<br />
<br />
    def no_action_penalty!<br />
      self.friendship -= @no_action_penalty<br />
    end<br />
<br />
    def frienship_min(mininum, type, *items)<br />
      fmin = @friendship_min[type]<br />
      items.flatten.each {|n| fmin[n] = mininum }<br />
      mininum<br />
    end<br />
<br />
    def set_buy_prices(type, data={})<br />
      @buy_prices[type].merge!(data)<br />
    end<br />
<br />
    def set_sell_prices(type, data={})<br />
      @sell_prices[type].merge!(data)<br />
    end<br />
<br />
    def set_buy_gifts(type, parent_id, item_min, item_id, n)<br />
      @buy_gifts[type][parent_id] = Gifts.new(item_min, item_id, n)<br />
    end<br />
<br />
    def sell_wrong_goods(type, data={})<br />
      @sell_wrong_goods[type].merge!(data)<br />
    end<br />
    attr_reader :friendship, :friendship_floor, :friendship_min<br />
    attr_reader :buy_prices, :sell_prices, :buy_gifts<br />
    attr_reader :buy_item_max, :sell_item_max, :sell_wrong_goods<br />
    attr_accessor :goods, :no_action_penalty<br />
  end<br />
end<br />
<br />
class Game_System<br />
  alias :kyon_kp_shop_gm_sys_init :initialize<br />
  def initialize<br />
    kyon_kp_shop_gm_sys_init<br />
    reset_price_shop_id!<br />
    @custom_price_shops = {}<br />
  end<br />
<br />
  def reset_price_shop_id!<br />
    @price_shop_id = 0<br />
  end<br />
<br />
  def init_price_shop(shop_id)<br />
    @price_shop_id = shop_id<br />
    @custom_price_shops[shop_id] ||= KustomPrice::Shop.new<br />
  end<br />
<br />
  def setup_price_shop(shop_id, new_goods)<br />
    shop = @custom_price_shops[shop_id]<br />
    shop.goods = new_goods<br />
  end<br />
<br />
  def this_price_shop<br />
    @custom_price_shops[@price_shop_id]<br />
  end<br />
  attr_reader :custom_price_shops<br />
end<br />
<br />
class Game_Party<br />
  def bag_items<br />
    @items<br />
  end<br />
<br />
  def bag_weapons<br />
    @weapons<br />
  end<br />
<br />
  def bag_armors<br />
    @armors<br />
  end<br />
<br />
  def compact_bag_items!<br />
    @items.delete_if {|k,v| v == 0 }<br />
    @weapons.delete_if {|k,v| v == 0 }<br />
    @armors.delete_if {|k,v| v == 0 }<br />
  end<br />
end<br />
<br />
class Window_ShopCommand<br />
  def reset_disabled_items<br />
    @disabled = []<br />
  end<br />
<br />
  def disable_current_item?<br />
    @disabled[@index]<br />
  end<br />
end<br />
<br />
module KustomPrice<br />
  module AddMethods<br />
    def item<br />
      @data[@index] || @no_item<br />
    end<br />
<br />
    def price<br />
      @prices[@index] || 0<br />
    end<br />
<br />
    def type<br />
      @types[@index] || 0<br />
    end<br />
<br />
    def get_price(n, item_id, price)<br />
      case @types[n]<br />
      when 0<br />
        @item_prices[item_id] || price<br />
      when 1<br />
        @weapon_prices[item_id] || price<br />
      when 2<br />
        @armor_prices[item_id] || price<br />
      end<br />
    end<br />
  end<br />
<br />
class ShopBuyWindow &lt; Window_Selectable<br />
  include AddMethods<br />
  attr_accessor :shop_goods<br />
  def initialize(shop, shop_goods)<br />
    w = 368<br />
    @tw = w - 64<br />
    super(0, 288, w, 192)<br />
    sp = shop.buy_prices<br />
    @item_prices   = sp[0]<br />
    @weapon_prices = sp[1]<br />
    @armor_prices  = sp[2]<br />
    @shop_goods = shop_goods.dup<br />
    @no_item = RPG::Item.new<br />
    @transparent = Color.new(0, 0, 0, 0)<br />
    @symbol_color = Color.new(255, 255, 80)<br />
    @symbol = &#36;data_system.words.gold<br />
    refresh<br />
    self.index = 0<br />
  end<br />
<br />
  def item_name<br />
    self.item.name<br />
  end<br />
<br />
  def set_goods(goods_item)<br />
    type, goods_id = goods_item<br />
    case type<br />
    when 0<br />
      [type, &#36;data_items[goods_id]]<br />
    when 1<br />
      [type, &#36;data_weapons[goods_id]]<br />
    when 2<br />
      [type, &#36;data_armors[goods_id]]<br />
    end<br />
  end<br />
<br />
  def refresh<br />
    if self.contents != nil<br />
      self.contents.dispose<br />
      self.contents = nil<br />
    end<br />
    @types = []<br />
    @data = []<br />
    @prices = []<br />
    for goods_item in @shop_goods<br />
      type, item = set_goods(goods_item)<br />
      next unless item<br />
      n = @types.size<br />
      @types &lt;&lt; type<br />
      @data &lt;&lt; item<br />
      @prices &lt;&lt; get_price(n, item.id, item.price)<br />
    end<br />
    draw_items<br />
  end<br />
<br />
  def draw_items<br />
    @item_max = @data.size<br />
    self.contents = Bitmap.new(width - 32, row_max * 32) if @item_max &gt; 0<br />
    @item_max.times {|i| draw_item(i) }<br />
  end<br />
<br />
  def clear_line(rx, ry)<br />
    rect = Rect.new(rx, ry, self.width - 32, 32)<br />
    self.contents.fill_rect(rect, @transparent)<br />
  end<br />
<br />
  def draw_item(n)<br />
    item = @data[n]<br />
    font = self.contents.font<br />
    price = @prices[n]<br />
    if &#36;game_party.gold &gt;= price<br />
      font.color = normal_color<br />
      alpha = 255<br />
    else<br />
      font.color = disabled_color<br />
      alpha = 128<br />
    end<br />
    ry = n * 32<br />
    clear_line(4, ry)<br />
    bitmap = RPG::Cache.icon(item.icon_name)<br />
    self.contents.blt(28, ry + 4, bitmap, Rect.new(0, 0, 24, 24), alpha)<br />
    self.contents.draw_text(56, ry, @tw - 100, 32, item.name)<br />
    self.contents.draw_text(@tw - 92, ry, 100, 32, price.to_s, 2)<br />
    @symbol_color.alpha = alpha<br />
    font.color = @symbol_color<br />
    self.contents.draw_text(@tw, ry, 24, 32, @symbol, 2)<br />
  end<br />
<br />
  def update_help<br />
    @help_window.set_text(self.item.description)<br />
  end<br />
<br />
  def delete_item<br />
    @shop_goods.delete(@index)<br />
    item = @data.delete(@index)<br />
    self.contents.dispose if self.contents != nil<br />
    self.contents = nil<br />
    draw_items<br />
  end<br />
<br />
  def disable_item(n)<br />
    draw_item(n, disabled_color)<br />
    @disabled[n] = true<br />
  end<br />
end<br />
<br />
class ShopSellWindow &lt; Window_Selectable<br />
  include AddMethods<br />
  def initialize(shop)<br />
    super(0, 128, 640, 352)<br />
    @column_max = 2<br />
    @no_item = RPG::Item.new<br />
    sp = shop.sell_prices<br />
    @item_prices   = sp[0]<br />
    @weapon_prices = sp[1]<br />
    @armor_prices  = sp[2]<br />
    refresh<br />
    self.index = 0<br />
  end<br />
<br />
  def refresh<br />
    if self.contents != nil<br />
      self.contents.dispose<br />
      self.contents = nil<br />
    end<br />
    @types = []<br />
    @data = []<br />
    @prices = []<br />
    n = 0<br />
    &#36;game_party.bag_items.sort.each do |k,v|<br />
      next if &#36;game_party.item_number(k) == 0<br />
      @types &lt;&lt; 0<br />
      @data &lt;&lt; obj = &#36;data_items[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    &#36;game_party.bag_weapons.sort.each do |k,v|<br />
      next if &#36;game_party.weapon_number(i) == 0<br />
      @types &lt;&lt; 1<br />
      @data &lt;&lt; obj = &#36;data_weapons[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    &#36;game_party.bag_armors.sort.each do |k,v|<br />
      next if &#36;game_party.armor_number(i) == 0<br />
      @types &lt;&lt; 2<br />
      @data &lt;&lt; obj = &#36;data_armors[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    @item_max = @data.size<br />
    return if @item_max == 0<br />
    self.contents = Bitmap.new(width - 32, row_max * 32)<br />
    @item_max.times {|n| draw_item(n) }<br />
  end<br />
<br />
  def draw_item(n)<br />
    item = @data[n]<br />
    case item<br />
    when RPG::Item<br />
      number = &#36;game_party.item_number(item.id)<br />
    when RPG::Weapon<br />
      number = &#36;game_party.weapon_number(item.id)<br />
    when RPG::Armor<br />
      number = &#36;game_party.armor_number(item.id)<br />
    end<br />
    price = @prices[n]<br />
    if price &gt; 0<br />
      self.contents.font.color = normal_color<br />
    else<br />
      self.contents.font.color = disabled_color<br />
    end<br />
    x = 4 + n % 2 * (288 + 32)<br />
    y = n / 2 * 32<br />
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)<br />
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))<br />
    bitmap = RPG::Cache.icon(item.icon_name)<br />
    opacity = self.contents.font.color == normal_color ? 255 : 128<br />
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)<br />
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)<br />
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)<br />
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)<br />
  end<br />
<br />
  def update_help<br />
    @help_window.set_text(self.item.description)<br />
  end<br />
end<br />
<br />
class ShopGiftWindow &lt; Window_Selectable<br />
  def initialize<br />
    super(160, 144, 320, 128)<br />
    @w = width - 32<br />
    @h = height - 32<br />
    @types = []<br />
    @gifts = []<br />
    @amounts = []<br />
    @pages = 0<br />
    @index = 0<br />
  end<br />
<br />
  def set_gifts(list)<br />
    list.each do |type, gift, n|<br />
      @types &lt;&lt; type<br />
      @gifts &lt;&lt; gift<br />
      @amounts &lt;&lt; n<br />
    end<br />
    @pages = list.size<br />
    refresh<br />
  end<br />
<br />
  def change_page(n)<br />
    return if @pages == 1<br />
    @index = (@index + n) % @pages<br />
    refresh<br />
  end<br />
<br />
  def refresh<br />
    page = @index + 1<br />
    label = "Page " + page.to_s + "/" + @pages.to_s<br />
    n = @amounts[@index]<br />
    b = Bitmap.new(@w, @h)<br />
    font = b.font<br />
    font.color = system_color<br />
    b.draw_text(0, 0, @w, 32, SPECIAL_REWARDS, 1)<br />
    good = get_good<br />
    font.color = normal_color<br />
    b.draw_text(0, 32, @w, 32, good.name)<br />
    b.draw_text(0, 32, @w, 32, n.to_s, 2)<br />
    b.draw_text(0, 64, @w, 32, label, 2)<br />
    self.contents = b<br />
  end<br />
<br />
  def get_good<br />
    item_id = @gifts[@index]<br />
    case @types[@index]<br />
    when 0<br />
      return &#36;data_items[item_id]<br />
    when 1<br />
      return &#36;data_weapons[item_id]<br />
    when 2<br />
      return &#36;data_armors[item_id]<br />
    end<br />
  end<br />
end<br />
<br />
end<br />
<br />
class Interpreter<br />
  alias :kyon_kp_shop_int_chng_vars :command_122<br />
  def command_122<br />
    kyon_kp_shop_int_chng_vars<br />
    var_id = @parameters[0]<br />
    return unless KustomPrice::SHOP_ID_VAR == var_id<br />
    var_id = @parameters[4]<br />
    @price_shop = &#36;game_system.init_price_shop(var_id)<br />
  end<br />
<br />
  def price_shop_friend_points(n)<br />
    @price_shop.friendship += n<br />
  end<br />
<br />
  def price_shop_friend_floor(n)<br />
    @price_shop.friendship_floor = n<br />
  end<br />
<br />
  def price_shop_friendship_min(min, type, *items)<br />
    @price_shop.frienship_min(min, type, *items)<br />
  end<br />
<br />
  def price_shop_set_no_action_penalty(n)<br />
    @price_shop.no_action_penalty = n<br />
  end<br />
<br />
  def buy_price_items(data={})<br />
    @price_shop.set_buy_prices(0, data)<br />
  end<br />
<br />
  def buy_price_weapons(data={})<br />
    @price_shop.set_buy_prices(1, data)<br />
  end<br />
<br />
  def buy_price_armors(data={})<br />
    @price_shop.set_buy_prices(2, data)<br />
  end<br />
<br />
  def sell_price_items(data={})<br />
    @price_shop.set_sell_prices(0, data)<br />
  end<br />
<br />
  def sell_price_weapons(data={})<br />
    @price_shop.set_sell_prices(1, data)<br />
  end<br />
<br />
  def sell_price_armors(data={})<br />
    @price_shop.set_sell_prices(2, data)<br />
  end<br />
<br />
  def buy_gifts_items(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(0, item_id, item_min, gift_item_id, n)<br />
  end<br />
<br />
  def buy_gifts_weapons(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(1, item_id, item_min, gift_item_id, n)<br />
  end<br />
<br />
  def buy_gifts_armors(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(2, item_id, item_min, gift_item_id, n)<br />
  end<br />
  <br />
  def sell_price_wrong_items(data={})<br />
    @price_shop.sell_wrong_goods(0, data)<br />
  end<br />
<br />
  def sell_price_wrong_weapons(data={})<br />
    @price_shop.sell_wrong_goods(1, data)<br />
  end<br />
<br />
  def sell_price_wrong_armors(data={})<br />
    @price_shop.sell_wrong_goods(2, data)<br />
  end<br />
end<br />
<br />
class Scene_Map<br />
  def call_shop<br />
    &#36;game_temp.shop_calling = false<br />
    &#36;game_player.straighten<br />
    shop_var = KustomPrice::SHOP_ID_VAR<br />
    if &#36;game_variables[shop_var] != 0<br />
      &#36;scene = PriceShopScene.new<br />
    else<br />
      &#36;scene = Scene_Shop.new<br />
    end<br />
  end<br />
end<br />
<br />
class PriceShopScene &lt; Scene_Shop<br />
  include KustomPrice<br />
  def find_shop_id<br />
    &#36;game_variables[SHOP_ID_VAR]<br />
  end<br />
<br />
  def main<br />
    prepare_goods<br />
    make_backdrop<br />
    make_windows<br />
    Graphics.transition<br />
    loop do<br />
      Graphics.update<br />
      Input.update<br />
      update<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    Graphics.freeze<br />
    dispose_windows<br />
    reset_price_shop<br />
  end<br />
<br />
  def prepare_goods<br />
    &#36;game_party.compact_bag_items!<br />
    @transactions = 0<br />
    @shop_id = find_shop_id<br />
    @shop = &#36;game_system.this_price_shop<br />
    @fp = @shop.friendship<br />
    @fp_min = @shop.friendship_min<br />
    @goods = @shop.goods || &#36;game_temp.shop_goods<br />
    setup_friendly_goods<br />
  end<br />
<br />
  def setup_friendly_goods<br />
    @gifts = []<br />
    @shop_goods = []<br />
    @goods.each do |type, obj_id|<br />
      group = @fp_min[type]<br />
      level = group[obj_id] || 0<br />
      @shop_goods &lt;&lt; [type, obj_id] if level == 0 or level &lt;= @fp<br />
    end<br />
    @exclude_goods = @shop_goods.size != @goods.size<br />
  end<br />
<br />
  def make_backdrop<br />
    @backdrop = Sprite.new<br />
    @backdrop.bitmap = RPG::Cache.battleback(DEFAULT_BACKDROP)<br />
  end<br />
<br />
  def make_windows<br />
    @help_window = Window_Help.new<br />
    show_friendship_level<br />
    @command_window = Window_ShopCommand.new<br />
    @command_window.reset_disabled_items<br />
    @command_window.disable_item(0) if &#36;game_switches[SELL_ONLY_SWITCH]<br />
    @command_window.disable_item(1) if &#36;game_switches[BUY_ONLY_SWITCH]<br />
    @gold_window = Window_Gold.new<br />
    @gold_window.x = 480<br />
    @gold_window.y = 64<br />
    @dummy_window = Window_Base.new(0, 288, 640, 192)<br />
    @buy_window = ShopBuyWindow.new(@shop, @shop_goods)<br />
    @buy_window.active = false<br />
    @buy_window.visible = false<br />
    @buy_window.help_window = @help_window<br />
    @sell_window = ShopSellWindow.new(@shop)<br />
    @sell_window.active = false<br />
    @sell_window.visible = false<br />
    @sell_window.help_window = @help_window<br />
    @number_window = Window_ShopNumber.new<br />
    @number_window.active = false<br />
    @number_window.visible = false<br />
    @status_window = Window_ShopStatus.new<br />
    @status_window.visible = false<br />
    @gift_window = ShopGiftWindow.new<br />
    @gift_window.visible = false<br />
  end<br />
<br />
  def show_friendship_level<br />
    points = @shop.friendship.to_s<br />
    points = sprintf(FRIENDSHIP_LEVEL, points)<br />
    @help_window.set_text(points)<br />
  end<br />
<br />
  def update<br />
    if @show_gifts<br />
      update_show_gifts<br />
      return<br />
    end<br />
    super<br />
  end<br />
<br />
  def update_show_gifts<br />
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      &#36;scene = Scene_Map.new<br />
      return @show_gifts = nil<br />
    elsif Input.trigger?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @gift_window.change_page(-1)<br />
      return<br />
    elsif Input.trigger?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @gift_window.change_page(1)<br />
    end<br />
  end<br />
<br />
  def update_command<br />
    if Input.trigger?(Input::B)<br />
      if @get_gifts<br />
        &#36;game_system.se_play(&#36;data_system.shop_se)<br />
        @command_window.index = -1<br />
        @gift_window.set_gifts(@gifts)<br />
        @gift_window.visible = true<br />
        Graphics.screenshot<br />
        @get_gifts = nil<br />
        return @show_gifts = true<br />
      else<br />
        &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
        &#36;scene = Scene_Map.new<br />
      end<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      if @command_window.disable_current_item?<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      case @command_window.index<br />
      when 0<br />
        open_purchase<br />
      when 1<br />
        open_sale<br />
      when 2<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        &#36;scene = Scene_Map.new<br />
      end<br />
    end<br />
  end<br />
<br />
  def open_purchase<br />
    &#36;game_system.se_play(&#36;data_system.decision_se)<br />
    @command_window.active = false<br />
    @dummy_window.visible = false<br />
    @buy_window.active = true<br />
    @buy_window.visible = true<br />
    @buy_window.refresh<br />
    @status_window.visible = true<br />
  end<br />
<br />
  def open_sale<br />
    &#36;game_system.se_play(&#36;data_system.decision_se)<br />
    @command_window.active = false<br />
    @dummy_window.visible = false<br />
    @sell_window.active = true<br />
    @sell_window.visible = true<br />
    @sell_window.refresh<br />
  end<br />
<br />
  def update_buy<br />
    @status_window.item = @buy_window.item<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @command_window.active = true<br />
      @dummy_window.visible = true<br />
      @buy_window.active = false<br />
      @buy_window.visible = false<br />
      @status_window.visible = false<br />
      @status_window.item = nil<br />
      show_friendship_level<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      @item = @buy_window.item<br />
      price = @buy_window.price<br />
      if @item == nil or &#36;game_party.gold &lt; price<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      case @item<br />
      when RPG::Item<br />
        number = &#36;game_party.item_number(@item.id)<br />
      when RPG::Weapon<br />
        number = &#36;game_party.weapon_number(@item.id)<br />
      when RPG::Armor<br />
        number = &#36;game_party.armor_number(@item.id)<br />
      end<br />
      if ITEM_MAX == number<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      &#36;game_system.se_play(&#36;data_system.decision_se)<br />
      max = price == 0 ? ITEM_MAX : &#36;game_party.gold / price<br />
      max = [max, ITEM_MAX - number].min<br />
      @buy_window.active = false<br />
      @buy_window.visible = false<br />
      @number_window.set(@item, max, price)<br />
      @number_window.active = true<br />
      @number_window.visible = true<br />
    end<br />
  end<br />
<br />
  def update_sell<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @command_window.active = true<br />
      @dummy_window.visible = true<br />
      @sell_window.active = false<br />
      @sell_window.visible = false<br />
      @status_window.item = nil<br />
      show_friendship_level<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      @item = @sell_window.item<br />
      @status_window.item = @item<br />
      price = @sell_window.price<br />
      if @item == nil or price == 0<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      &#36;game_system.se_play(&#36;data_system.decision_se)<br />
      case @item<br />
      when RPG::Item<br />
        number = &#36;game_party.item_number(@item.id)<br />
      when RPG::Weapon<br />
        number = &#36;game_party.weapon_number(@item.id)<br />
      when RPG::Armor<br />
        number = &#36;game_party.armor_number(@item.id)<br />
      end<br />
      total = number<br />
      @sell_window.active = false<br />
      @sell_window.visible = false<br />
      @number_window.set(@item, total, price)<br />
      @number_window.active = true<br />
      @number_window.visible = true<br />
      @status_window.visible = true<br />
    end<br />
  end<br />
<br />
  def update_number<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @number_window.active = false<br />
      @number_window.visible = false<br />
      case @command_window.index<br />
      when 0  # buy<br />
        @buy_window.active = true<br />
        @buy_window.visible = true<br />
      when 1  # sell<br />
        @sell_window.active = true<br />
        @sell_window.visible = true<br />
        @status_window.visible = false<br />
      end<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      &#36;game_system.se_play(&#36;data_system.shop_se)<br />
      @number_window.active = false<br />
      @number_window.visible = false<br />
      item_id = @item.id<br />
      n = @number_window.number<br />
      @transactions += n<br />
      case @command_window.index<br />
      when 0  # buy<br />
        update_number_buy(item_id, n)<br />
        return<br />
      when 1  # sell<br />
        type = @sell_window.type<br />
        lost_points = @shop.sell_wrong_goods[type][item_id] || 0<br />
        if lost_points &gt; 0<br />
          @shop.friendship -= lost_points * n<br />
        else<br />
          @shop.friendship += n<br />
        end<br />
        price = @sell_window.price<br />
        &#36;game_party.gain_gold(n * price)<br />
        case @item<br />
        when RPG::Item<br />
          &#36;game_party.lose_item(item_id, n)<br />
        when RPG::Weapon<br />
          &#36;game_party.lose_weapon(item_id, n)<br />
        when RPG::Armor<br />
          &#36;game_party.lose_armor(item_id, n)<br />
        end<br />
        @gold_window.refresh<br />
        @sell_window.refresh<br />
        @status_window.refresh<br />
        @sell_window.active = true<br />
        @sell_window.visible = true<br />
        @status_window.visible = false<br />
      end<br />
    end<br />
  end<br />
<br />
  def update_number_buy(item_id, n)<br />
    @shop.friendship += n<br />
    price = @buy_window.price<br />
    &#36;game_party.lose_gold(n * price)<br />
    case @item<br />
    when RPG::Item<br />
      type = 0<br />
      &#36;game_party.gain_item(item_id, n)<br />
    when RPG::Weapon<br />
      type = 1<br />
      &#36;game_party.gain_weapon(item_id, n)<br />
    when RPG::Armor<br />
      type = 2<br />
      &#36;game_party.gain_armor(item_id, n)<br />
    end<br />
    @gold_window.refresh<br />
    if @shop.friendship != @fp<br />
      @fp = @shop.friendship<br />
      setup_friendly_goods<br />
      @buy_window.shop_goods = @shop_goods<br />
    end<br />
    @buy_window.refresh<br />
    @status_window.refresh<br />
    @buy_window.active = true<br />
    @buy_window.visible = true<br />
    gifts_list = @shop.buy_gifts[type]<br />
    gift = gifts_list[item_id]<br />
    if gift and gift.item_min &lt;= n<br />
      item_id = gift.item_id<br />
      total = n / gift.item_min * gift.amount<br />
      case type<br />
      when 0<br />
        &#36;game_party.gain_item(item_id, total)<br />
      when 1<br />
        &#36;game_party.gain_weapon(item_id, total)<br />
      when 2<br />
        &#36;game_party.gain_armor(item_id, total)<br />
      end<br />
      @gifts &lt;&lt; [type, item_id, total]<br />
      @get_gifts = true<br />
    end<br />
  end<br />
<br />
  def dispose_windows<br />
    @backdrop.bitmap.dispose<br />
    @backdrop.dispose<br />
    @help_window.dispose<br />
    @command_window.dispose<br />
    @gold_window.dispose<br />
    @dummy_window.dispose<br />
    @buy_window.dispose<br />
    @sell_window.dispose<br />
    @number_window.dispose<br />
    @status_window.dispose<br />
    @gift_window.dispose<br />
  end<br />
<br />
  def reset_price_shop<br />
    &#36;game_variables[SHOP_ID_VAR] = 0<br />
    &#36;game_switches[BUY_ONLY_SWITCH] = false<br />
    &#36;game_switches[SELL_ONLY_SWITCH] = false<br />
    &#36;game_party.compact_bag_items!<br />
    @shop.no_action_penalty! if @transactions == 0<br />
    list = @buy_window.shop_goods<br />
    if !@exclude_goods and list.size != @shop_goods.size<br />
      &#36;game_system.setup_price_shop(@shop_id, list)<br />
    end<br />
    &#36;game_system.reset_price_shop_id!<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Mention me in your game credits.<br />
You may also add the forum's name and URL there.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></description>
			<content:encoded><![CDATA[<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: large;" class="mycode_size">KustomPriceShop XP</span></span></div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">by Kyonides</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">Introduction</span><br />
<br />
This script allows you to open a special shop on a given map that offers:<br />
<ul class="mycode_list"><li>Setting custom (buy or sale) prices for specific items.<br />
</li>
<li>Setting certain goods as highly undesirable, making the party lose friendship points at that shop.<br />
</li>
<li>Rewarding loyal customers with free gifts if they buy a given amount of items or weapons or armors.<br />
</li>
<li>Creating buy-only or sell-only shops.<br />
</li>
</ul>
<br />
To keep it separate from normal shops, set the shop's ID via a game variable.<br />
<br />
You can change the maximum number of units per item allowed in your game.<br />
<br />
Leaving the shop without doing anything will decrease the shop's friendship points by 1 (default value).<br />
Purchases and sales will increase those points in no time! <img src="https://www.save-point.org/images/smilies/ejlol/shocked.gif" alt="Shocked" title="Shocked" class="smilie smilie_22" /> <br />
<br />
It also lets you to set a backdrop as well instead of the current map.<br />
<br />
<div class="tborder">
  			<div class="thead" style="padding:4px; margin:1px;"><input type="button" class="button" value="+" style="font-family:Monospace; padding:0px" onclick="if (this.parentNode.parentNode.getElementsByTagName('div')[1].style.display=='none'){ this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='';this.value='-';} else {this.parentNode.parentNode.getElementsByTagName('div')[1].style.display='none';this.value='+';}"/> SCREENSHOTS</div>
  			<div class="trow2" style="display:none; padding:4px; margin:1px;">
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/d04B4wFx/kustompriceshop-xp001.jpg" loading="lazy"  alt="[Image: kustompriceshop-xp001.jpg]" class="mycode_img" /></div>
<div style="text-align: center;" class="mycode_align"><img src="https://i.postimg.cc/252w2rYt/kustompriceshop-xp002.jpg" loading="lazy"  alt="[Image: kustompriceshop-xp002.jpg]" class="mycode_img" /></div>
</div>
		</div>
<br />
<div style="text-align: center;" class="mycode_align"><span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">Optional Script Calls For The Active Shop</span></span></div>
<br />
<span style="font-weight: bold;" class="mycode_b">NOTE:</span> ItemID stands for an actual positive number, starting from 1 onwards.<br />
<br />
Add Items with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_items(ItemID1 =&gt; Price1, etc.)<br />
sell_price_items(ItemID1 =&gt; Price1, etc.)</code></div></div><br />
Add Weapons with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
sell_price_weapons(WeaponID1 =&gt; Price1, etc.)</code></div></div><br />
Add Armors with Custom Prices:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
sell_price_armors(ArmorID1 =&gt; Price1, etc.)</code></div></div><br />
Change Custom Price Shop's Friendship Points - Number stands for any number, either positive or negative.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friend_points(Number)</code></div></div><br />
Set Minimum Friendship Level for Certain Items, Weapons or Armors - Types: 0 - Item, 1 - Weapon, 2 - Armor<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friendship_min(Mininum, Type, ItemID1, etc.)</code></div></div><br />
Set the Lowest Level The Friendship Points can reach: Number should be equal to 0 or less.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_friend_floor(Number)</code></div></div><br />
Change Custom Price Shop's No Transaction Penalty - Number stands for 0 or any positive number. Default Value: 1.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>price_shop_set_no_action_penalty(Number)</code></div></div><br />
Reward Your Loyal Customers with Items:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_items(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Reward Your Loyal Customers with Weapons:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_weapons(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Reward Your Loyal Customers with Armors:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>buy_gifts_armors(ItemID, ItemsMin, GiftItemID, Number)</code></div></div><br />
Punish the Player for Selling the "Wrong" Items: LostPoints stands for 1 or above.<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_items(ItemID1 =&gt; LostPoints, etc.)</code></div></div><br />
Punish the Player for Selling the "Wrong" Weapons:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_weapons(WeaponID1 =&gt; LostPoints, etc.)</code></div></div><br />
Punish the Player for Selling the "Wrong" Armors:<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code>sell_price_wrong_armors(ArmorID1 =&gt; LostPoints, etc.)</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b"><span style="font-size: medium;" class="mycode_size">The Script</span></span><br />
<br />
<div class="codeblock"><div class="title">Code:</div><div class="body" dir="ltr"><code># * KustomPriceShop XP * #<br />
#   Scripter : Kyonides<br />
#   v1.0.0 - 2026-05-23<br />
<br />
# Create a special shop that offers:<br />
# - Setting custom prices for specific items.<br />
# - Setting certain goods as highly undesirable, making the party lose<br />
#   friendship points at that shop.<br />
# - Rewarding loyal customers with free gifts if they buy a given amount of<br />
#   items or weapons or armors.<br />
# - Creating purchase-only or sell-only shops.<br />
<br />
# To keep it separate from normal shops, set the shop's ID via a game variable.<br />
# You can change the maximum number of units per item allowed in your game.<br />
# It also allows you to set a backdrop as well instead of the current map.<br />
# Leaving the shop without doing anything will decrease the shop's friendship<br />
# points by 1 (default value).<br />
<br />
# * Optional Script Calls For The Active Shop * #<br />
<br />
# - Add Items with Custom Prices:<br />
# buy_price_items(ItemID1 =&gt; Price1, etc.)<br />
# sell_price_items(ItemID1 =&gt; Price1, etc.)<br />
<br />
# - Add Weapons with Custom Prices:<br />
# buy_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
# sell_price_weapons(WeaponID1 =&gt; Price1, etc.)<br />
<br />
# - Add Armors with Custom Prices:<br />
# buy_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
# sell_price_armors(ArmorID1 =&gt; Price1, etc.)<br />
<br />
# - Change Custom Price Shop's Friendship Points:<br />
#   Number stands for any number, either positive or negative.<br />
# price_shop_friend_points(Number)<br />
<br />
# - Set Minimum Friendship Level for Certain Items, Weapons or Armors:<br />
#   Types: 0 - Item, 1 - Weapon, 2 - Armor<br />
# price_shop_friendship_min(Mininum, Type, ItemID1, etc.)<br />
<br />
# - Set the Lowest Level The Friendship Points can reach: 0 or less.<br />
# price_shop_friend_floor(Number)<br />
<br />
# - Change Custom Price Shop's No Transaction Penalty:<br />
#   Number stands for 0 or any positive number. Default Value: 1.<br />
# price_shop_set_no_action_penalty(Number)<br />
<br />
# - Reward Your Loyal Customers with Items:<br />
# buy_gifts_items(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Reward Your Loyal Customers with Weapons:<br />
# buy_gifts_weapons(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Reward Your Loyal Customers with Armors:<br />
# buy_gifts_armors(ItemID, ItemsMin, GiftItemID, Number)<br />
<br />
# - Punish the Player for Selling the Wrong Items:<br />
# sell_price_wrong_items(ItemID1 =&gt; LostPoints, etc.)<br />
<br />
# - Punish the Player for Selling the Wrong Weapons:<br />
# sell_price_wrong_weapons(WeaponID1 =&gt; LostPoints, etc.)<br />
<br />
# - Punish the Player for Selling the Wrong Armors:<br />
# sell_price_wrong_armors(ArmorID1 =&gt; LostPoints, etc.)<br />
<br />
module KustomPrice<br />
  ITEM_MAX = 99<br />
  BUY_ONLY_SWITCH  = 8<br />
  SELL_ONLY_SWITCH = 9<br />
  SHOP_ID_VAR = 10<br />
  DEFAULT_BACKDROP = "012-PortTown02"<br />
  FRIENDSHIP_LEVEL = "Friendship Level: %s"<br />
  SPECIAL_REWARDS  = "Special Rewards"<br />
<br />
  class Shop<br />
    class Gifts<br />
      def initialize(item_min, item_id, n)<br />
        @item_min = item_min<br />
        @item_id = item_id<br />
        @amount = n<br />
      end<br />
      attr_reader :item_min, :item_id, :amount<br />
    end<br />
<br />
    def initialize<br />
      @friendship = 0<br />
      @friendship_floor = 0<br />
      @no_action_penalty = 1<br />
      @friendship_min = {}<br />
      @buy_prices = {}<br />
      @sell_prices = {}<br />
      @buy_item_max = {}<br />
      @sell_item_max = {}<br />
      @buy_gifts = {}<br />
      @sell_wrong_goods = {}<br />
      @friendship_min.default = {}<br />
      @buy_prices.default = {}<br />
      @sell_prices.default = {}<br />
      @buy_gifts.default = {}<br />
      @sell_wrong_goods.default = {}<br />
      @buy_item_max.default = ITEM_MAX<br />
      @sell_item_max.default = ITEM_MAX<br />
    end<br />
<br />
    def friendship=(n)<br />
      @friendship = [@friendship + n, @friendship_floor].max<br />
    end<br />
<br />
    def no_action_penalty!<br />
      self.friendship -= @no_action_penalty<br />
    end<br />
<br />
    def frienship_min(mininum, type, *items)<br />
      fmin = @friendship_min[type]<br />
      items.flatten.each {|n| fmin[n] = mininum }<br />
      mininum<br />
    end<br />
<br />
    def set_buy_prices(type, data={})<br />
      @buy_prices[type].merge!(data)<br />
    end<br />
<br />
    def set_sell_prices(type, data={})<br />
      @sell_prices[type].merge!(data)<br />
    end<br />
<br />
    def set_buy_gifts(type, parent_id, item_min, item_id, n)<br />
      @buy_gifts[type][parent_id] = Gifts.new(item_min, item_id, n)<br />
    end<br />
<br />
    def sell_wrong_goods(type, data={})<br />
      @sell_wrong_goods[type].merge!(data)<br />
    end<br />
    attr_reader :friendship, :friendship_floor, :friendship_min<br />
    attr_reader :buy_prices, :sell_prices, :buy_gifts<br />
    attr_reader :buy_item_max, :sell_item_max, :sell_wrong_goods<br />
    attr_accessor :goods, :no_action_penalty<br />
  end<br />
end<br />
<br />
class Game_System<br />
  alias :kyon_kp_shop_gm_sys_init :initialize<br />
  def initialize<br />
    kyon_kp_shop_gm_sys_init<br />
    reset_price_shop_id!<br />
    @custom_price_shops = {}<br />
  end<br />
<br />
  def reset_price_shop_id!<br />
    @price_shop_id = 0<br />
  end<br />
<br />
  def init_price_shop(shop_id)<br />
    @price_shop_id = shop_id<br />
    @custom_price_shops[shop_id] ||= KustomPrice::Shop.new<br />
  end<br />
<br />
  def setup_price_shop(shop_id, new_goods)<br />
    shop = @custom_price_shops[shop_id]<br />
    shop.goods = new_goods<br />
  end<br />
<br />
  def this_price_shop<br />
    @custom_price_shops[@price_shop_id]<br />
  end<br />
  attr_reader :custom_price_shops<br />
end<br />
<br />
class Game_Party<br />
  def bag_items<br />
    @items<br />
  end<br />
<br />
  def bag_weapons<br />
    @weapons<br />
  end<br />
<br />
  def bag_armors<br />
    @armors<br />
  end<br />
<br />
  def compact_bag_items!<br />
    @items.delete_if {|k,v| v == 0 }<br />
    @weapons.delete_if {|k,v| v == 0 }<br />
    @armors.delete_if {|k,v| v == 0 }<br />
  end<br />
end<br />
<br />
class Window_ShopCommand<br />
  def reset_disabled_items<br />
    @disabled = []<br />
  end<br />
<br />
  def disable_current_item?<br />
    @disabled[@index]<br />
  end<br />
end<br />
<br />
module KustomPrice<br />
  module AddMethods<br />
    def item<br />
      @data[@index] || @no_item<br />
    end<br />
<br />
    def price<br />
      @prices[@index] || 0<br />
    end<br />
<br />
    def type<br />
      @types[@index] || 0<br />
    end<br />
<br />
    def get_price(n, item_id, price)<br />
      case @types[n]<br />
      when 0<br />
        @item_prices[item_id] || price<br />
      when 1<br />
        @weapon_prices[item_id] || price<br />
      when 2<br />
        @armor_prices[item_id] || price<br />
      end<br />
    end<br />
  end<br />
<br />
class ShopBuyWindow &lt; Window_Selectable<br />
  include AddMethods<br />
  attr_accessor :shop_goods<br />
  def initialize(shop, shop_goods)<br />
    w = 368<br />
    @tw = w - 64<br />
    super(0, 288, w, 192)<br />
    sp = shop.buy_prices<br />
    @item_prices   = sp[0]<br />
    @weapon_prices = sp[1]<br />
    @armor_prices  = sp[2]<br />
    @shop_goods = shop_goods.dup<br />
    @no_item = RPG::Item.new<br />
    @transparent = Color.new(0, 0, 0, 0)<br />
    @symbol_color = Color.new(255, 255, 80)<br />
    @symbol = &#36;data_system.words.gold<br />
    refresh<br />
    self.index = 0<br />
  end<br />
<br />
  def item_name<br />
    self.item.name<br />
  end<br />
<br />
  def set_goods(goods_item)<br />
    type, goods_id = goods_item<br />
    case type<br />
    when 0<br />
      [type, &#36;data_items[goods_id]]<br />
    when 1<br />
      [type, &#36;data_weapons[goods_id]]<br />
    when 2<br />
      [type, &#36;data_armors[goods_id]]<br />
    end<br />
  end<br />
<br />
  def refresh<br />
    if self.contents != nil<br />
      self.contents.dispose<br />
      self.contents = nil<br />
    end<br />
    @types = []<br />
    @data = []<br />
    @prices = []<br />
    for goods_item in @shop_goods<br />
      type, item = set_goods(goods_item)<br />
      next unless item<br />
      n = @types.size<br />
      @types &lt;&lt; type<br />
      @data &lt;&lt; item<br />
      @prices &lt;&lt; get_price(n, item.id, item.price)<br />
    end<br />
    draw_items<br />
  end<br />
<br />
  def draw_items<br />
    @item_max = @data.size<br />
    self.contents = Bitmap.new(width - 32, row_max * 32) if @item_max &gt; 0<br />
    @item_max.times {|i| draw_item(i) }<br />
  end<br />
<br />
  def clear_line(rx, ry)<br />
    rect = Rect.new(rx, ry, self.width - 32, 32)<br />
    self.contents.fill_rect(rect, @transparent)<br />
  end<br />
<br />
  def draw_item(n)<br />
    item = @data[n]<br />
    font = self.contents.font<br />
    price = @prices[n]<br />
    if &#36;game_party.gold &gt;= price<br />
      font.color = normal_color<br />
      alpha = 255<br />
    else<br />
      font.color = disabled_color<br />
      alpha = 128<br />
    end<br />
    ry = n * 32<br />
    clear_line(4, ry)<br />
    bitmap = RPG::Cache.icon(item.icon_name)<br />
    self.contents.blt(28, ry + 4, bitmap, Rect.new(0, 0, 24, 24), alpha)<br />
    self.contents.draw_text(56, ry, @tw - 100, 32, item.name)<br />
    self.contents.draw_text(@tw - 92, ry, 100, 32, price.to_s, 2)<br />
    @symbol_color.alpha = alpha<br />
    font.color = @symbol_color<br />
    self.contents.draw_text(@tw, ry, 24, 32, @symbol, 2)<br />
  end<br />
<br />
  def update_help<br />
    @help_window.set_text(self.item.description)<br />
  end<br />
<br />
  def delete_item<br />
    @shop_goods.delete(@index)<br />
    item = @data.delete(@index)<br />
    self.contents.dispose if self.contents != nil<br />
    self.contents = nil<br />
    draw_items<br />
  end<br />
<br />
  def disable_item(n)<br />
    draw_item(n, disabled_color)<br />
    @disabled[n] = true<br />
  end<br />
end<br />
<br />
class ShopSellWindow &lt; Window_Selectable<br />
  include AddMethods<br />
  def initialize(shop)<br />
    super(0, 128, 640, 352)<br />
    @column_max = 2<br />
    @no_item = RPG::Item.new<br />
    sp = shop.sell_prices<br />
    @item_prices   = sp[0]<br />
    @weapon_prices = sp[1]<br />
    @armor_prices  = sp[2]<br />
    refresh<br />
    self.index = 0<br />
  end<br />
<br />
  def refresh<br />
    if self.contents != nil<br />
      self.contents.dispose<br />
      self.contents = nil<br />
    end<br />
    @types = []<br />
    @data = []<br />
    @prices = []<br />
    n = 0<br />
    &#36;game_party.bag_items.sort.each do |k,v|<br />
      next if &#36;game_party.item_number(k) == 0<br />
      @types &lt;&lt; 0<br />
      @data &lt;&lt; obj = &#36;data_items[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    &#36;game_party.bag_weapons.sort.each do |k,v|<br />
      next if &#36;game_party.weapon_number(i) == 0<br />
      @types &lt;&lt; 1<br />
      @data &lt;&lt; obj = &#36;data_weapons[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    &#36;game_party.bag_armors.sort.each do |k,v|<br />
      next if &#36;game_party.armor_number(i) == 0<br />
      @types &lt;&lt; 2<br />
      @data &lt;&lt; obj = &#36;data_armors[k]<br />
      @prices &lt;&lt; get_price(n, k, obj.price / 2)<br />
      n += 1<br />
    end<br />
    @item_max = @data.size<br />
    return if @item_max == 0<br />
    self.contents = Bitmap.new(width - 32, row_max * 32)<br />
    @item_max.times {|n| draw_item(n) }<br />
  end<br />
<br />
  def draw_item(n)<br />
    item = @data[n]<br />
    case item<br />
    when RPG::Item<br />
      number = &#36;game_party.item_number(item.id)<br />
    when RPG::Weapon<br />
      number = &#36;game_party.weapon_number(item.id)<br />
    when RPG::Armor<br />
      number = &#36;game_party.armor_number(item.id)<br />
    end<br />
    price = @prices[n]<br />
    if price &gt; 0<br />
      self.contents.font.color = normal_color<br />
    else<br />
      self.contents.font.color = disabled_color<br />
    end<br />
    x = 4 + n % 2 * (288 + 32)<br />
    y = n / 2 * 32<br />
    rect = Rect.new(x, y, self.width / @column_max - 32, 32)<br />
    self.contents.fill_rect(rect, Color.new(0, 0, 0, 0))<br />
    bitmap = RPG::Cache.icon(item.icon_name)<br />
    opacity = self.contents.font.color == normal_color ? 255 : 128<br />
    self.contents.blt(x, y + 4, bitmap, Rect.new(0, 0, 24, 24), opacity)<br />
    self.contents.draw_text(x + 28, y, 212, 32, item.name, 0)<br />
    self.contents.draw_text(x + 240, y, 16, 32, ":", 1)<br />
    self.contents.draw_text(x + 256, y, 24, 32, number.to_s, 2)<br />
  end<br />
<br />
  def update_help<br />
    @help_window.set_text(self.item.description)<br />
  end<br />
end<br />
<br />
class ShopGiftWindow &lt; Window_Selectable<br />
  def initialize<br />
    super(160, 144, 320, 128)<br />
    @w = width - 32<br />
    @h = height - 32<br />
    @types = []<br />
    @gifts = []<br />
    @amounts = []<br />
    @pages = 0<br />
    @index = 0<br />
  end<br />
<br />
  def set_gifts(list)<br />
    list.each do |type, gift, n|<br />
      @types &lt;&lt; type<br />
      @gifts &lt;&lt; gift<br />
      @amounts &lt;&lt; n<br />
    end<br />
    @pages = list.size<br />
    refresh<br />
  end<br />
<br />
  def change_page(n)<br />
    return if @pages == 1<br />
    @index = (@index + n) % @pages<br />
    refresh<br />
  end<br />
<br />
  def refresh<br />
    page = @index + 1<br />
    label = "Page " + page.to_s + "/" + @pages.to_s<br />
    n = @amounts[@index]<br />
    b = Bitmap.new(@w, @h)<br />
    font = b.font<br />
    font.color = system_color<br />
    b.draw_text(0, 0, @w, 32, SPECIAL_REWARDS, 1)<br />
    good = get_good<br />
    font.color = normal_color<br />
    b.draw_text(0, 32, @w, 32, good.name)<br />
    b.draw_text(0, 32, @w, 32, n.to_s, 2)<br />
    b.draw_text(0, 64, @w, 32, label, 2)<br />
    self.contents = b<br />
  end<br />
<br />
  def get_good<br />
    item_id = @gifts[@index]<br />
    case @types[@index]<br />
    when 0<br />
      return &#36;data_items[item_id]<br />
    when 1<br />
      return &#36;data_weapons[item_id]<br />
    when 2<br />
      return &#36;data_armors[item_id]<br />
    end<br />
  end<br />
end<br />
<br />
end<br />
<br />
class Interpreter<br />
  alias :kyon_kp_shop_int_chng_vars :command_122<br />
  def command_122<br />
    kyon_kp_shop_int_chng_vars<br />
    var_id = @parameters[0]<br />
    return unless KustomPrice::SHOP_ID_VAR == var_id<br />
    var_id = @parameters[4]<br />
    @price_shop = &#36;game_system.init_price_shop(var_id)<br />
  end<br />
<br />
  def price_shop_friend_points(n)<br />
    @price_shop.friendship += n<br />
  end<br />
<br />
  def price_shop_friend_floor(n)<br />
    @price_shop.friendship_floor = n<br />
  end<br />
<br />
  def price_shop_friendship_min(min, type, *items)<br />
    @price_shop.frienship_min(min, type, *items)<br />
  end<br />
<br />
  def price_shop_set_no_action_penalty(n)<br />
    @price_shop.no_action_penalty = n<br />
  end<br />
<br />
  def buy_price_items(data={})<br />
    @price_shop.set_buy_prices(0, data)<br />
  end<br />
<br />
  def buy_price_weapons(data={})<br />
    @price_shop.set_buy_prices(1, data)<br />
  end<br />
<br />
  def buy_price_armors(data={})<br />
    @price_shop.set_buy_prices(2, data)<br />
  end<br />
<br />
  def sell_price_items(data={})<br />
    @price_shop.set_sell_prices(0, data)<br />
  end<br />
<br />
  def sell_price_weapons(data={})<br />
    @price_shop.set_sell_prices(1, data)<br />
  end<br />
<br />
  def sell_price_armors(data={})<br />
    @price_shop.set_sell_prices(2, data)<br />
  end<br />
<br />
  def buy_gifts_items(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(0, item_id, item_min, gift_item_id, n)<br />
  end<br />
<br />
  def buy_gifts_weapons(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(1, item_id, item_min, gift_item_id, n)<br />
  end<br />
<br />
  def buy_gifts_armors(item_id, item_min, gift_item_id, n)<br />
    @price_shop.set_buy_gifts(2, item_id, item_min, gift_item_id, n)<br />
  end<br />
  <br />
  def sell_price_wrong_items(data={})<br />
    @price_shop.sell_wrong_goods(0, data)<br />
  end<br />
<br />
  def sell_price_wrong_weapons(data={})<br />
    @price_shop.sell_wrong_goods(1, data)<br />
  end<br />
<br />
  def sell_price_wrong_armors(data={})<br />
    @price_shop.sell_wrong_goods(2, data)<br />
  end<br />
end<br />
<br />
class Scene_Map<br />
  def call_shop<br />
    &#36;game_temp.shop_calling = false<br />
    &#36;game_player.straighten<br />
    shop_var = KustomPrice::SHOP_ID_VAR<br />
    if &#36;game_variables[shop_var] != 0<br />
      &#36;scene = PriceShopScene.new<br />
    else<br />
      &#36;scene = Scene_Shop.new<br />
    end<br />
  end<br />
end<br />
<br />
class PriceShopScene &lt; Scene_Shop<br />
  include KustomPrice<br />
  def find_shop_id<br />
    &#36;game_variables[SHOP_ID_VAR]<br />
  end<br />
<br />
  def main<br />
    prepare_goods<br />
    make_backdrop<br />
    make_windows<br />
    Graphics.transition<br />
    loop do<br />
      Graphics.update<br />
      Input.update<br />
      update<br />
      if &#36;scene != self<br />
        break<br />
      end<br />
    end<br />
    Graphics.freeze<br />
    dispose_windows<br />
    reset_price_shop<br />
  end<br />
<br />
  def prepare_goods<br />
    &#36;game_party.compact_bag_items!<br />
    @transactions = 0<br />
    @shop_id = find_shop_id<br />
    @shop = &#36;game_system.this_price_shop<br />
    @fp = @shop.friendship<br />
    @fp_min = @shop.friendship_min<br />
    @goods = @shop.goods || &#36;game_temp.shop_goods<br />
    setup_friendly_goods<br />
  end<br />
<br />
  def setup_friendly_goods<br />
    @gifts = []<br />
    @shop_goods = []<br />
    @goods.each do |type, obj_id|<br />
      group = @fp_min[type]<br />
      level = group[obj_id] || 0<br />
      @shop_goods &lt;&lt; [type, obj_id] if level == 0 or level &lt;= @fp<br />
    end<br />
    @exclude_goods = @shop_goods.size != @goods.size<br />
  end<br />
<br />
  def make_backdrop<br />
    @backdrop = Sprite.new<br />
    @backdrop.bitmap = RPG::Cache.battleback(DEFAULT_BACKDROP)<br />
  end<br />
<br />
  def make_windows<br />
    @help_window = Window_Help.new<br />
    show_friendship_level<br />
    @command_window = Window_ShopCommand.new<br />
    @command_window.reset_disabled_items<br />
    @command_window.disable_item(0) if &#36;game_switches[SELL_ONLY_SWITCH]<br />
    @command_window.disable_item(1) if &#36;game_switches[BUY_ONLY_SWITCH]<br />
    @gold_window = Window_Gold.new<br />
    @gold_window.x = 480<br />
    @gold_window.y = 64<br />
    @dummy_window = Window_Base.new(0, 288, 640, 192)<br />
    @buy_window = ShopBuyWindow.new(@shop, @shop_goods)<br />
    @buy_window.active = false<br />
    @buy_window.visible = false<br />
    @buy_window.help_window = @help_window<br />
    @sell_window = ShopSellWindow.new(@shop)<br />
    @sell_window.active = false<br />
    @sell_window.visible = false<br />
    @sell_window.help_window = @help_window<br />
    @number_window = Window_ShopNumber.new<br />
    @number_window.active = false<br />
    @number_window.visible = false<br />
    @status_window = Window_ShopStatus.new<br />
    @status_window.visible = false<br />
    @gift_window = ShopGiftWindow.new<br />
    @gift_window.visible = false<br />
  end<br />
<br />
  def show_friendship_level<br />
    points = @shop.friendship.to_s<br />
    points = sprintf(FRIENDSHIP_LEVEL, points)<br />
    @help_window.set_text(points)<br />
  end<br />
<br />
  def update<br />
    if @show_gifts<br />
      update_show_gifts<br />
      return<br />
    end<br />
    super<br />
  end<br />
<br />
  def update_show_gifts<br />
    if Input.trigger?(Input::B) or Input.trigger?(Input::C)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      &#36;scene = Scene_Map.new<br />
      return @show_gifts = nil<br />
    elsif Input.trigger?(Input::LEFT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @gift_window.change_page(-1)<br />
      return<br />
    elsif Input.trigger?(Input::RIGHT)<br />
      &#36;game_system.se_play(&#36;data_system.cursor_se)<br />
      @gift_window.change_page(1)<br />
    end<br />
  end<br />
<br />
  def update_command<br />
    if Input.trigger?(Input::B)<br />
      if @get_gifts<br />
        &#36;game_system.se_play(&#36;data_system.shop_se)<br />
        @command_window.index = -1<br />
        @gift_window.set_gifts(@gifts)<br />
        @gift_window.visible = true<br />
        Graphics.screenshot<br />
        @get_gifts = nil<br />
        return @show_gifts = true<br />
      else<br />
        &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
        &#36;scene = Scene_Map.new<br />
      end<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      if @command_window.disable_current_item?<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      case @command_window.index<br />
      when 0<br />
        open_purchase<br />
      when 1<br />
        open_sale<br />
      when 2<br />
        &#36;game_system.se_play(&#36;data_system.decision_se)<br />
        &#36;scene = Scene_Map.new<br />
      end<br />
    end<br />
  end<br />
<br />
  def open_purchase<br />
    &#36;game_system.se_play(&#36;data_system.decision_se)<br />
    @command_window.active = false<br />
    @dummy_window.visible = false<br />
    @buy_window.active = true<br />
    @buy_window.visible = true<br />
    @buy_window.refresh<br />
    @status_window.visible = true<br />
  end<br />
<br />
  def open_sale<br />
    &#36;game_system.se_play(&#36;data_system.decision_se)<br />
    @command_window.active = false<br />
    @dummy_window.visible = false<br />
    @sell_window.active = true<br />
    @sell_window.visible = true<br />
    @sell_window.refresh<br />
  end<br />
<br />
  def update_buy<br />
    @status_window.item = @buy_window.item<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @command_window.active = true<br />
      @dummy_window.visible = true<br />
      @buy_window.active = false<br />
      @buy_window.visible = false<br />
      @status_window.visible = false<br />
      @status_window.item = nil<br />
      show_friendship_level<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      @item = @buy_window.item<br />
      price = @buy_window.price<br />
      if @item == nil or &#36;game_party.gold &lt; price<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      case @item<br />
      when RPG::Item<br />
        number = &#36;game_party.item_number(@item.id)<br />
      when RPG::Weapon<br />
        number = &#36;game_party.weapon_number(@item.id)<br />
      when RPG::Armor<br />
        number = &#36;game_party.armor_number(@item.id)<br />
      end<br />
      if ITEM_MAX == number<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      &#36;game_system.se_play(&#36;data_system.decision_se)<br />
      max = price == 0 ? ITEM_MAX : &#36;game_party.gold / price<br />
      max = [max, ITEM_MAX - number].min<br />
      @buy_window.active = false<br />
      @buy_window.visible = false<br />
      @number_window.set(@item, max, price)<br />
      @number_window.active = true<br />
      @number_window.visible = true<br />
    end<br />
  end<br />
<br />
  def update_sell<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @command_window.active = true<br />
      @dummy_window.visible = true<br />
      @sell_window.active = false<br />
      @sell_window.visible = false<br />
      @status_window.item = nil<br />
      show_friendship_level<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      @item = @sell_window.item<br />
      @status_window.item = @item<br />
      price = @sell_window.price<br />
      if @item == nil or price == 0<br />
        &#36;game_system.se_play(&#36;data_system.buzzer_se)<br />
        return<br />
      end<br />
      &#36;game_system.se_play(&#36;data_system.decision_se)<br />
      case @item<br />
      when RPG::Item<br />
        number = &#36;game_party.item_number(@item.id)<br />
      when RPG::Weapon<br />
        number = &#36;game_party.weapon_number(@item.id)<br />
      when RPG::Armor<br />
        number = &#36;game_party.armor_number(@item.id)<br />
      end<br />
      total = number<br />
      @sell_window.active = false<br />
      @sell_window.visible = false<br />
      @number_window.set(@item, total, price)<br />
      @number_window.active = true<br />
      @number_window.visible = true<br />
      @status_window.visible = true<br />
    end<br />
  end<br />
<br />
  def update_number<br />
    if Input.trigger?(Input::B)<br />
      &#36;game_system.se_play(&#36;data_system.cancel_se)<br />
      @number_window.active = false<br />
      @number_window.visible = false<br />
      case @command_window.index<br />
      when 0  # buy<br />
        @buy_window.active = true<br />
        @buy_window.visible = true<br />
      when 1  # sell<br />
        @sell_window.active = true<br />
        @sell_window.visible = true<br />
        @status_window.visible = false<br />
      end<br />
      return<br />
    elsif Input.trigger?(Input::C)<br />
      &#36;game_system.se_play(&#36;data_system.shop_se)<br />
      @number_window.active = false<br />
      @number_window.visible = false<br />
      item_id = @item.id<br />
      n = @number_window.number<br />
      @transactions += n<br />
      case @command_window.index<br />
      when 0  # buy<br />
        update_number_buy(item_id, n)<br />
        return<br />
      when 1  # sell<br />
        type = @sell_window.type<br />
        lost_points = @shop.sell_wrong_goods[type][item_id] || 0<br />
        if lost_points &gt; 0<br />
          @shop.friendship -= lost_points * n<br />
        else<br />
          @shop.friendship += n<br />
        end<br />
        price = @sell_window.price<br />
        &#36;game_party.gain_gold(n * price)<br />
        case @item<br />
        when RPG::Item<br />
          &#36;game_party.lose_item(item_id, n)<br />
        when RPG::Weapon<br />
          &#36;game_party.lose_weapon(item_id, n)<br />
        when RPG::Armor<br />
          &#36;game_party.lose_armor(item_id, n)<br />
        end<br />
        @gold_window.refresh<br />
        @sell_window.refresh<br />
        @status_window.refresh<br />
        @sell_window.active = true<br />
        @sell_window.visible = true<br />
        @status_window.visible = false<br />
      end<br />
    end<br />
  end<br />
<br />
  def update_number_buy(item_id, n)<br />
    @shop.friendship += n<br />
    price = @buy_window.price<br />
    &#36;game_party.lose_gold(n * price)<br />
    case @item<br />
    when RPG::Item<br />
      type = 0<br />
      &#36;game_party.gain_item(item_id, n)<br />
    when RPG::Weapon<br />
      type = 1<br />
      &#36;game_party.gain_weapon(item_id, n)<br />
    when RPG::Armor<br />
      type = 2<br />
      &#36;game_party.gain_armor(item_id, n)<br />
    end<br />
    @gold_window.refresh<br />
    if @shop.friendship != @fp<br />
      @fp = @shop.friendship<br />
      setup_friendly_goods<br />
      @buy_window.shop_goods = @shop_goods<br />
    end<br />
    @buy_window.refresh<br />
    @status_window.refresh<br />
    @buy_window.active = true<br />
    @buy_window.visible = true<br />
    gifts_list = @shop.buy_gifts[type]<br />
    gift = gifts_list[item_id]<br />
    if gift and gift.item_min &lt;= n<br />
      item_id = gift.item_id<br />
      total = n / gift.item_min * gift.amount<br />
      case type<br />
      when 0<br />
        &#36;game_party.gain_item(item_id, total)<br />
      when 1<br />
        &#36;game_party.gain_weapon(item_id, total)<br />
      when 2<br />
        &#36;game_party.gain_armor(item_id, total)<br />
      end<br />
      @gifts &lt;&lt; [type, item_id, total]<br />
      @get_gifts = true<br />
    end<br />
  end<br />
<br />
  def dispose_windows<br />
    @backdrop.bitmap.dispose<br />
    @backdrop.dispose<br />
    @help_window.dispose<br />
    @command_window.dispose<br />
    @gold_window.dispose<br />
    @dummy_window.dispose<br />
    @buy_window.dispose<br />
    @sell_window.dispose<br />
    @number_window.dispose<br />
    @status_window.dispose<br />
    @gift_window.dispose<br />
  end<br />
<br />
  def reset_price_shop<br />
    &#36;game_variables[SHOP_ID_VAR] = 0<br />
    &#36;game_switches[BUY_ONLY_SWITCH] = false<br />
    &#36;game_switches[SELL_ONLY_SWITCH] = false<br />
    &#36;game_party.compact_bag_items!<br />
    @shop.no_action_penalty! if @transactions == 0<br />
    list = @buy_window.shop_goods<br />
    if !@exclude_goods and list.size != @shop_goods.size<br />
      &#36;game_system.setup_price_shop(@shop_id, list)<br />
    end<br />
    &#36;game_system.reset_price_shop_id!<br />
  end<br />
end</code></div></div><br />
<span style="font-weight: bold;" class="mycode_b">Terms &amp; Conditions</span><br />
<br />
Free as in <img src="https://www.save-point.org/images/smilies/ejlol/beer.gif" alt="Beer" title="Beer" class="smilie smilie_189" /> beer.<br />
Mention me in your game credits.<br />
You may also add the forum's name and URL there.<br />
That's it! <img src="https://www.save-point.org/images/smilies/ejlol/tongue.gif" alt="Tongue sticking out" title="Tongue sticking out" class="smilie smilie_24" />]]></content:encoded>
		</item>
		<item>
			<title><![CDATA[Face Sync System Core]]></title>
			<link>https://www.save-point.org/thread-13458.html</link>
			<pubDate>Fri, 10 Apr 2026 23:20:44 +0000</pubDate>
			<dc:creator><![CDATA[<a href="https://www.save-point.org/member.php?action=profile&uid=5">DerVVulfman</a>]]></dc:creator>
			<guid isPermaLink="false">https://www.save-point.org/thread-13458.html</guid>
			<description><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Face Sync System Core</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
The Face Sync System  is perhaps the first of its kind  within the RPG Maker community. <br />
<br />
Based on a concept by Bethesda Softworks and its lip-file system,  Face Sync is a software package that takes the contents of a pre-generated timing data file and then,  with that timing, it then displays individual animation cels in concert atop  of s designated sprite, whether it is a character sprite on the field map, a character portrait shown within a custom message window, or the like.<br />
<br />
The system core covers most of the necessary mechanics, creating the sprites that are rendered, the retrieval of graphics and the timing data,  the animation functions, and their removal.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><br />
<ul class="mycode_list"><li>Custom data files that will cache like any other in the data folder</li>
<li>Includes two example scripts showing how to make the requisite data files</li>
<li>Includes a Message Adaptation script to allow face sync in message portraits</li>
<li>Includes a Character Set script to allow face sync on field map sprites</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Limitations</span></span><br />
<ul class="mycode_list"><li>Apparently, only one NPC animation per patch script at any one time.  You can show lips syncs occur on a character in the field map and in a message profile pic at the same time, but not two character set sprites on the map at the same time.</li>
<li>Map Movement may affect the accuracy of the Face Sync animations</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
You'd literally be watching someone open and close their mouth.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/nooplfix63y3al0ggpbufwt7dknr6wxg" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Box Com Download</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty, but in the script<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
The main core system does not interfere with any content.  It requires patch scripts to connect it to suitable message systems (included in the demo).<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Remi-Chan for the use of Esperia Frostwhisper from her gaming universe for this demo.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free to use,  even in commercial projects.  However, I will need some form of due credit.<br />
<br />
Esperia Frostwhisper - the sole property of Remi-Chan.  All Rights Reserved.]]></description>
			<content:encoded><![CDATA[<div align="center"><span style="font-size: large;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Face Sync System Core</span></span><br />
<span style="font-size: medium;" class="mycode_size">Version: 1.0</span></div>
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Introduction</span></span><br />
<br />
The Face Sync System  is perhaps the first of its kind  within the RPG Maker community. <br />
<br />
Based on a concept by Bethesda Softworks and its lip-file system,  Face Sync is a software package that takes the contents of a pre-generated timing data file and then,  with that timing, it then displays individual animation cels in concert atop  of s designated sprite, whether it is a character sprite on the field map, a character portrait shown within a custom message window, or the like.<br />
<br />
The system core covers most of the necessary mechanics, creating the sprites that are rendered, the retrieval of graphics and the timing data,  the animation functions, and their removal.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Features</span></span><br />
<ul class="mycode_list"><li>Custom data files that will cache like any other in the data folder</li>
<li>Includes two example scripts showing how to make the requisite data files</li>
<li>Includes a Message Adaptation script to allow face sync in message portraits</li>
<li>Includes a Character Set script to allow face sync on field map sprites</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Limitations</span></span><br />
<ul class="mycode_list"><li>Apparently, only one NPC animation per patch script at any one time.  You can show lips syncs occur on a character in the field map and in a message profile pic at the same time, but not two character set sprites on the map at the same time.</li>
<li>Map Movement may affect the accuracy of the Face Sync animations</li>
</ul>
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Screenshots</span></span><br />
<br />
You'd literally be watching someone open and close their mouth.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Demo</span></span><br />
<br />
<a href="https://app.box.com/s/nooplfix63y3al0ggpbufwt7dknr6wxg" target="_blank" rel="noopener" class="mycode_url"><span style="font-weight: bold;" class="mycode_b">Box Com Download</span></a><br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Instructions</span></span><br />
<br />
Plenty, but in the script<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Compatibility</span></span><br />
<br />
The main core system does not interfere with any content.  It requires patch scripts to connect it to suitable message systems (included in the demo).<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Credits and Thanks</span></span><br />
<br />
Thanks to Remi-Chan for the use of Esperia Frostwhisper from her gaming universe for this demo.<br />
<br />
<br />
<br />
<span style="font-size: medium;" class="mycode_size"><span style="font-weight: bold;" class="mycode_b">Terms and Conditions</span></span><br />
<br />
Free to use,  even in commercial projects.  However, I will need some form of due credit.<br />
<br />
Esperia Frostwhisper - the sole property of Remi-Chan.  All Rights Reserved.]]></content:encoded>
		</item>
	</channel>
</rss>