### Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

### Topics - diagostimo

1
##### Sea of Code / Growing Image depending on Y position
March 23, 2013, 08:08:07 pm
hey guys, I have a mini project I am working on at the moment in Java, basically what I am trying to accomplish is moving an image down the screen and scaling it depending on the Y position, the hard part is the screen is not square(640, 480), what I am doing is making a moving road Panorama, so what I am doing is drawing the road image twice, and scaling them both depending on the position, heres my code that im drawing them with at the moment:
``                float scale = 0.4f;				roadFrame1.draw(0, real_y);				float width = (float) (640 * scale);;		float height = (float) (480 * scale);				float x = 320 - (width / 2);		float y = real_y - (height);				roadFrame1.draw(x, y, width, height);``

then this is the update method that just ajusts real_y:
``                if (real_y < 480) {			real_y += 1;		} else {			real_y = 0;		}``

so its moving fine but I need it to scale, iv figured out that 0.4 is the exact scale for it to tile with the full sized image when placed above it, iv also tried messing around with the logic on how the scale is determined but I haven't even been able to get anything near the result I want, here is an image of the actual graphic so you have a better idea:
Spoiler: Show

2
##### Sea of Code / java Server
February 14, 2013, 05:41:54 am
hey guys, recently I have been learning how to program a server in Java, and I actually don't need help for once  , anyway I was wondering if I could get some feedback on the concept of my wonderful creation, I have read lots of tuts and realize there is a lot of ways to go about it, which is why I was wondering if this is efficient, from my perspective it seems to do its justice, at the moment its only exchanging a tiny amount of data, but it seams to fly through it, so here it is:

this is my server class:
``package myServer;import java.net.*;import java.util.ArrayList;import java.io.*;public class Server {		public static Server server;	public ArrayList<ServerClientThread> users;		private boolean running;	private ServerSocket serverSocket;	private int port = 4444;	private Socket socket;		public static void main(String[] args) {				server = new Server();			}		//constructor begin	public Server() {				users = new ArrayList<ServerClientThread>();		serverSocket = null;		running = true;				 try {			 serverSocket = new ServerSocket(port);			 System.out.println("the server has sucessfully launched");	     } catch (IOException e) {	         System.err.println("Could not listen on port: " + port + ".");	         System.exit(-1);	     }		 		 run();			} 	//constructor end		//run method begin	public void run() {				while(running) {						try {				socket = serverSocket.accept();				users.add(new ServerClientThread(socket, this));				users.get(users.size() - 1).start();				System.out.println("the server accepted a conection");							} catch (IOException e) {				e.printStackTrace();			}					}			}	//run method end	}``

then this is my ServerClientThread class that manages each client on the server:
``package myServer;import java.io.*;import java.net.*;public class ServerClientThread extends Thread {	private Server server;	private Socket socket = null;	private boolean running;		private ObjectInputStream in;	private ObjectOutputStream out;		//constructor begin	public ServerClientThread(Socket socket, Server server) {				super("ServerClientThread");		this.socket = socket;		this.server = server;		try {			in = new ObjectInputStream(socket.getInputStream());			out = new ObjectOutputStream(socket.getOutputStream());			System.out.println("client thread successfully created");		} catch (IOException e) {			e.printStackTrace();		}		running = true;			}	//constructor end		//run method begin	public void run() {				int x = 0;		while (running) {						try {								byte command = (byte) in.readObject();								if (command == 0) {										out.writeObject(x);					x++;									} else if (command == -1) {										System.out.println("the close command has been proccessed, thread and client will now shutdown");					close();					System.out.println("also the client will be removed from the user list on the server for convinience");					server.users.remove(this);									}											} catch (IOException e) {				e.printStackTrace();				close();			} catch (ClassNotFoundException e) {				e.printStackTrace();				close();			}				    }			}	//run method end		//close method begin	public void close() {				try {			running = false;			in.close();			out.close();			socket.close();		} catch (IOException e) {			e.printStackTrace();		}			}	//close method end	}``

and allas my Client class:
``package myServer;import java.io.*;import java.net.*;public class Client {	private Socket socket;	private int port = 4444;	private boolean running;		private ObjectInputStream in;	private ObjectOutputStream out;		//PrintWriter out = null;    //BufferedReader in = null;		public static void main(String[] args) {				try {			Client client = new Client();		} catch (IOException e) {			e.printStackTrace();		}			}		//constructor begin	public Client() throws IOException {				try {			socket = new Socket("localhost", port);			out = new ObjectOutputStream(socket.getOutputStream());			in = new ObjectInputStream(socket.getInputStream());		} catch (UnknownHostException e) {			System.err.println("Don't know about host: " + port + ".");	        System.exit(1);		} catch (IOException e) {	        System.err.println("Couldn't get I/O for the connection to: " + port + ".");	        System.exit(1);	    }				running = true;				run();			}	//constructor end		//run method begin	public void run() {				byte command;		int x = -1;				while (running) {	        			try {				if (x < 10000) {										command = 0;					out.writeObject(command);					x = (int) in.readObject();					System.out.println(x);									} else {										command = -1;					out.writeObject(command);					close();									}							} catch (ClassNotFoundException e) {				e.printStackTrace();			} catch (IOException e) {				e.printStackTrace();			}	        	    }			}	//run method end		//close method begin	public void close() {				try {			running = false;			in.close();			out.close();			socket.close();		} catch (IOException e) {			e.printStackTrace();		}			}	//close method end	}``

so ye its pretty simple right now, the server just sits and waits for connections coming in, when they do it creates a new thread to manage that connection, then the thread and the client commute an integer till it reaches 10,000, when it does the client sends a shut-down signal to the server thread, and they both close, pretty simple but its a start
3
##### Sea of Code / script compiling?
February 02, 2013, 04:28:15 am
hey guys, I was wondering if anyone could offer me any insight how to compile multiple scripts into one file, like how in RPG maker, all the scripts are compiled within Scripts.rxdata, I was just wondering as I am creating my own engine sort of thing and it would be really handy to be able to have one master file that I load to get to all my scripts, same for editing them, I would probably go about making some sort of script editor that opens up the file and lets me write to it, if anyone knows how I would pull this sort of thing off that would be great, im writing in java to be specific, so maybe there is something out there that already achieves this.
4
##### Sea of Code / collision inside a box
January 22, 2013, 11:29:14 pm
hey there guys, I have a problem figuring out the are of some triangles within a box, and thought id ask here first as you guys are pretty awesome when it comes to this sort of stuff!
so recently I have been looking into 3D game development from scratch using the LWJGL library for Java, and I am currently trying to create a collision detection system using bounding boxes around things, so the way I am currently going about it is I am testing whether a point/vector of my characters bounding box is entering another bounding box, and I will do this for all the points on my bounding box to ensure that there is no collision an the target location.

so I have managed to get it to work, well it sort of works, but at certain points of the box it doesn't work, and I cant find the problem, here is the code to my collision detection:

``        public boolean collide(Cube collider, float tX, float tY, float tZ) {				boolean check;		//first check the collision of players collider vertices		check = testArea(this.collider.rotFBL, collider, tX, tY, tZ);		if (check) {			return true;		}		check = testArea(this.collider.rotFBR, collider, tX, tY, tZ);		if (check) {			return true;		}		check = testArea(this.collider.rotBBR, collider, tX, tY, tZ);		if (check) {			return true;		}		check = testArea(this.collider.rotBBL, collider, tX, tY, tZ);		if (check) {			return true;		}		//next check the targets collider vertices		//check = testArea(collider.rotFBL, this.collider, tX, tY, tZ);		//if (check) return true;		//check = testArea(collider.rotFBR, this.collider, tX, tY, tZ);		//if (check) return true;		//check = testArea(collider.rotBBR, this.collider, tX, tY, tZ);		//if (check) return true;		//check = testArea(collider.rotBBL, this.collider, tX, tY, tZ);		//if (check) return true;				//if all checks don't return true then there is no collision		return false;			}``

tX ect. are the target coordinates, and what that is doing is sending the points to be individually checked to see whether they are inside the target box, also note the rotFBl etc are the rotated points named acordingly, for example rotFBL is rotatedFrontBottomLeft, next the method that checks if the point is inside the area:

``private boolean testArea(Vector3f vector, Cube collider, float tX, float tY, float tZ) {				float lArea = Math.abs(collider.rotFBR.x * (collider.rotBBR.z - (vector.z + tZ)) + 				collider.rotBBR.x * ((vector.z + tZ) - collider.rotFBR.z) + 				(vector.x + tX) * (collider.rotFBR.z - collider.rotBBR.z)) / 2;				float rArea = Math.abs(collider.rotFBL.x * (collider.rotBBL.z - (vector.z + tZ)) + 				collider.rotBBL.x * ((vector.z + tZ) - collider.rotFBL.z) + 				(vector.x + tX) * (collider.rotFBL.z - collider.rotBBL.z)) / 2;				float tArea = Math.abs(collider.rotBBL.x * (collider.rotBBR.z - (vector.z + tZ)) + 				collider.rotBBR.x * ((vector.z + tZ) - collider.rotBBL.z) + 				(vector.x + tX) * (collider.rotBBL.z - collider.rotBBR.z)) / 2;				float bArea = Math.abs(collider.rotFBL.x * (collider.rotFBR.z - (vector.z + tZ)) + 				collider.rotFBR.x * ((vector.z + tZ) - collider.rotFBL.z) + 				(vector.x + tX) * (collider.rotFBL.z - collider.rotFBR.z)) / 2;				float fullArea = lArea + bArea + rArea + tArea;		float fullBoxArea = collider.xScale * collider.zScale;		//System.out.println("full area = " + fullArea);		//System.out.println("box area = " + fullBoxArea);				if (fullArea > fullBoxArea) {			return false;		}				return true;			}``

now what im doing here is dividing the square into 4 triangle, where the point of the triangle is the target position, then what i do is calculate the area of my square, and the area of all the triangles, if the area of the calculated triangles is greater than the square then the position is ouside the box, if it is equal then it is is inside.

to be honest im not sure what could be wrong, as i believe i have calculated the areas properly, i seem to slightly glitch inside it if i spend a while rubbing up against it, also i tested it walking ontop of the box and there seemed to be a fall through point just around the centre next to each face, so im guessing that when the target coordinate was at that point it lets me glitch through any insight would be really helpful with this as its driving me crazy!

i can also provide the source code if anyone wants to look deeper into it, im using eclipse as my workspace
5
##### Electronic and Computer Section / html issues
October 24, 2012, 11:41:50 pm
ok i have a new assignment for another website design at college, i have dove a little more into html this time, and i have a few issues, first this is my a littlye bit of code i was testing with:
``<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Untitled Document</title><link href="css/main.css" rel="stylesheet" type="text/css"></head><body class="body"><img src="assets/page_top.png" width="951" height="23" class="body_image"><img src="assets/page_body.png" width="951" height="28" class="body_image"><img src="assets/page_bottom.png" width="951" height="26"></body></html>``

so i am drawing 3 images here, the top of the page, the body, and the bottom, previously i was writing my code in html 5, i came across a problem if i separated my images into lines like so:
``<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Untitled Document</title><link href="css/main.css" rel="stylesheet" type="text/css"></head><body class="body"><img src="assets/page_top.png" width="951" height="23" class="body_image"><img src="assets/page_body.png" width="951" height="28" class="body_image"><img src="assets/page_bottom.png" width="951" height="26"></body></html>``

my images would have a slight break in between each other, i have had this problem in the past but i resulted in inserting them in divs and reducing the y value of the div, resulting in different behaviors depending on the browser, as that is not practical i have looked further into the issue, currently i have changed my code to HTML 4.01 Transitional, now when i use this html type i get the same behavior when formatting the code like such, but if i have it all grouped like seen in the first code i dont get the breaks between images, which is what i want, but i was wondering what could be causing this, as it would be easier for me in the long run to format my code in such a way that is readable, also it would be good to know the benefits/differnces between the html types as i dont have a clue and im just going with any as of now:P
6
##### Script Troubleshooting / can i treat text in a text file like a variable?
October 20, 2012, 07:56:28 am
hey there, i was wondering if it is possible to use text within text files like variables, i am creating a custom scene that chooses the the text file to get information from depending on window id and page number, my text files are named like so: "file 1 1.txt" so that would be the window with the id of 1 at page 1, the reason i am mainly using the text files is that i am creating a large text field so it is easier to write the text in the text file and load it correspondingly, the windows also have other settings stored in arrays obtained from cases, so as you can tell i need to put a case in a case to get the right settings, example:
``case id when 0  case page  when 0 then []  when 1 then []  endwhen 1  case page  when 0 then []  when 1 then []  endend``

so as you can see this method gets a bit messy after a while, and a little hard to keep track of stuff, so as i am already using a text file to store the text in would it be possible to create and read my arrays from my text file? so essentially i would dedicate the first few lines in the text file for variables, and use the rest for actual text strings, the method i am using to get my text file:
``@text_file = IO.readlines("file #{@id} #{@page}.txt")``

edit:
ok after been a little more clear headed today i think i came up with a pretty correct sollution, the main problem i was having is that the array that i was creating could be expended, for example i config image properties like so: [x, y, "NAME", opacity] then they go inside an array, and it can be expanded to the users desire to draw as many images as they like, then the second problem was that there is a string aswell as integers, anyway this is the method i came up with if anybody is interested, i think i went about it a pretty correct way, if anyone thinks otherwise let me know of a better sollution
``def change_lore    #directory name    directory = "lore items"    #create directory if it doesnt exist    unless File.directory?(directory)      Dir.mkdir(directory)    end    #get filename depending on id and page    filename = "lore #{@lore_id} #{@page_number}.txt"    #the path to the file    path = ".\\#{directory}\\" + filename    #if the file exists    if FileTest.exist?(path)      #store the file      @lore_file = IO.readlines(path)      #setup picture config array      @picture_config = []      #get line in text document for picture config      config_line = @lore_file[1]      p config_line      #turn it into an array of strings      config = config_line.gsub!(/[\[\]]/,'').split(/\s*,\s*/)      p config      #loop amount of images configured      for i in 0...(config.size / 4)        #create the images config shell        @picture_config[i] = []        #loop through each configs string        for j in (i * 4)...((i * 4) + 4)          #if it is other that the string turn it into an integer          if j != (i * 4) + 2            @picture_config[i].push(config[j].to_i)          #if it is the string leave it as a string          else            @picture_config[i].push(config[j])          end        end      end      #print final result      p @picture_config    #print error if no text file found    else      print "NO TEXT FILE FOUND FOR CURRENT ITEM/PAGE"      exit    end  end``

the line in my text file was like so "[0, 0, 0020, 255], [0 ,0, 0020, 255]" and it ended up like so [[0, 0, "0020", 255], [0 ,0, "0020", 255]]
7
##### Script Troubleshooting / is there a way to stop full screening or change the size it fulscreens too?
September 14, 2012, 01:02:30 am
hey, the title pretty much says it all, basicly i have reduced the size of my games window to 358 X 320 , and changed the viewports to 352 X 288 this is for a pokemon game, basicly i found the viewports way to large for the tilesets and depth perception of pokemon games, so the question arises can i stop the rgss player from full screening or edit the values it fullscreens to? right now if i full screen i get a horrible black border as my viewport is dramaticly decreased, then if i return from the fullscreen the rgss player returns to its default size of 640 X 480, im guessing some of the core scripts of the rgss player would have to be edited right? if so is there a way, and how would i go about doing this?
8
##### Script Troubleshooting / help with deleting array from array
August 31, 2012, 07:57:03 pm
hey there, i have been making a script to manage pushing movable object, the main part of it is changing the events previous x and y as unpassable until the event has finished moving, this is so that the event cant be spammed and so the graphics doesnt overlap the player while its moving to the next tile, heres my script:
``class Interpreter  #--------------------------------------------------------------------------  # * push_object(event to push)  #--------------------------------------------------------------------------  def push_object(event_id)    #set event to push    event = \$game_map.events[event_id]    # store x and y    old_x, old_y = event.x, event.y    #push the info into array    \$game_system.movable_object.push([event_id, old_x, old_y])    p \$game_system.movable_object    #p \$game_system.movable_object    #event move down if player direction is 2 and event can enter the tile    event.move_down if \$game_player.direction == 2 &&       \$game_map.passable?(event.x, event.y + 1, 8)    #event move left if player direction is 4 and event can enter the tile    event.move_left if \$game_player.direction == 4 &&       \$game_map.passable?(event.x - 1, event.y, 6)    #event move right if player direction is 6 and event can enter the tile    event.move_right if \$game_player.direction == 6 &&       \$game_map.passable?(event.x + 1, event.y, 4)    #event move up if player direction is 8 and event can enter the tile    event.move_up if \$game_player.direction == 8 &&       \$game_map.passable?(event.x, event.y - 1, 2)    return unless event.moving?    #play the push sound if the event is moving    \$game_system.se_play(RPG::AudioFile.new("bump"))  endend###class Game_System  attr_accessor :movable_object  alias init_push initialize  def initialize    init_push    @movable_object = []  endend###class Game_Player  def passable?(x, y, d)    # Get new coordinates    new_x = x + (d == 6 ? 1 : d == 4 ? -1 : 0)    new_y = y + (d == 2 ? 1 : d == 8 ? -1 : 0)    array = \$game_system.movable_object    p array    for event in \$game_map.events.values      #p array      if array.include?([event.id, new_x, new_y])        return false if event.moving?        array.delete([event.id, new_x, new_y) if \$game_map.events[event.id].moving? == false      end    end    # If coordinates are outside of map    unless \$game_map.valid?(new_x, new_y)      # Impassable      return false    end    # If debug mode is ON and ctrl key was pressed    if \$DEBUG and Input.press?(Input::CTRL)      # Passable      return true    end    super  endend``

this code works fine, my main question is about how im deleting the array, at the moment its only deleting the array if i am entering the tile that was locked, i think the best way would be to delete any array if the asociated event is not moving, i did try it like this:
``for i in 0...array.size          array.delete(array[i]) if array[i][0] == event.id &&            \$game_map.events[event.id].moving? == false        end``

but that didnt work
9
##### Script Troubleshooting / [xp]playing sounds using the built in functions?
August 31, 2012, 01:07:19 am
hey there guys, it is confusing me on how i exactly use a script call to play a sound from inside a script, for example i can play a sound using the following :

\$game_system.se_play(\$data_system.cancel_se)

and that will play the cancel sound in the database, but what if i want to use that function to play a sound i want it to play?
looking at interpreter to see how an event does it is useless as i get this:
\$game_system.se_play(@parameters[0])
and i have no idea on the structure of that parameter, i can play a sound like so:
Audio.se_play("Audio/SE/" + "sound", VOL, PITCH)
but what i really want to do is know how to use the \$game_system.se_play function
edit:
ok looking through the help file i found i need to use: RPG::AudioFile
i applyed it like this: RPG::AudioFile.new("sound")
so i have managed to set the sound with the method i wanted, but say i wanted to be really anal and set the sound name and pitch but leave  the volume as default how would i apply it? e.g: RPG::AudioFile.new("sound", DEFAULT, 150)
10
##### General Discussion / my real time animated menu
August 06, 2012, 03:29:29 am
hi there guys, i have been currently been developing a real time one player menu for my rmx-os project, so i was wondering what people thought of it, its nowhere near complete, i plan on making the windows images and having the menu selections as images etc, but i was mainly wondering what people thought of the structure of it alas here it is:
11
##### RMXP Script Database / [XP] Advanced Swimming System
July 14, 2012, 04:06:42 am
Authors: Diagostimo
Version: 1.0
Type: Custom Movement System
Key Term: Custom Movement System

Introduction

This script will allow you to setup terrain tags that enable you to swim upon, once you are swimming on the tile it the becomes passible until you leave the water.

Features

• set terrain tags to swim uppon

• press C button to enter water

• changes graphic of the character when swiming

• enable/dissable oxegen, also choose between oxegen being dispalyed as a bar or images

Screenshots

Spoiler: Show

Demo

http://www.mediafire.com/?3uju8c2s3l8vaaw

Script

Spoiler: Show
``################################################################################ CREDITS TO DIAGOSTIMO FOR THE CREATION OF THIS SCRIPT################################################################################~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~## #                     B E G I N  C O N F I G U R A T I O N##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#module Swim_Config=begin  #-=-=-=-=-=-=-=-=-=-=-#  # * script calls      #  #-=-=-=-=-=-=-=-=-=-=-#  #changes the value of oxegen pictures if PICTURE_MODE is true  \$game_system.oxegen_pictures = VALUE    #changes the max oxegen when bar mode is active  \$game_system.oxegen_max = VALUE  #-=-=-=-=-=-=-=-=-=-=-#  # * end script calls  #  #-=-=-=-=-=-=-=-=-=-=-#=end  #Extension of the filename to change the swimming graphic  SWIM_EXTENSION = '_swim'  #Terrain tag of water to swim on  WATER_TERRAIN = 2  #oxegen timer when in water (true/false)  OXEGEN_TIMER = true  #picture mode if true, bar mode if false  PICTURE_MODE = true  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#  # * if oxegen timer is true                                               #  #-------------------------------------------------------------------------#  # * if the picture mode is true                                           #  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#  #Picture name of the oxegen picture to show  PICTURE_NAME = 'bubble'  #initial amount of oxegen pictures  PICTURES = 5  #how many frames does it take for 1 oxegen picture to disapear?  PICTURE_FRAMES = 100  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#  # * if the picture mode is not true (bar mode)                            #  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#  #how many initial oxegen blocks(pixles) are there?   OXEGEN = 100  #the frame rate each oxegen block(pixle) decreases  OXEGEN_COUNT = 10end#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~## #                     E N D   C O N F I G U R A T I O N##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~##-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-## * class Game_System                                                     #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#class Game_System  attr_accessor :oxegen_picture_count  attr_accessor :oxegen_pictures  attr_accessor :oxegen_max  attr_accessor :oxegen  attr_accessor :oxegen_count  alias init_swim initialize  def initialize    init_swim    @oxegen_picture_count = 0    @oxegen_pictures = Swim_Config::PICTURES    @oxegen_max = Swim_Config::OXEGEN    @oxegen = @oxegen_max    @oxegen_count = Swim_Config::OXEGEN_COUNT  endend#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-## * class Game_Player                                              #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#class Game_Player < Game_Character  attr_accessor :character_nameend#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-## * class Game_Map                                                 #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#class Game_Map    attr_accessor :passagesend#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-## * class Game_Character                                                   #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#class Game_Character  attr_reader :swimmingend#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-## * class Window_Oxegen                                                    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#class Window_Oxegen < Window_Base  def initialize    if Swim_Config::PICTURE_MODE == true      @image = RPG::Cache.picture(Swim_Config::PICTURE_NAME)      @oxegen_picture_amount = \$game_system.oxegen_pictures      super(0, 0, ((@image.width + 5) * \$game_system.oxegen_pictures) + 32, @image.height + 32)    else      super(0, 0, \$game_system.oxegen_max + 34, 7 + 32)    end    self.contents = Bitmap.new(width - 32, height - 32)    self.active = false    self.opacity = 0    self.visible = true    refresh  end  def refresh    self.contents.clear    if Swim_Config::PICTURE_MODE == true      if \$game_player.swimming == true        if @oxegen_picture_amount > -1          if \$game_system.oxegen_picture_count > 0            \$game_system.oxegen_picture_count -= 1          else            \$game_system.oxegen_picture_count = Swim_Config::PICTURE_FRAMES            @oxegen_picture_amount -= 1          end          for i in 0 ... @oxegen_picture_amount            rect = Rect.new(0, 0, @image.width, @image.height)            self.contents.blt(0 + (@image.width + 5) * i, 0, @image, rect, 255)          end        else          \$game_temp.gameover = true        end      else        @oxegen_picture_amount = \$game_system.oxegen_pictures      end    else      if \$game_player.swimming == true        rect = Rect.new(0, 0, \$game_system.oxegen_max + 2, 7)        bitmap = Bitmap.new(rect.width, rect.height)        bitmap.fill_rect(rect.x, rect.y, rect.width, rect.height, Color.new(0, 0, 0, 255))        self.contents.blt(0, 0, bitmap, rect)        if \$game_system.oxegen_count > 0 && \$game_system.oxegen > 0          \$game_system.oxegen_count -= 1        else          \$game_system.oxegen_count = Swim_Config::OXEGEN_COUNT          \$game_system.oxegen -= 1        end        if \$game_system.oxegen > 0          rect = Rect.new(0, 0, \$game_system.oxegen, 5)          bitmap = Bitmap.new(rect.width, rect.height)          bitmap.fill_rect(rect.x, rect.y, rect.width, rect.height, Color.new(0, 0, 255, 255))          self.contents.blt(1, 1, bitmap, rect)        else          \$game_temp.gameover = true        end         end    end  endend#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-## * class Scene_Map                                                  #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#class Scene_Map  alias main_swim main  def main    @oxegen_window = Window_Oxegen.new if Swim_Config::OXEGEN_TIMER == true    main_swim    @oxegen_window.dispose if Swim_Config::OXEGEN_TIMER == true  end  alias update_swim update  def update    if Swim_Config::OXEGEN_TIMER == true      @oxegen_window.refresh       if \$game_player.swimming == true        @oxegen_window.visible = true      else        @oxegen_window.visible = false      end    end    update_swim  endend#-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-## * class Game_Player                                                    #-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-#class Game_Player  EXTENSION = "_swim"  TERRAIN = 2    def change_water_passable(passage=0)    @water = []    (0...\$game_map.width).each {|x|      (0...\$game_map.height).each {|y|        [2, 1, 0].each {|i|           id = \$game_map.data[x, y, i]           @water << id if \$game_map.terrain_tags[id] == Swim_Config::WATER_TERRAIN    }}}    # This code will get all the possible tile id with     # water terrain tags    @water.each {|i|  \$game_map.passages[i] = passage  }    # then this code will change all the water passages  end    alias update_swim update  def update    if \$game_map.terrain_tag(@x, @y) != Swim_Config::WATER_TERRAIN      player = \$game_party.actors[0]      if @swimming == true        \$game_system.oxegen = \$game_system.oxegen_max if           Swim_Config::OXEGEN_TIMER == true && Swim_Config::PICTURE_MODE == false        change_water_passable(15)        orig_name = player.character_name.split(Swim_Config::SWIM_EXTENSION)        \$game_player.character_name = orig_name[0]        player.set_graphic(orig_name[0], player.character_hue, player.battler_name, player.battler_hue)        @step_anime = false        @swimming = false      end      if @direction == 2        if \$game_map.terrain_tag(@x, @y + 1) == Swim_Config::WATER_TERRAIN          if Input.trigger?(Input::C)            if Swim_Config::OXEGEN_TIMER && Swim_Config::PICTURE_MODE == true              \$game_system.oxegen_picture_count = Swim_Config::PICTURE_FRAMES            elsif Swim_Config::OXEGEN_TIMER == true && Swim_Config::PICTURE_MODE == false              #set bar timer            end            change_water_passable(0)            swim_graphic = player.character_name + Swim_Config::SWIM_EXTENSION            \$game_player.character_name = swim_graphic            player.set_graphic(swim_graphic, player.character_hue, player.battler_name, player.battler_hue)            @step_anime = true            @swimming = true            move_down          end        end      elsif @direction == 4        if \$game_map.terrain_tag(@x - 1, @y) == Swim_Config::WATER_TERRAIN          if Input.trigger?(Input::C)            \$game_system.oxegen_picture_count = Swim_Config::PICTURE_FRAMES            change_water_passable(0)            swim_graphic = player.character_name + Swim_Config::SWIM_EXTENSION            \$game_player.character_name = swim_graphic            player.set_graphic(swim_graphic, player.character_hue, player.battler_name, player.battler_hue)            @step_anime = true            @swimming = true            move_left          end        end      elsif @direction == 6        if \$game_map.terrain_tag(@x + 1, @y) == Swim_Config::WATER_TERRAIN          if Input.trigger?(Input::C)            \$game_system.oxegen_picture_count = Swim_Config::PICTURE_FRAMES            change_water_passable(0)            swim_graphic = player.character_name + Swim_Config::SWIM_EXTENSION            \$game_player.character_name = swim_graphic            player.set_graphic(swim_graphic, player.character_hue, player.battler_name, player.battler_hue)            @step_anime = true            @swimming = true            move_right          end        end      elsif @direction == 8        if \$game_map.terrain_tag(@x, @y - 1) == Swim_Config::WATER_TERRAIN          if Input.trigger?(Input::C)            \$game_system.oxegen_picture_count = Swim_Config::PICTURE_FRAMES            change_water_passable(0)            swim_graphic = player.character_name + Swim_Config::SWIM_EXTENSION            \$game_player.character_name = swim_graphic            player.set_graphic(swim_graphic, player.character_hue, player.battler_name, player.battler_hue)            @step_anime = true            @swimming = true            move_up          end        end      end    end    update_swim  endend``

Instructions

place above main and below default scripts, see the script for configuration

Compatibility

no known compatibility issues, please report any if found

Credits and Thanks

• Diagostimo for the creation of the script

• the demo contains templates i am unsure who created, if you feel there name needs credited just say

Author's Notes

use of this script in commercial games is prohibited, credit would be appreciated but not required.
12
##### Script Troubleshooting / is it possible to manipulate tile passibility via script?
July 13, 2012, 02:44:49 am
i was wondering if it is possible to manipulate the pasibility of tiles via script? the reason i need to do this is because im making a swimming script, heres the script:
``class Game_Character  attr_reader :swimmingendclass Game_Player  EXTENSION = "_swim"  TERRAIN = 2  alias update_swim update  def update    if \$game_map.terrain_tag(@x, @y) != TERRAIN      player = \$game_party.actors[0]      if @swimming == true        orig_name = player.character_name.split(EXTENSION)        \$game_player.character_name = orig_name[0]        player.set_graphic(orig_name[0], player.character_hue, player.battler_name, player.battler_hue)        @step_anime = false        @through = false        @swimming = false      end      if @direction == 2        if \$game_map.terrain_tag(@x, @y + 1) == TERRAIN          if Input.trigger?(Input::C)            swim_graphic = player.character_name + EXTENSION            \$game_player.character_name = swim_graphic            player.set_graphic(swim_graphic, player.character_hue, player.battler_name, player.battler_hue)            @step_anime = true            @swimming = true            @through = true            move_down          end        end      elsif @direction == 4        if \$game_map.terrain_tag(@x - 1, @y) == TERRAIN          if Input.trigger?(Input::C)            swim_graphic = player.character_name + EXTENSION            \$game_player.character_name = swim_graphic            player.set_graphic(swim_graphic, player.character_hue, player.battler_name, player.battler_hue)            @step_anime = true            @swimming = true            @through = true            move_left          end        end      elsif @direction == 6        if \$game_map.terrain_tag(@x + 1, @y) == TERRAIN          if Input.trigger?(Input::C)            swim_graphic = player.character_name + EXTENSION            \$game_player.character_name = swim_graphic            player.set_graphic(swim_graphic, player.character_hue, player.battler_name, player.battler_hue)            @step_anime = true            @swimming = true            @through = true            move_right          end        end      elsif @direction == 8        if \$game_map.terrain_tag(@x, @y - 1) == TERRAIN          if Input.trigger?(Input::C)            swim_graphic = player.character_name + EXTENSION            \$game_player.character_name = swim_graphic            player.set_graphic(swim_graphic, player.character_hue, player.battler_name, player.battler_hue)            @step_anime = true            @swimming = true            @through = true            move_up          end        end      end    end    update_swim  endend``

so as you can see it changes the player to through when swimming, this currently is a very impracticable way to go about it because say i want to put rocks in the water or cliffs outlining it i would be able to walk onto those tiles, if i could change the water tile to passible that would resolve that issue completly :/
13
##### Script Troubleshooting / quick question
July 01, 2012, 01:14:48 am
hey, i was wondering if it is possible to count how many objects are inside a self object in a module, ill give an example of what i mean:
``module Config  def self.whatever(id)    return case id        when 1 then []    when 2 then []    when 3 then []  endend ``

so what i was wanting to do is count how many objects are inside self.whatever(id), so in this case i would want it to return 3
i tryed it using a for statment like this:
``for i in Config.whatever.size``

then using i as the value but i just get an error with that
14
##### Script Troubleshooting / help making dynamic events for my script
June 28, 2012, 04:53:17 am
hey guys, i have been trying really hard to make dynamic events for my woodcutting and mining script, the way i want the events to work is when i cut a tree or rock is when the job has successfully been completed the tree changes to a stump, or the rock temp loses its ore, if anyone has played runescape they will know the effect im trying to capture.
i have sort of been able to get it to work, by using an attr_accessor, when the job is succesful it sets the accessor to true, then the event changes page, after the script has run, in the second page it checks two conditions, 1 that the cutting/mining timer is at 0, then the second branch it checks if the accessor is true, if its true it changes the graphic and sets a random respawn timer, if its false it changes back to the first page giving the effect that the job was not successful, heres the script as it stands and screenies of the event that runs the proccess:
``=begin------------HOW TO USE:------------  In an event, use a script call and by putting one of the following:      \$game_party.cut_tree(id)    \$game_party.mine_rock(id)    Where 'id' is the type of wood/rock you want to cut/mine depending on the  values configured in the Configuration below.    The script processes the animation and adds the EXP upon successful harvest.=end#---------------------------------------------------------------------------# Configuration for different types of trees and rocks to cut and mine.# Defines how long it takes to cut/mine, EXP gained, and level requirement.#---------------------------------------------------------------------------module Config    #wc xp to lvl 2  Wc_to_2 = 83  #mine xp to lvl 2  Mine_to_2 = 83    #woodcutting lvl inflation  Wc_inflation = 10  #mining lvl inflation  Mine_inflation = 10    #woodcutting extension  Wc_exten = '_hack'  #mining   Mine_exten = '_hack'    #set the filenames of the hatchet and pickaxe images  Hatchet_spr = 'hatchet'  Pickaxe_spr = 'pickaxe'    #set the filename of the mine and cutting sounds, you may need to add the   #file extension, i.e .mp3  Mine_sound = '042-Knock03'  Mine_vol = 100  Mine_pitch = 100    Cut_sound = '042-Knock03'  Cut_vol = 100  Cut_pitch = 100    #set the wait time between each swing, this will need editing depending on  #the length of the sound  Mine_wait_sound = 45  Cut_wait_sound = 45    def self.tree_setup(tree)    return case tree     #when TREE_ID then [MIN_WAIT_TIME, MAX_WAIT_TIME, EXP_GAINED, ITEM_GAINED,      #AMOUNT_ITEM_GAINED, LEVEL_REQUIRED]      when 1 then [60, 100, 5, 1, 1, 1, 100, 200]      when 2 then [40, 100, 10, 1, 2, 5, 100, 200]            else ''    end   end    def self.rock_setup(rock)    return case rock     #when ROCK_ID then [MIN_WAIT_TIME, MAX_WAIT_TIME, EXP_GAINED, ITEM_GAINED,      #AMOUNT_ITEM_GAINED, LEVEL_REQUIRED]      when 1 then [60, 100, 5, 2, 1, 1, 100, 200]      when 2 then [40, 100, 10, 2, 2, 5, 100, 200]            else ''    end   end  end#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~## #                     E N D   C O N F I G U R A T I O N##~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#~#class Game_Temp  attr_accessor :message_waiting  alias init_wait initialize  def initialize    init_wait    @message_waiting = false  endendclass Interpreter    def update    # Initialize loop count    @loop_count = 0    # Loop    loop do      # Add 1 to loop count      @loop_count += 1      # If 100 event commands ran      if @loop_count > 100        # Call Graphics.update for freeze prevention        Graphics.update        @loop_count = 0      end      # If map is different than event startup time      if \$game_map.map_id != @map_id        # Change event ID to 0        @event_id = 0      end      # If a child interpreter exists      if @child_interpreter != nil        # Update child interpreter        @child_interpreter.update        # If child interpreter is finished running        unless @child_interpreter.running?          # Delete child interpreter          @child_interpreter = nil        end        # If child interpreter still exists        if @child_interpreter != nil          return        end      end      # If waiting for message to end       if @message_waiting or \$game_temp.message_waiting  #<--edited here        return      end      # If waiting for move to end      if @move_route_waiting        # If player is forcing move route        if \$game_player.move_route_forcing          return        end        # Loop (map events)        for event in \$game_map.events.values          # If this event is forcing move route          if event.move_route_forcing            return          end        end        # Clear move end waiting flag        @move_route_waiting = false      end      # If waiting for button input      if @button_input_variable_id > 0        # Run button input processing        input_button        return      end      # If waiting      if @wait_count > 0        # Decrease wait count        @wait_count -= 1        return      end      # If an action forcing battler exists      if \$game_temp.forcing_battler != nil        return      end      # If a call flag is set for each type of screen      if \$game_temp.battle_calling or         \$game_temp.shop_calling or         \$game_temp.name_calling or         \$game_temp.menu_calling or         \$game_temp.save_calling or         \$game_temp.gameover        return      end      # If list of event commands is empty      if @list == nil        # If main map event        if @main          # Set up starting event          setup_starting_event        end        # If nothing was set up        if @list == nil          return        end      end      # If return value is false when trying to execute event command      if execute_command == false        return      end      # Advance index      @index += 1    end  end  end#---------------------------------------------------------------------------# * Game Actor# Creates woodcutting and mining attributes to the actor. Sets up the EXP chart# as well as set/get methods for their levels and EXP.#---------------------------------------------------------------------------class Game_Actor  attr_reader   :minelevel                  # mining level  attr_accessor   :mineexp                  # mining exp  attr_reader   :wclevel                    # woodcutting level  attr_accessor   :wcexp                    # woodcutting exp  #--------------------------------------------------------------------------  alias setup_mod setup  def setup(actor_id)    setup_mod(actor_id)    @minelevel = 1    @mineexp_list = Array.new(101)    make_mineexp_list    @mineexp = @mineexp_list[@minelevel]    #-------------------------------------    @wclevel = 1    @wcexp_list = Array.new(101)    make_wcexp_list    @wcexp = @wcexp_list[@wclevel]  end  #--------------------------------------------------------------------------  # * CALCULATE mine XP     #--------------------------------------------------------------------------  def make_mineexp_list     actor = \$data_actors[@actor_id]    @mineexp_list[1] = 0    @mineexp_list[2] = Config::Mine_to_2    for i in 3..100       if i > actor.final_level        @mineexp_list[i] = 0      else        @mineexp_list[i] = ((@mineexp_list[i-1] + @mineexp_list[2]) + (@mineexp_list[i-1] / Config::Mine_inflation))      end    end  end  #--------------------------------------------------------------------------  # * Change mine EXP  #     mineexp : new mine xp  #--------------------------------------------------------------------------  def mineexp=(mineexp)    @mineexp = [[mineexp, 9999999].min, 0].max    # Level up    while @mineexp >= @mineexp_list[@minelevel+1] and @mineexp_list[@minelevel+1] > 0      @minelevel += 1    end    # Level down    while @mineexp < @mineexp_list[@minelevel]      @minelevel -= 1    end  end  #--------------------------------------------------------------------------  # * Get mine EXP String  #--------------------------------------------------------------------------  def mineexp_s    return @mineexp_list[@minelevel+1] > 0 ? @mineexp.to_s : "-------"  end  #--------------------------------------------------------------------------  # * Get Next Level mine EXP String  #--------------------------------------------------------------------------  def next_mineexp_s    return @mineexp_list[@minelevel+1] > 0 ? @mineexp_list[@minelevel+1].to_s : "-------"  end  #--------------------------------------------------------------------------  # * Get Until Next Level mine EXP String  #--------------------------------------------------------------------------  def next_rest_mineexp_s    return @mineexp_list[@minelevel+1] > 0 ?      (@mineexp_list[@minelevel+1] - @mineexp).to_s : "-------"  end  #--------------------------------------------------------------------------  # * CALCULATE WC XP     #--------------------------------------------------------------------------  def make_wcexp_list     actor = \$data_actors[@actor_id]    @wcexp_list[1] = 0    @wcexp_list[2] = Config::Wc_to_2    for i in 3..100      if i > actor.final_level        @wcexp_list[i] = 0      else        @wcexp_list[i] = (Config::Wc_inflation*(i-1) + @wcexp_list[i-1])      end    end  end  #--------------------------------------------------------------------------  # * Change WC EXP  #     wcexp : new WC EXP  #--------------------------------------------------------------------------  def wcexp=(wcexp)    @wcexp = [[wcexp, 9999999].min, 0].max    # Level up    while @wcexp >= @wcexp_list[@wclevel+1] and @wcexp_list[@wclevel+1] > 0      @wclevel += 1    end    # Level down    while @wcexp < @wcexp_list[@wclevel]      @wclevel -= 1    end  end  #--------------------------------------------------------------------------  # * Get WC EXP String  #--------------------------------------------------------------------------  def wcexp_s    return @wcexp_list[@wclevel+1] > 0 ? @wcexp.to_s : "-------"  end  #--------------------------------------------------------------------------  # * Get Next Level WC EXP String  #--------------------------------------------------------------------------  def next_wcexp_s    return @wcexp_list[@wclevel+1] > 0 ? @wcexp_list[@wclevel+1].to_s : "-------"  end  #--------------------------------------------------------------------------  # * Get Until Next Level WC EXP String  #--------------------------------------------------------------------------  def next_rest_wcexp_s    return @wcexp_list[@wclevel+1] > 0 ?      (@wcexp_list[@wclevel+1] - @wcexp).to_s : "-------"  end    end#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=## *Game_Player (activate/deactivate step_anime)# Also processes the action of cutting and mining#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#class Game_Player < Game_Character  attr_accessor :step_anime, :old_count, :wc_count, :mine_count, :character_name    def initialize    super    @old_count, @wc_count, @mine_count = 0, 0, 0  end    alias call_update_after_counting_down_timers update  def update    if @wc_count > 0 or @mine_count > 0      super      # A direction was pressed or canceled      if Input.dir4 != 0 or Input.trigger?(Input::B)        @old_count, @wc_count, @mine_count = 0, 0, 0        \$game_party.finalize(false) # Failed to complete task        return      end      if @wc_count == @old_count - Config::Cut_wait_sound        @old_count = @wc_count        Audio.se_play("Audio/SE/" + Config::Cut_sound, Config::Cut_vol, Config::Cut_pitch)      end      if @mine_count == @old_count - Config::Mine_wait_sound        @old_count = @mine_count        Audio.se_play("Audio/SE/" + Config::Mine_sound, Config::Mine_vol, Config::Mine_pitch)      end      @wc_count -= 1 if @wc_count > 0      @mine_count -= 1 if @mine_count > 0      # Call the last steps when cutting/mining completes      \$game_party.finalize(true) if (@wc_count == 0 and @mine_count == 0)    else      call_update_after_counting_down_timers    end  endend#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=## *Game_Party# Controls the majority of cutting/mining functions#=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=#class Game_Party  attr_accessor :cutting, :mining, :taskcomp, :randomizer    alias init_before_cutting_mining initialize  def initialize    init_before_cutting_mining    @cutting = false    @mining = false    @taskcomp = false    @object = nil  end    def cut_tree(id)    @object = Config.tree_setup(id)    randomizer = @object[0] + rand(@object[1] + 1 - @object[0])    @actors.each{|actor| \$game_player.wc_count = (randomizer * 2 - 1) if actor.wclevel >= @object[5] }    for i in 0...\$game_party.actors.size      actor = \$game_party.actors[i]      if actor.wclevel < @object[5]        lvl = @object[5].to_s        \$game_temp.message_waiting = true        \$game_temp.message_proc = Proc.new { \$game_temp.message_waiting = false }        \$game_temp.message_text = "you need to be lvl " + lvl + " to cut this tree"      end    end    \$game_player.old_count = \$game_player.wc_count    return if \$game_player.wc_count == 0    @cutting = true    player = @actors[0]    mine_graphic = player.character_name + Config::Wc_exten    \$game_player.character_name = mine_graphic    player.set_graphic(mine_graphic, player.character_hue, player.battler_name, player.battler_hue)    \$game_player.step_anime = true  end    def mine_rock(id)    @object = Config.rock_setup(id)    randomizer = @object[0] + rand(@object[1] + 1 - @object[0])    @actors.each{|actor| \$game_player.mine_count = (randomizer * 2 - 1) if actor.minelevel >= @object[5] }     for i in 0...\$game_party.actors.size      actor = \$game_party.actors[i]      if actor.minelevel < @object[5]        lvl = @object[5].to_s        \$game_temp.message_waiting = true        \$game_temp.message_proc = Proc.new { \$game_temp.message_waiting = false }        \$game_temp.message_text = "you need to be lvl " + lvl + " to mine this rock"      end    end    \$game_player.old_count = \$game_player.mine_count    return if \$game_player.mine_count == 0    @mining = true    player = @actors[0]    mine_graphic = player.character_name + Config::Mine_exten    \$game_player.character_name = mine_graphic    player.set_graphic(mine_graphic, player.character_hue, player.battler_name, player.battler_hue)    \$game_player.step_anime = true  end  def finalize(task_completed)    type = 1 if @cutting    type = 2 if @mining    player = @actors[0]    if type == 1      orig_name = player.character_name.split(Config::Wc_exten)    else #type == 2      orig_name = player.character_name.split(Config::Mine_exten)    end    \$game_player.character_name = orig_name[0]    player.set_graphic(orig_name[0], player.character_hue, player.battler_name, player.battler_hue)    \$game_player.step_anime = false    @cutting, @mining = false, false    return unless task_completed    @taskcomp = true    # Reward EXP to the actors with high enough levels    if type == 1      @actors.each{|a| a.wcexp += @object[2] if a.wclevel >= @object[5] }      \$game_party.gain_item(@object[3], @object[4])    else #type == 2      @actors.each{|a| a.mineexp += @object[2] if a.minelevel >= @object[5] }      \$game_party.gain_item(@object[3], @object[4])    end  endend#==============================================================================# ** Sprite_Character# Editted to include the hatchet and pickaxe sprites#==============================================================================class Sprite_Character < RPG::Sprite  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    super    # If tile ID, file name, or hue are different from current ones    if @tile_id != @character.tile_id or       @character_name != @character.character_name or       @character_hue != @character.character_hue      # Remember tile ID, file name, and hue      @tile_id = @character.tile_id      @character_name = @character.character_name      @character_hue = @character.character_hue      # If tile ID value is valid      if @tile_id >= 384        self.bitmap = RPG::Cache.tile(\$game_map.tileset_name,          @tile_id, @character.character_hue)        self.src_rect.set(0, 0, 32, 32)        self.ox = 16        self.oy = 32      # If tile ID value is invalid      else        self.bitmap = RPG::Cache.character(@character.character_name,          @character.character_hue)        if @character_name == \$game_player.character_name and             (\$game_party.cutting or \$game_party.mining)          RPG::Cache.clear          type = (\$game_party.cutting ? Config::Hatchet_spr : Config::Pickaxe_spr)          src_bitmap = RPG::Cache.character(type, 0)          self.bitmap.blt(0, 0, src_bitmap, Rect.new(0,0,src_bitmap.width,src_bitmap.height))         end        @cw = bitmap.width / 4        @ch = bitmap.height / 4        self.ox = @cw / 2        self.oy = @ch      end    end    # Set visible situation    self.visible = (not @character.transparent)    # If graphic is character    if @tile_id == 0      # Set rectangular transfer      sx = @character.pattern * @cw      sy = (@character.direction - 2) / 2 * @ch      self.src_rect.set(sx, sy, @cw, @ch)    end    # Set sprite coordinates    self.x = @character.screen_x    self.y = @character.screen_y    self.z = @character.screen_z(@ch)    # Set opacity level, blend method, and bush depth    self.opacity = @character.opacity    self.blend_type = @character.blend_type    self.bush_depth = @character.bush_depth    # Animation    if @character.animation_id != 0      animation = \$data_animations[@character.animation_id]      animation(animation, true)      @character.animation_id = 0    end  endend``

Spoiler: Show

Spoiler: Show

so you can generally see whats happening here, the problem is say i go to cut another tree/rock after just cutting one, then i imediatly walk away from it without completing the harvest, because the previous tree/rock set the attr_accessor to true and doesnt set it to false until the event has finished processing the tree/rock that i didnt harvest acts as if i did and changes thec graphic and sets the wait timer, i also had an idea to make the script to change the self switch manually but i couldnt get that to work
any help is apreciated

edit: ok i sort of got it to manually change the self switch of the events, what i did was add this to the update in interpreter:
``if \$game_player.wc_count or \$game.player.mine_count == 0      if \$game_party.taskcomp == true        # If event ID is valid        if @event_id > 0          # Make a self switch key          key = [\$game_map.map_id, @event_id, 'A']          # Change self switches          \$game_self_switches[key] = true          \$game_party.taskcomp = false        end        # Refresh map        \$game_map.need_refresh = true        # Continue        return true      end    end``

theres only one problem with this, if there is a parrallel proccess event running then event id becomes that one instead of the event that is currently calling the script, and i cant figure a way around this
15
##### Script Troubleshooting / script call for event direction?
June 16, 2012, 12:16:59 am
hey, im trying to change the direction an event is facing depending on which way it is currently facing, through looking through the interpreter i found out how to change its direction, but i can find any method to check what direction it is curently facing, im trying to achieve this in the interpreter class under a new call: heres what i have so far:
``class Interpreter  def respawn_wait    if \$game_party.randomizer > 0      character = get_character(0)      if #character is facing down        character.turn_left      else        character.turn_up      end      @wait_count = \$game_party.randomizer      end   endend``

so ye i need to replace #character is facing down with something that checks the direction
16
##### Script Troubleshooting / how to check an attr variables value from outside its class?
June 13, 2012, 07:58:12 pm
hey guys im pretty stumped on this one, i have been trying to check an attr variables value within an if stament in a seperate class, so say i have got this class:
``class Interpreter  attr_accessor :variable``

i have tried checking the value in the following ways:
``class New_Class  \$interpreter::variable  \$interpreter.variable  var = Interpreter.new  var::variable  var.variableend``

so far i have had no success on checking the value
17
##### Script Troubleshooting / a problem with changing the actors graphic
June 11, 2012, 01:49:04 am
ok in my script i have a line of code that gets the current graphic of the player, then it adds "_hack" onto the end of it, the problem i am getting is that when i come to turn \$cutting on which changes the graphic as seen in the script below i get an undefined method for '+'
``class Game_Player  alias update_new update  def update    update_new    a = \$game_actors[1]    if \$cutting == true      oldgraphic = a.character_name      a.set_graphic((a.character_name + "_hack"), a.character_hue, a.battler_name, a.battler_hue)      @step_anime = true    else       a.set_graphic(oldgraphic, a.character_hue, a.battler_name, a.battler_hue)      @step_anime = false    end  endend``

i have tried it a few other similar ways but i keep getting errors, does anyone know how i can add it onto the end sucessfully?
18
##### Resource Requests / [xp]request for a woodcutting/mining sprite template
June 10, 2012, 05:58:09 am
hey there, so ye the title pretty much says what i want, if some fabulous artist could find the time that would be great and credits will be given i want a sprite template that emulates a swinging motion for wood cutting and mining, i have a template here that matches the style that i want it to portray:
Spoiler: Show

again thanks to anyone who picks this up
edit:
i dont require actual tools to be in the characters hand, just the poses are all
19
##### Script Troubleshooting / custom skills?
June 07, 2012, 09:09:30 pm
hi guys, i have been trying to create a custom skill in my game, and i have based it on how the characters lvl is built in game_actor, so here is my code at the moment:
Spoiler: Show
``#---------------------------------------------------------------------------# *create new skills#---------------------------------------------------------------------------class Game_Actor    attr_reader   :wclevel                    # wood cutting level  attr_reader   :wcexp                      # wood cutting exp  alias setup_mod setup  def setup(actor_id)    setup_mod(actor_id)    #------------------------------    @wclevel = 1    @wcexp_list = Array.new(101)    make_wcexp_list    @wcexp = @wcexp_list[@wclevel]    #------------------------------  end    #--------------------------------------------------------------------------  # * CALCULATE WC EXP     #--------------------------------------------------------------------------  def make_wcexp_list    actor = \$data_actors[@actor_id]    @wcexp_list[1] = 0    pow_i = 2.4 + 35 / 100.0    for i in 2..100      if i > 99        @wcexp_list[i] = 0      else        n = 1 * ((i + 3) ** pow_i) / (5 ** pow_i)        @wcexp_list[i] = @wcexp_list[i-1] + Integer(n)      end    end  endend#----------------------------------------------------------------------------# * draw wc level and exp#----------------------------------------------------------------------------class Window_Base  def draw_actor_wclevel(actor, x, y)    self.contents.font.color = system_color    self.contents.draw_text(x, y, 32, 32, "WC")    self.contents.font.color = normal_color    self.contents.draw_text(x + 32, y, 24, 32, actor.wclevel.to_s, 2)  end    def draw_actor_wcexp(actor, x, y)    self.contents.font.color = system_color    self.contents.draw_text(x, y, 32, 32, "exp")    self.contents.font.color = normal_color    self.contents.draw_text(x + 32, y, 24, 32, actor.wcexp.to_s, 2)  end    end#----------------------------------------------------------------------------# * draw wc level and xp in the menu#----------------------------------------------------------------------------class Window_MenuStatus    alias refresh_mod refresh  def refresh    refresh_mod    \$game_party.actors.each_index {|i|      draw_actor_wclevel(\$game_party.actors[i], 310, 0)}    \$game_party.actors.each_index {|i|      draw_actor_wcexp(\$game_party.actors[i], 370, 0)}  endend``

i can get the values to show in the window i set them to, im at the point in trying to add exp to the the skill to see if it lvls up corectly, but i get an error when i try adding to it, heres what im using to add the xp:
``exp = 100      for i in 0...\$game_party.actors.size      actor = \$game_party.actors[i]              last_wclevel = actor.wclevel        actor.wcexp += exp      end``

im not sure if i have set up the exp right but as i can see from how it is setup in game_actors and how it adds it in Scene_battle it should work
20
##### Script Requests / script call for button input?
June 05, 2012, 08:41:17 pm
hey guys, i was wondering if there is a script call that checks if any input button is pressed? mainly for use in a conditional branch so if the player moves or anything then the condition can run.
21
May 15, 2012, 08:40:53 am
hey guys, i have been assigned a assesment at college to produce a website for a buisness purpose, im not very farmiliar with web building but after messing around im getting the hang of it, so im using dreamweaver to build my website with, the main trouble im having at the minute is choosing what size to draw my images at, take this image for example:

Spoiler: Show

this is a mock up of the top border of the page, the trouble im having is getting it to stay centered when opened in a browser, the way i have tried to do it is give it  have so many pixel offset on the left and right according to my resolution(i have a notebook so the resolution is pretty low) but when i open the html on another comp with a higher resolution i end up with a horrible gap on the right hand side, i know its due to the resolution difference, im just wondering if there is a way for me to force the image to stay centered no matter the resolution?

also for reference what image programs do people use? i have been using fireworks as its great for creating textures and shapes, but i feel it lacks actual control over the images, or im just not good enough with it yet
22
##### Sea of Code / [resolved]help with macro in excel
April 28, 2012, 09:28:12 pm
hey guys, so i need a little help with a macro for excel, i have got it to do what i want it to do but i want to restrict it, heres the code for the macro:
Spoiler: Show
``Sub Macro1()    Dim t    t = Split(Worksheets("Sheet1").Range("d5").Text, "/")    t(0) = Format(t(0) + 1, "0")    Worksheets("Sheet1").Range("d5") = Join(t, "/")'End SubSub Macro2()    Dim t    t = Split(Worksheets("Sheet1").Range("d5").Text, "/")    t(0) = Format(t(0) - 1, "0")    Worksheets("Sheet1").Range("d5") = Join(t, "/")'End Sub '``

so macro1 +1 to d5 and macro 2 subtracts 1, the restriction i want to put onto it is say d5 = 0 i dont want to be able to subtract from it, i want to put a maximum restriction on it to so say d5 = 20 i dont want it to be able to add any more to it, is it possibe to do something like this with macro's???
edit:
figured out how to do it, for whoever it mat concern the code now looks like this:
Spoiler: Show
``Sub Macro1()    Dim t    t = Split(Worksheets("Sheet1").Range("d5").Text, "/")    If Not t(0) = 5 Then      t(0) = Format(t(0) + 1, "0")      Worksheets("Sheet1").Range("d5") = Join(t, "/")    End If'End SubSub Macro2()    Dim t    t = Split(Worksheets("Sheet1").Range("d5").Text, "/")    If Not t(0) = 0 Then      t(0) = Format(t(0) - 1, "0")      Worksheets("Sheet1").Range("d5") = Join(t, "/")    End If'End Sub '``
23
##### Script Troubleshooting / diagostimo's rgss noob questions
April 17, 2012, 06:37:29 am
hey guys, i have been trying to impliment an updating word on a window when the index changes, heres what i got:
``def refresh    if @index = 193     self.contents.clear     self.contents.font.color = normal_color     self.contents.font.size = 20     cx = contents.text_size("test 1").width     self.contents.draw_text(0, 0, cx, 32, "test 1")     return   end   if @index = 174     self.contents.clear     self.contents.font.color = normal_color     self.contents.font.size = 20     cx = contents.text_size("test 2").width     self.contents.draw_text(0, 0, cx, 32, "test 2")     return     else     self.contents.clear   end  end``

so if the index is either of the said it should say the corisponding word, or if its else then there should be no text displayed, but say i start on index 193 when i call the scene, then change the word doesnt clear and stays the same, i want it to sort of work like the help window, but inside this window :/
24
##### RMXP Script Database / [XP] Customizable Map System
March 11, 2012, 01:23:35 am
Customizable Map System
Authors: Diagostimo
Version: 1.4
Type: Custom Environment System
Key Term: Custom Environment System

Introduction

Hi there, here is my first ever script, so please don't be afraid to criticize, basically this script allows you to use a picture for your map, and setup pictures to show at locations, e.g zoomed images of towns ect. I do plan on adding a lot more to this script as my understanding in ruby gets better, so if you can think of any features that could be a good addition to this, don't hesitate to ask

Features

• use a custom picture as your main map image

• setup pictures to show at locations for zoomed town images ect

• customizable window size, and opacity for location windows

• call from an item or event

• configure names for locations

• completely customize text to your liking

• menu modifaction so the map can be called directly from the menu

• use a variable to direct where your cursor will start when calling the map

• customize text backs and back borders for the map window

• customize teleporting locations

• disable/enable teleport locations, teleport menu selection via script calls

• customize teleporting sound

• customize grid size and position of the map

Screenshots

Spoiler: Show

Spoiler: Show

Demo
http://www.mediafire.com/?bpy1yp7vf6ezcr4

Script

map script:
Spoiler: Show
``#last updated 3/6/2012#credits to diagostimo#comercial use prohibited#-------------##beging config##-------------#module Config  #notes when using this system:    #when making your background bear in mind that the window has an offset of 16    #pixles on all sides, this means that when the grids x and y are both 0 then    #they are actually 16 so always draw an image with a bordeline of 16 on all     #sides so it meets up with the grid properly        #also when setting the variable that controls the cursor position on the map,    #if you set it higher than the maximum index value of the map it will return     #0 when calling the scene.    #if you change the default grid settings then you will need to count how many    #index squares are on your grid, you can still use the index reference image as    #a reference, just note that it starts at 0 and increases linear    #setup how many grid squares wide and high the map is, the example used here  #gives it a width of 19 and a height of 14 in grid squares, this setup makes  #each square 32 by 32 pixles, say we double these values, so the width is 38   #and the height is 28, this will make each grid square 16 by 16 pixles comprende!  X_GRID = 19  Y_GRID = 14  # note if your grid is large then giving it an offset will make it go off screen  #this is intended for smaller grids  GRIDX_OFFSET = 0  GRIDY_OFFSET = 0  #this sets the total width for your grid, note the max width it can go is 608  #and the max height is 448, if you do set it higher then your map will simply go  #off the screen, your grid squares pixle size is also divided by these   #numbers, so say you set it to be 5 grid squares wide and the grid width is 608  #then a grid squares width is roughly 121, this is so you can make smaller grids  GRID_WIDTH = 608  GRID_HEIGHT = 448  #IMPORT ALL YOUR IMAGES TO THE PICTURES DIRECTORY!  #your main map's image name  MAP_NAME = 'map.png'  #here you can complete configure the text show when the cursor is at differnt  #locations on the map  #config whether you wish to use custom font, true or false  CUSTOM_FONT = false   #configure the name of the custom font  TEXT_FONT = 'Georgia'  #configure whether you wish to manually set the color of the text, true or false  CUSTOM_COLOR = true #when false default is white  # set the color of the text like so: [RED, GREEN, BLUE]min=0 max=255  SET_COLOR = [0, 0, 0]   #configure whether the text writen will be bold or not, true or false  BOLD_TEXT = true  #set the fonts size  FONT_SIZE = 25 #maximum size = 96  #set if you would like to use outlined text  OUTLINED_TEXT = true  #set if you would like to customize the color of the outline  OUTLINED_COLOR = true #when false default is black  # set the color of the outline: [red, green, blue]min=0 max=255  OUTLINED_COLOR_SET = [255, 255, 255]   #set to true to draw a box behind the text  TEXT_BACK = true  #set the color and opacity of the box  TEXT_BACK_COLOR = [255, 0, 0, 150]#[red, green, blue, opacity]  #set to true to give the box a border, only returns if back box = true  TEXT_BACK_BORDER = true #not functional  #set the color and opacity of the border  TEXT_BACK_BORDER_COLOR = [0, 0, 255, 255]#[red, green, blue, opacity]  #set to true to give the box a border  TEXT_BACK_BORDER = true #not functional  #set up the names that will be shown when the cursor is over locations,  #when 193 points at the index point of the map, refer to the index refernece  #image, config like so: when INDEX ID then [x, y , "TEXT"]  #just simply add a new line to configure a new location  #for index's not configured it will not return any text  def self.map_text(index)    return case index          when 193 then [6, 6, 'example text']      when 174 then [50, 50, 'example2 text']      #leave else, this returns no text if none is set      else ''    end   end  #here you configure the window that will show an image of the town you press  #the action button on  #define the windows [x, y, width, height] for your town images ect  WINDOW_SIZE = [112, 64, 416, 352]  #define the opacity of your towns windows(this does not effect the images)  #255=max, 0=min  WINDOW_OPACITY = 255  #configure the maps name that will be shown in the window, configure   #it exactly how you configured the text above, the index is set the same, it  #will show the text for the index point it is called from  def self.window_text(index)    return case index          when 193 then [30, 30, "example text"]      when 174 then [80, 50, "example text"]      #leave else, this returns no text if none is set      else ''    end   end  #config whether you wish to use custom font, true or false  W_CUSTOM_FONT = false   #configure the name of the custom font  W_TEXT_FONT = 'Georgia'  #configure whether you wish to manually set the color of the text, true or false  W_CUSTOM_COLOR = true #when false default is white  # set the color of the text like so: [RED, GREEN, BLUE]min=0 max=255  W_SET_COLOR = [0, 0, 0]   #configure whether the text writen will be bold or not, true or false  W_BOLD_TEXT = true  #set the fonts size  W_FONT_SIZE = 20 #maximum size = 96  #set if you would like to use outlined text  W_OUTLINED_TEXT = true  #set if you would like to customize the color of the outline  W_OUTLINED_COLOR = true #when false default is black  # set the color of the outline: [red, green, blue]min=0 max=255  W_OUTLINED_COLOR_SET = [255, 255, 255]   #set to true to draw a box behind the text  W_TEXT_BACK = true  #set the color and opacity of the box  W_TEXT_BACK_COLOR = [0, 0, 255, 100]#[red, green, blue, opacity]  #set to true to give the box a border, only returns if back box = true  W_TEXT_BACK_BORDER = true #not functional  #set the color and opacity of the border  W_TEXT_BACK_BORDER_COLOR = [255, 0, 0, 255]#[red, green, blue, opacity]  #to add a new image for an index point simply add a new line with the image's#name E.G you want to add a image for index 0 you would add this:#when 0 then 'IMAGE_NAME'#where IMAGE_NAME is the name of the image to show, use the index reference#image in the projects root folder for a reference of how the index is set-up  def self.image_name(index)    return case index          when 193 then 'pallettown.png'      when 174 then 'pallettown.png'      #leave else, this returns no window if no image is set        else ''    end  end  #set the [x, y, opacity] of the images, opacity max=255 min=0  IMAGE_XY = [0, 0, 255]    #set if tele window is enabled  #when the tele window is enabled a pre menu comes up before the map, asking if   #you wish to teleport or view location information  TELE_WINDOW = true    #below is the teleport setup, there are also script calls you can use to manipulate the  #teleport menu, here is a list of them:    #\$game_system.tele_disabled = true #disables the teleport menu selection  #\$game_system.tele_disabled = false #enables the teleport menu selection    #the following calls are used to disable individual locations:    #\$game_system.telearray.push(193)    #the above disables teleporting to index 193 if it has a teleport method setup    #\$game_system.telearray.delete(193)    #the above removes index 193 from the list of disabled locations    #end of script calls#    #setup teleport locations for index points: when INDEX then [id, x, y, direction]  #drections: 0 = retain, 2 = down, 4 = left, 6 = right, 8 = up  def self.tele_config(index)    return case index      when 155 then [3, 9, 7, 0]      when 174 then [2, 9, 7, 0]      when 193 then [1, 9, 7, 0]      #leave else, this disables teleporting at index's unasigned       else ''    end  end  #set if a custom sound should be played when teleporting  TELE_SOUND = true  #set the name of the sound file/this must be in the SE directory  #you may need to add the file extension depending on the format of the  #sound, i.e .mp3  TELE_NAME = '020-Teleport03'end#----------##END CONFIG##----------##==============================================================================# * game system teleporting addons#==============================================================================class Game_System    attr_accessor :tele_disabled       #tele menu disable  attr_accessor :telearray           #tele array to disable individual tele's    alias teleinit initialize  def initialize    teleinit    @tele_disabled = false    @telearray = []  end  end#==============================================================================# Bitmap Addon (Outlined Text)#==============================================================================class Bitmap  #----------------------------------------------------------------------------   # draw_text_full  #  x2    - x coordinate or rectangle  #  y2    - y coordinate or text  #  w2    - width or align  #  h2    - height  #  text2 - the text to be drawn  #  a2    - align  #  Draws outlines text.  #----------------------------------------------------------------------------   def draw_text_full(x2, y2, w2 = 0, h2 = 0, text2 = '', a2 = 0)    # set coordinates whether x2 is rectangle    if x2.is_a?(Rect)      x, y, w, h, text, a = x2.x, x2.y, x2.width, x2.height, y2, w2    else      x, y, w, h, text, a = x2, y2, w2, h2, text2, a2    end    # store font color    save_color = self.font.color.clone    # set font color to black    if Config::OUTLINED_COLOR == true      rgb = Config::OUTLINED_COLOR_SET      self.font.color = Color.new(rgb[0], rgb[1], rgb[2])    else      self.font.color = Color.new(0, 0, 0)    end    # draw outline    draw_text(x+1, y, w, h, text, a)    draw_text(x-1, y, w, h, text, a)    draw_text(x, y+1, w, h, text, a)    draw_text(x, y-1, w, h, text, a)    draw_text(x+1, y+1, w, h, text, a)    draw_text(x-1, y+1, w, h, text, a)    draw_text(x-1, y-1, w, h, text, a)    draw_text(x+1, y-1, w, h, text, a)    # restore font color    self.font.color = save_color    # draw normal text    draw_text(x, y, w, h, text, a)  endend#============================================================================# ** Window_Map#----------------------------------------------------------------------------class Window_MapMenu < Window_Base  attr_reader :index  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize    super(0, 0, 640, 480)    self.contents = Bitmap.new(width - 32, height - 32)    self.opacity = 0  end  #-------------------------------------------------------------------------  # * def index  #-------------------------------------------------------------------------  def index=(index)    @index = index    # Update cursor rectangle    update_cursor_rect    refresh  end  #-------------------------------------------------------------------------  # * def refresh  #-------------------------------------------------------------------------  def refresh    ctext = Config.map_text(@index) # a will be our temporary array    if ctext == ''      self.contents.clear    else      self.contents.clear      if Config::CUSTOM_FONT == true        self.contents.font.name = Config::TEXT_FONT      end      if Config::CUSTOM_COLOR == true        rgb = Config::SET_COLOR        self.contents.font.color = Color.new(rgb[0], rgb[1], rgb[2])      end      if Config::BOLD_TEXT == true        self.contents.font.bold = true      end      size = Config::FONT_SIZE      self.contents.font.size = (size)      cx = contents.text_size(ctext[2]).width      tx = contents.text_size(ctext[2]).height      if Config::TEXT_BACK == true        if Config::TEXT_BACK_BORDER == true          rect = self.contents.text_size(ctext[2])          bc = Config::TEXT_BACK_BORDER_COLOR          #border right          highlight_rect = Rect.new(rect.x, rect.y, 2, rect.height + 8)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(ctext[0] + rect.width + 4, ctext[1] - 4, bitmap, highlight_rect)          #border left          highlight_rect = Rect.new(rect.x, rect.y, 2, rect.height + 8)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(ctext[0] - 6, ctext[1] - 4, bitmap, highlight_rect)          #border bottom          highlight_rect = Rect.new(rect.x, rect.y, rect.width + 12, 2)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(ctext[0] - 6, ctext[1] + rect.height + 4, bitmap, highlight_rect)          #border top          highlight_rect = Rect.new(rect.x, rect.y, rect.width + 12, 2)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(ctext[0] - 6, ctext[1] - 6, bitmap, highlight_rect)          #draw back box          bc = Config::TEXT_BACK_COLOR          highlight_rect = Rect.new(rect.x, rect.y, rect.width + 8, rect.height + 8)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(ctext[0] - 4, ctext[1] - 4, bitmap, highlight_rect)        else          #draw back box          bc = Config::TEXT_BACK_COLOR          rect = self.contents.text_size(ctext[2])          highlight_rect = Rect.new(rect.x - 8, rect.y - 4, rect.width + 24, rect.height + 12)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(ctext[0] - 16, ctext[1] - 8, bitmap, highlight_rect)        end      end      if Config::OUTLINED_TEXT == true        self.contents.draw_text_full(ctext[0], ctext[1], cx, tx, ctext[2])      else        self.contents.draw_text(ctext[0], ctext[1], cx, tx, ctext[2])      end      if Config::BOLD_TEXT == true        self.contents.font.bold = false      end    end  end  #--------------------------------------------------------------------------  # * Cursor Rectangle Update  #--------------------------------------------------------------------------  def update_cursor_rect    gswidth = Config::GRID_WIDTH / Config::X_GRID    gsheight = Config::GRID_HEIGHT / Config::Y_GRID      x = Config::GRIDX_OFFSET + @index % Config::X_GRID * gswidth      y = Config::GRIDX_OFFSET + @index / Config::X_GRID % Config::Y_GRID * gsheight      self.cursor_rect.set(x, y, gswidth, gsheight)  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    super    telearray = []    # if enter is being pressed    if Input.trigger?(Input::C)      if Config::TELE_WINDOW == true        tele = Config.tele_config(@index)        if \$tele == 0          if tele == ''            # Play buzzer SE            \$game_system.se_play(\$data_system.buzzer_se)          else            if \$game_system.telearray.include?(@index)              # Play buzzer SE              \$game_system.se_play(\$data_system.buzzer_se)            else              # Play decision SE              \$game_system.se_play(\$data_system.decision_se)              #transfering is happening              \$scene = Scene_Map.new              \$game_temp.player_transferring = true              # Set player move destination              i = tele[0]              x = tele[1]              y = tele[2]              d = tele[3]              \$game_temp.player_new_map_id = i              \$game_temp.player_new_x = x              \$game_temp.player_new_y = y              \$game_temp.player_new_direction = d              # Prepare for transition              Graphics.freeze              # Set transition processing flag              #\$game_temp.transition_processing = true              #\$game_temp.transition_name = ""              Graphics.transition(20)              if Config::TELE_SOUND == true                # Play decision SE                Audio.se_play("Audio/SE/" + Config::TELE_NAME, 100, 100)              end              return false            end          end        else          name = Config.image_name(@index)          if name == ''            # Play buzzer SE            \$game_system.se_play(\$data_system.buzzer_se)          else             #Play decision SE             \$game_system.se_play(\$data_system.decision_se)             \$scene = Scene_Index.new(@index)          end        end      else        name = Config.image_name(@index)        if name == ''          # Play buzzer SE          \$game_system.se_play(\$data_system.buzzer_se)        else          #Play decision SE          \$game_system.se_play(\$data_system.decision_se)          \$scene = Scene_Index.new(@index)        end      end    end         # If right directional button is pushed    if Input.repeat?(Input::RIGHT)      # If directional button pressed down is not a repeat, or      # cursor is not positioned on the right edge      if Input.trigger?(Input::RIGHT) or         @index % Config::X_GRID < Config::X_GRID-1        # Move cursor to right        \$game_system.se_play(\$data_system.cursor_se)        if @index % Config::X_GRID < Config::X_GRID-1          self.index += 1        end      end    # If left directional button is pushed    elsif Input.repeat?(Input::LEFT)      # If directional button pressed down is not a repeat, or      # cursor is not positioned on the left edge      if Input.trigger?(Input::LEFT) or         @index % Config::X_GRID > 0        # Move cursor to left        \$game_system.se_play(\$data_system.cursor_se)        if @index % Config::X_GRID > 0          self.index -= 1        end      end    # If down directional button is pushed    elsif Input.repeat?(Input::DOWN)      # Move cursor down      if @index / Config::X_GRID < Config::Y_GRID-1        self.index += Config::X_GRID        \$game_system.se_play(\$data_system.cursor_se)      end    # If up directional button is pushed    elsif Input.repeat?(Input::UP)      # Move cursor up      if @index / Config::X_GRID > 0        self.index -= Config::X_GRID        \$game_system.se_play(\$data_system.cursor_se)      end      end    update_cursor_rect  endend#---------------------------------------------------------------------------# * Scene Map_Menu#---------------------------------------------------------------------------class Scene_MapMenu  def initialize(index)      @index = index  end  #-------------------------------------------------------------------------  # * MAIN  #-------------------------------------------------------------------------  def main    #calculate the index value of the map     ival = Config::X_GRID * Config::Y_GRID - 1    #sets @index to 0 if it is greater than the value    if @index > ival      @index = 0    end    #creates the map window    @mapmenu_window = Window_MapMenu.new    #windows index = @index    @mapmenu_window.index = @index    #new sprite (background)    @sprite = Sprite.new    #set sprite image     @sprite.bitmap = RPG::Cache.picture(Config::MAP_NAME)    # Execute transition    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of windows    @mapmenu_window.dispose    @sprite.dispose  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # Update windows    @mapmenu_window.update    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Switch to Menu screen      if \$tele == 0        \$scene = Scene_Tele.new(0)      else        \$scene = Scene_Tele.new(1)      end      return    end  endend#===========================================================================# * class Window_Index#---------------------------------------------------------------------------class Window_Index < Window_Base  #-------------------------------------------------------------------------  # * Object Initialization  #-------------------------------------------------------------------------  def initialize(index)    super(*Config::WINDOW_SIZE)    wtext = Config.window_text(index)    @wtext = wtext    self.contents = Bitmap.new(width - 32, height - 32)    @bitmap = RPG::Cache.picture(Config.image_name(index))    self.opacity = Config::WINDOW_OPACITY    refresh  end  #-------------------------------------------------------------------------  # * refresh  #-------------------------------------------------------------------------  def refresh    xy = Config::IMAGE_XY    if @wtext == ''      self.contents.clear      self.contents.blt(xy[0], xy[1], @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), xy[2])    else      self.contents.clear      self.contents.blt(xy[0], xy[1], @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), xy[2])      if Config::W_CUSTOM_FONT == true        self.contents.font.name = Config::W_TEXT_FONT      end      if Config::W_CUSTOM_COLOR == true        rgb = Config::W_SET_COLOR        self.contents.font.color = Color.new(rgb[0], rgb[1], rgb[2])      end      if Config::W_BOLD_TEXT == true        self.contents.font.bold = true      end      self.contents.font.size = Config::W_FONT_SIZE      cx = contents.text_size(@wtext[2]).width      tx = contents.text_size(@wtext[2]).height      if Config::W_TEXT_BACK == true        if Config::W_TEXT_BACK_BORDER == true          rect = self.contents.text_size(@wtext[2])          bc = Config::W_TEXT_BACK_BORDER_COLOR          #border right          highlight_rect = Rect.new(rect.x, rect.y, 2, rect.height + 8)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(@wtext[0] + rect.width + 4, @wtext[1] - 4, bitmap, highlight_rect)          #border left          highlight_rect = Rect.new(rect.x, rect.y, 2, rect.height + 8)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(@wtext[0] - 6, @wtext[1] - 4, bitmap, highlight_rect)          #border bottom          highlight_rect = Rect.new(rect.x, rect.y, rect.width + 12, 2)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(@wtext[0] - 6, @wtext[1] + rect.height + 4, bitmap, highlight_rect)          #border top          highlight_rect = Rect.new(rect.x, rect.y, rect.width + 12, 2)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(@wtext[0] - 6, @wtext[1] - 6, bitmap, highlight_rect)          #draw back box          bc = Config::W_TEXT_BACK_COLOR          highlight_rect = Rect.new(rect.x, rect.y, rect.width + 8, rect.height + 8)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(@wtext[0] - 4, @wtext[1] - 4, bitmap, highlight_rect)        else          #draw back box          bc = Config::W_TEXT_BACK_COLOR          rect = self.contents.text_size(@wtext[2])          highlight_rect = Rect.new(rect.x - 8, rect.y - 4, rect.width + 24, rect.height + 12)          bitmap = Bitmap.new(highlight_rect.width, highlight_rect.height)          bitmap.fill_rect(highlight_rect.x, highlight_rect.y, highlight_rect.width, highlight_rect.height, Color.new(bc[0], bc[1], bc[2], bc[3]))          self.contents.blt(@wtext[0] - 16, @wtext[1] - 8, bitmap, highlight_rect)        end      end      if Config::W_OUTLINED_TEXT == true        self.contents.draw_text_full(@wtext[0], @wtext[1], cx, tx, @wtext[2], 1)      else        self.contents.draw_text(@wtext[0], @wtext[1], cx, tx, @wtext[2], 1)      end      if Config::W_BOLD_TEXT == true        self.contents.font.bold = false      end    end  endend#---------------------------------------------------------------------------# * Scene_Index#---------------------------------------------------------------------------class Scene_Index    def initialize(index)    @index = index  end  #-------------------------------------------------------------------------  # * Main  #-------------------------------------------------------------------------  def main    @index_window = Window_Index.new(@index)    @sprite = Sprite.new    @sprite.bitmap = RPG::Cache.picture(Config::MAP_NAME)    # Execute transition    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of windows    @index_window.dispose    @sprite.dispose  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # Update windows    @index_window.update    # set text    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Switch to map screen      \$scene = Scene_MapMenu.new(@index)      return    end  endend#==============================================================================# ** Scene_Tele#------------------------------------------------------------------------------#  This class performs Party screen processing.#==============================================================================class Scene_Tele    #--------------------------------------------------------------------------  # * Object Initialization  #     menu_index : command cursor's initial position  #--------------------------------------------------------------------------  def initialize(tele_index = 0)    @tele_index = tele_index  end  #--------------------------------------------------------------------------  # * Main Processing  #--------------------------------------------------------------------------  def main    \$tele_disabled    # Make command window    s1 = "teleport"    s2 = "location info"    @tele_window = Window_Command.new(120, [s1, s2])    @tele_window.index = @tele_index    @tele_window.x = 0    @tele_window.y = 0    #new sprite (background)    @sprite = Sprite.new     #set sprite image     @sprite.bitmap = RPG::Cache.picture(Config::MAP_NAME)    if \$game_system.tele_disabled      @tele_window.disable_item(0)    end    # Execute transition    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of windows    @tele_window.dispose    @sprite.dispose  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # Update windows    @tele_window.update    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Switch to map screen      \$scene = Scene_Menu.new(2)      return    end    # If C button was pressed    if Input.trigger?(Input::C)      # Branch by command window cursor position      case @tele_window.index      when 0  # teleport        if \$game_system.tele_disabled          #buzzer here        else          \$tele = 0          @index = \$game_variables[Menu_Config::MAP_VARIABLE]          # Play decision SE          \$game_system.se_play(\$data_system.decision_se)          #Scene_MapMenu          \$scene = Scene_MapMenu.new(@index)        end      when 1  #        \$tele = 1        # Play decision SE        \$game_system.se_play(\$data_system.decision_se)        @index = \$game_variables[Menu_Config::MAP_VARIABLE]        # Play decision SE        \$game_system.se_play(\$data_system.decision_se)        #Scene_MapMenu        \$scene = Scene_MapMenu.new(@index)      end      return    end  endend#---------------------------------------------------------------------# * interpreter fix when setting false via script * credits to Juan, Blizzard#---------------------------------------------------------------------class Interpreter  SCRIPT_WAIT_RESULTS = [:wait, FalseClass]  #-------------------------------------------------------------------  # * Script  #-------------------------------------------------------------------  def command_355    # Set first line to script    script = @list[@index].parameters[0] + "\n"    # Store index in case we need to wait.    current_index = @index    # Loop    loop do      # If next event command is second line of script or after      if @list[@index+1].code == 655        # Add second line or after to script        script += @list[@index+1].parameters[0] + "\n"      # If event command is not second line or after      else        # Abort loop        break      end      # Advance index      @index += 1    end    # Evaluation    result = eval(script)    # If return value is false    if SCRIPT_WAIT_RESULTS.include?(result)      # Set index back (If multi-line script call)      @index = current_index      # End and wait      return false    end    # Continue    return true  endend``

Spoiler: Show
#begin config
#set the id of the varriable that will record what map you are on
MAP_VARIABLE = 1
#set the [x, y, width] of the menu
XYW = [480, 288, 160]
end
#end config

#--------------------------------------------------------------------------
# * Object Initialization
#     menu_index : command cursor's initial position
#--------------------------------------------------------------------------
end
#==============================================================================
#------------------------------------------------------------------------------
#  This class performs Party screen processing.
#==============================================================================
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
s1 = \$data_system.words.item
s2 = "Party"
s3 = "Map"
s4 = "Save"
s5 = "End Game"
@command_window = Window_Command.new(xyw[2], [s1, s2, s3, s4, s5])
@command_window.x = xyw[0]
@command_window.y = xyw[1]
@spriteset = Spriteset_Map.new
# If save is forbidden
if \$game_system.save_disabled
# Disable save
@command_window.disable_item(2)
end
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if \$scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@spriteset.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@spriteset.update
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
\$game_system.se_play(\$data_system.cancel_se)
# Switch to map screen
\$scene = Scene_Map.new
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0  # item
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Switch to item screen
\$scene = Scene_Item.new
when 1  # party
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Switch to party screen
\$scene = Scene_Party.new
when 2 #map
if Config::TELE_WINDOW == true
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# switch to map screen
\$scene = Scene_Tele.new
else
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# switch to map screen
end
when 3  # save
# If saving is forbidden
if \$game_system.save_disabled
# Play buzzer SE
\$game_system.se_play(\$data_system.buzzer_se)
return
end
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Switch to save screen
\$scene = Scene_Save.new
when 4  # end game
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Switch to end game screen
\$scene = Scene_End.new
end
return
end
end
end

Scene_Party(seperated):
Spoiler: Show
class Scene_Party
#--------------------------------------------------------------------------
# * Object Initialization
#     menu_index : command cursor's initial position
#--------------------------------------------------------------------------
end
#==============================================================================
#------------------------------------------------------------------------------
#  This class performs Party screen processing.
#==============================================================================

#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
# Make command window
s1 = \$data_system.words.skill
s2 = \$data_system.words.equip
s3 = "Status"
@command_window = Window_Command.new(160, [s1, s2, s3])
@command_window.x = 480
@command_window.y = 0
@spriteset = Spriteset_Map.new
# If number of party members is 0
if \$game_party.actors.size == 0
# Disable skills, equipment, and status
@command_window.disable_item(0)
@command_window.disable_item(1)
@command_window.disable_item(2)
end
# Make status window
@status_window.x = 0
@status_window.y = 0
# Execute transition
Graphics.transition
# Main loop
loop do
# Update game screen
Graphics.update
# Update input information
Input.update
# Frame update
update
# Abort loop if screen is changed
if \$scene != self
break
end
end
# Prepare for transition
Graphics.freeze
# Dispose of windows
@command_window.dispose
@status_window.dispose
@spriteset.dispose
end
#--------------------------------------------------------------------------
# * Frame Update
#--------------------------------------------------------------------------
def update
# Update windows
@command_window.update
@status_window.update
@spriteset.update
# If command window is active: call update_command
if @command_window.active
update_command
return
end
# If status window is active: call update_status
if @status_window.active
update_status
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when command window is active)
#--------------------------------------------------------------------------
def update_command
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
\$game_system.se_play(\$data_system.cancel_se)
# Switch to map screen
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# If command other than save or end game, and party members = 0
if \$game_party.actors.size == 0 and @command_window.index < 2
# Play buzzer SE
\$game_system.se_play(\$data_system.buzzer_se)
return
end
# Branch by command window cursor position
case @command_window.index
when 0  # skill
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 1  # equipment
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
when 2  # status
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Make status window active
@command_window.active = false
@status_window.active = true
@status_window.index = 0
end
return
end
end
#--------------------------------------------------------------------------
# * Frame Update (when status window is active)
#--------------------------------------------------------------------------
def update_status
# If B button was pressed
if Input.trigger?(Input::B)
# Play cancel SE
\$game_system.se_play(\$data_system.cancel_se)
# Make command window active
@command_window.active = true
@status_window.active = false
@status_window.index = -1
return
end
# If C button was pressed
if Input.trigger?(Input::C)
# Branch by command window cursor position
case @command_window.index
when 0  # skill
# If this actor's action limit is 2 or more
if \$game_party.actors[@status_window.index].restriction >= 2
# Play buzzer SE
\$game_system.se_play(\$data_system.buzzer_se)
return
end
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Switch to skill screen
\$scene = Scene_Skill.new(@status_window.index)
when 1  # equipment
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Switch to equipment screen
\$scene = Scene_Equip.new(@status_window.index)
when 2  # status
# Play decision SE
\$game_system.se_play(\$data_system.decision_se)
# Switch to status screen
\$scene = Scene_Status.new(@status_window.index)
end
return
end
end
end

Scene_Skill*:
Spoiler: Show
``#==============================================================================# ** Scene_Skill#------------------------------------------------------------------------------#  This class performs skill screen processing.#==============================================================================class Scene_Skill  #--------------------------------------------------------------------------  # * Object Initialization  #     actor_index : actor index  #--------------------------------------------------------------------------  def initialize(actor_index = 0, equip_index = 0)    @actor_index = actor_index  end  #--------------------------------------------------------------------------  # * Main Processing  #--------------------------------------------------------------------------  def main    # Get actor    @actor = \$game_party.actors[@actor_index]    # Make help window, status window, and skill window    @help_window = Window_Help.new    @status_window = Window_SkillStatus.new(@actor)    @skill_window = Window_Skill.new(@actor)    # Associate help window    @skill_window.help_window = @help_window    # Make target window (set to invisible / inactive)    @target_window = Window_Target.new    @target_window.visible = false    @target_window.active = false    # Execute transition    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of windows    @help_window.dispose    @status_window.dispose    @skill_window.dispose    @target_window.dispose  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # Update windows    @help_window.update    @status_window.update    @skill_window.update    @target_window.update    # If skill window is active: call update_skill    if @skill_window.active      update_skill      return    end    # If skill target is active: call update_target    if @target_window.active      update_target      return    end  end  #--------------------------------------------------------------------------  # * Frame Update (if skill window is active)  #--------------------------------------------------------------------------  def update_skill    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Switch to menu screen      \$scene = Scene_Party.new(0)      return    end    # If C button was pressed    if Input.trigger?(Input::C)      # Get currently selected data on the skill window      @skill = @skill_window.skill      # If unable to use      if @skill == nil or not @actor.skill_can_use?(@skill.id)        # Play buzzer SE        \$game_system.se_play(\$data_system.buzzer_se)        return      end      # Play decision SE      \$game_system.se_play(\$data_system.decision_se)      # If effect scope is ally      if @skill.scope >= 3        # Activate target window        @skill_window.active = false        @target_window.x = (@skill_window.index + 1) % 2 * 304        @target_window.visible = true        @target_window.active = true        # Set cursor position to effect scope (single / all)        if @skill.scope == 4 || @skill.scope == 6          @target_window.index = -1        elsif @skill.scope == 7          @target_window.index = @actor_index - 10        else          @target_window.index = 0        end      # If effect scope is other than ally      else        # If common event ID is valid        if @skill.common_event_id > 0          # Common event call reservation          \$game_temp.common_event_id = @skill.common_event_id          # Play use skill SE          \$game_system.se_play(@skill.menu_se)          # Use up SP          @actor.sp -= @skill.sp_cost          # Remake each window content          @status_window.refresh          @skill_window.refresh          @target_window.refresh          # Switch to map screen          \$scene = Scene_Map.new          return        end      end      return    end    # If R button was pressed    if Input.trigger?(Input::R)      # Play cursor SE      \$game_system.se_play(\$data_system.cursor_se)      # To next actor      @actor_index += 1      @actor_index %= \$game_party.actors.size      # Switch to different skill screen      \$scene = Scene_Skill.new(@actor_index)      return    end    # If L button was pressed    if Input.trigger?(Input::L)      # Play cursor SE      \$game_system.se_play(\$data_system.cursor_se)      # To previous actor      @actor_index += \$game_party.actors.size - 1      @actor_index %= \$game_party.actors.size      # Switch to different skill screen      \$scene = Scene_Skill.new(@actor_index)      return    end  end  #--------------------------------------------------------------------------  # * Frame Update (when target window is active)  #--------------------------------------------------------------------------  def update_target    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Erase target window      @skill_window.active = true      @target_window.visible = false      @target_window.active = false      return    end    # If C button was pressed    if Input.trigger?(Input::C)      # If unable to use because SP ran out      unless @actor.skill_can_use?(@skill.id)        # Play buzzer SE        \$game_system.se_play(\$data_system.buzzer_se)        return      end      # If target is all      if @target_window.index == -1        # Apply skill use effects to entire party        used = false        for i in \$game_party.actors          used |= i.skill_effect(@actor, @skill)        end      end      # If target is user      if @target_window.index <= -2        # Apply skill use effects to target actor        target = \$game_party.actors[@target_window.index + 10]        used = target.skill_effect(@actor, @skill)      end      # If single target      if @target_window.index >= 0        # Apply skill use effects to target actor        target = \$game_party.actors[@target_window.index]        used = target.skill_effect(@actor, @skill)      end      # If skill was used      if used        # Play skill use SE        \$game_system.se_play(@skill.menu_se)        # Use up SP        @actor.sp -= @skill.sp_cost        # Remake each window content        @status_window.refresh        @skill_window.refresh        @target_window.refresh        # If entire party is dead        if \$game_party.all_dead?          # Switch to game over screen          \$scene = Scene_Gameover.new          return        end        # If command event ID is valid        if @skill.common_event_id > 0          # Command event call reservation          \$game_temp.common_event_id = @skill.common_event_id          # Switch to map screen          \$scene = Scene_Map.new          return        end      end      # If skill wasn't used      unless used        # Play buzzer SE        \$game_system.se_play(\$data_system.buzzer_se)      end      return    end  endend``

Scene_Equip*:
Spoiler: Show
``#==============================================================================# ** Scene_Equip#------------------------------------------------------------------------------#  This class performs equipment screen processing.#==============================================================================class Scene_Equip  #--------------------------------------------------------------------------  # * Object Initialization  #     actor_index : actor index  #     equip_index : equipment index  #--------------------------------------------------------------------------  def initialize(actor_index = 0, equip_index = 0)    @actor_index = actor_index    @equip_index = equip_index  end  #--------------------------------------------------------------------------  # * Main Processing  #--------------------------------------------------------------------------  def main    # Get actor    @actor = \$game_party.actors[@actor_index]    # Make windows    @help_window = Window_Help.new    @left_window = Window_EquipLeft.new(@actor)    @right_window = Window_EquipRight.new(@actor)    @item_window1 = Window_EquipItem.new(@actor, 0)    @item_window2 = Window_EquipItem.new(@actor, 1)    @item_window3 = Window_EquipItem.new(@actor, 2)    @item_window4 = Window_EquipItem.new(@actor, 3)    @item_window5 = Window_EquipItem.new(@actor, 4)    # Associate help window    @right_window.help_window = @help_window    @item_window1.help_window = @help_window    @item_window2.help_window = @help_window    @item_window3.help_window = @help_window    @item_window4.help_window = @help_window    @item_window5.help_window = @help_window    # Set cursor position    @right_window.index = @equip_index    refresh    # Execute transition    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of windows    @help_window.dispose    @left_window.dispose    @right_window.dispose    @item_window1.dispose    @item_window2.dispose    @item_window3.dispose    @item_window4.dispose    @item_window5.dispose  end  #--------------------------------------------------------------------------  # * Refresh  #--------------------------------------------------------------------------  def refresh    # Set item window to visible    @item_window1.visible = (@right_window.index == 0)    @item_window2.visible = (@right_window.index == 1)    @item_window3.visible = (@right_window.index == 2)    @item_window4.visible = (@right_window.index == 3)    @item_window5.visible = (@right_window.index == 4)    # Get currently equipped item    item1 = @right_window.item    # Set current item window to @item_window    case @right_window.index    when 0      @item_window = @item_window1    when 1      @item_window = @item_window2    when 2      @item_window = @item_window3    when 3      @item_window = @item_window4    when 4      @item_window = @item_window5    end    # If right window is active    if @right_window.active      # Erase parameters for after equipment change      @left_window.set_new_parameters(nil, nil, nil)    end    # If item window is active    if @item_window.active      # Get currently selected item      item2 = @item_window.item      # Change equipment      last_hp = @actor.hp      last_sp = @actor.sp      @actor.equip(@right_window.index, item2 == nil ? 0 : item2.id)      # Get parameters for after equipment change      new_atk = @actor.atk      new_pdef = @actor.pdef      new_mdef = @actor.mdef      # Return equipment      @actor.equip(@right_window.index, item1 == nil ? 0 : item1.id)      @actor.hp = last_hp      @actor.sp = last_sp      # Draw in left window      @left_window.set_new_parameters(new_atk, new_pdef, new_mdef)    end  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # Update windows    @left_window.update    @right_window.update    @item_window.update    refresh    # If right window is active: call update_right    if @right_window.active      update_right      return    end    # If item window is active: call update_item    if @item_window.active      update_item      return    end  end  #--------------------------------------------------------------------------  # * Frame Update (when right window is active)  #--------------------------------------------------------------------------  def update_right    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Switch to menu screen      \$scene = Scene_Party.new(1)      return    end    # If C button was pressed    if Input.trigger?(Input::C)      # If equipment is fixed      if @actor.equip_fix?(@right_window.index)        # Play buzzer SE        \$game_system.se_play(\$data_system.buzzer_se)        return      end      # Play decision SE      \$game_system.se_play(\$data_system.decision_se)      # Activate item window      @right_window.active = false      @item_window.active = true      @item_window.index = 0      return    end    # If R button was pressed    if Input.trigger?(Input::R)      # Play cursor SE      \$game_system.se_play(\$data_system.cursor_se)      # To next actor      @actor_index += 1      @actor_index %= \$game_party.actors.size      # Switch to different equipment screen      \$scene = Scene_Equip.new(@actor_index, @right_window.index)      return    end    # If L button was pressed    if Input.trigger?(Input::L)      # Play cursor SE      \$game_system.se_play(\$data_system.cursor_se)      # To previous actor      @actor_index += \$game_party.actors.size - 1      @actor_index %= \$game_party.actors.size      # Switch to different equipment screen      \$scene = Scene_Equip.new(@actor_index, @right_window.index)      return    end  end  #--------------------------------------------------------------------------  # * Frame Update (when item window is active)  #--------------------------------------------------------------------------  def update_item    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Activate right window      @right_window.active = true      @item_window.active = false      @item_window.index = -1      return    end    # If C button was pressed    if Input.trigger?(Input::C)      # Play equip SE      \$game_system.se_play(\$data_system.equip_se)      # Get currently selected data on the item window      item = @item_window.item      # Change equipment      @actor.equip(@right_window.index, item == nil ? 0 : item.id)      # Activate right window      @right_window.active = true      @item_window.active = false      @item_window.index = -1      # Remake right window and item window contents      @right_window.refresh      @item_window.refresh      return    end  endend``

Scene_Status*:
Spoiler: Show
``#==============================================================================# ** Scene_Status#------------------------------------------------------------------------------#  This class performs status screen processing.#==============================================================================class Scene_Status  #--------------------------------------------------------------------------  # * Object Initialization  #     actor_index : actor index  #--------------------------------------------------------------------------  def initialize(actor_index = 0, equip_index = 0)    @actor_index = actor_index  end  #--------------------------------------------------------------------------  # * Main Processing  #--------------------------------------------------------------------------  def main    # Get actor    @actor = \$game_party.actors[@actor_index]    # Make status window    @status_window = Window_Status.new(@actor)    # Execute transition    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of windows    @status_window.dispose  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Switch to menu screen      \$scene = Scene_Party.new(2)      return    end    # If R button was pressed    if Input.trigger?(Input::R)      # Play cursor SE      \$game_system.se_play(\$data_system.cursor_se)      # To next actor      @actor_index += 1      @actor_index %= \$game_party.actors.size      # Switch to different status screen      \$scene = Scene_Status.new(@actor_index)      return    end    # If L button was pressed    if Input.trigger?(Input::L)      # Play cursor SE      \$game_system.se_play(\$data_system.cursor_se)      # To previous actor      @actor_index += \$game_party.actors.size - 1      @actor_index %= \$game_party.actors.size      # Switch to different status screen      \$scene = Scene_Status.new(@actor_index)      return    end  endend``

Scene_Save*:
Spoiler: Show
``#==============================================================================# ** Scene_Save#------------------------------------------------------------------------------#  This class performs save screen processing.#==============================================================================class Scene_Save < Scene_File  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize    super("Which file would you like to save to?")  end  #--------------------------------------------------------------------------  # * Decision Processing  #--------------------------------------------------------------------------  def on_decision(filename)    # Play save SE    \$game_system.se_play(\$data_system.save_se)    # Write save data    file = File.open(filename, "wb")    write_save_data(file)    file.close    # If called from event    if \$game_temp.save_calling      # Clear save call flag      \$game_temp.save_calling = false      # Switch to map screen      \$scene = Scene_Map.new      return    end    # Switch to menu screen    \$scene = Scene_Menu.new(2)  end  #--------------------------------------------------------------------------  # * Cancel Processing  #--------------------------------------------------------------------------  def on_cancel    # Play cancel SE    \$game_system.se_play(\$data_system.cancel_se)    # If called from event    if \$game_temp.save_calling      # Clear save call flag      \$game_temp.save_calling = false      # Switch to map screen      \$scene = Scene_Map.new      return    end    # Switch to menu screen    \$scene = Scene_Menu.new(3)  end  #--------------------------------------------------------------------------  # * Write Save Data  #     file : write file object (opened)  #--------------------------------------------------------------------------  def write_save_data(file)    # Make character data for drawing save file    characters = []    for i in 0...\$game_party.actors.size      actor = \$game_party.actors[i]      characters.push([actor.character_name, actor.character_hue])    end    # Write character data for drawing save file    Marshal.dump(characters, file)    # Wrire frame count for measuring play time    Marshal.dump(Graphics.frame_count, file)    # Increase save count by 1    \$game_system.save_count += 1    # Save magic number    # (A random value will be written each time saving with editor)    \$game_system.magic_number = \$data_system.magic_number    # Write each type of game object    Marshal.dump(\$game_system, file)    Marshal.dump(\$game_switches, file)    Marshal.dump(\$game_variables, file)    Marshal.dump(\$game_self_switches, file)    Marshal.dump(\$game_screen, file)    Marshal.dump(\$game_actors, file)    Marshal.dump(\$game_party, file)    Marshal.dump(\$game_troop, file)    Marshal.dump(\$game_map, file)    Marshal.dump(\$game_player, file)  endend``

Scene_End*:
Spoiler: Show
``#==============================================================================# ** Scene_End#------------------------------------------------------------------------------#  This class performs game end screen processing.#==============================================================================class Scene_End  #--------------------------------------------------------------------------  # * Main Processing  #--------------------------------------------------------------------------  def main    # Make command window    s1 = "To Title"    s2 = "Shutdown"    s3 = "Cancel"    @command_window = Window_Command.new(192, [s1, s2, s3])    @command_window.x = 320 - @command_window.width / 2    @command_window.y = 240 - @command_window.height / 2    # Execute transition    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame Update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of window    @command_window.dispose    # If switching to title screen    if \$scene.is_a?(Scene_Title)      # Fade out screen      Graphics.transition      Graphics.freeze    end  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # Update command window    @command_window.update    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Switch to menu screen      \$scene = Scene_Menu.new(4)      return    end    # If C button was pressed    if Input.trigger?(Input::C)      # Branch by command window cursor position      case @command_window.index      when 0  # to title        command_to_title      when 1  # shutdown        command_shutdown      when 2  # quit        command_cancel      end      return    end  end  #--------------------------------------------------------------------------  # * Process When Choosing [To Title] Command  #--------------------------------------------------------------------------  def command_to_title    # Play decision SE    \$game_system.se_play(\$data_system.decision_se)    # Fade out BGM, BGS, and ME    Audio.bgm_fade(800)    Audio.bgs_fade(800)    Audio.me_fade(800)    # Switch to title screen    \$scene = Scene_Title.new  end  #--------------------------------------------------------------------------  # * Process When Choosing [Shutdown] Command  #--------------------------------------------------------------------------  def command_shutdown    # Play decision SE    \$game_system.se_play(\$data_system.decision_se)    # Fade out BGM, BGS, and ME    Audio.bgm_fade(800)    Audio.bgs_fade(800)    Audio.me_fade(800)    # Shutdown    \$scene = nil  end  #--------------------------------------------------------------------------  # *  Process When Choosing [Cancel] Command  #--------------------------------------------------------------------------  def command_cancel    # Play decision SE    \$game_system.se_play(\$data_system.decision_se)    # Switch to menu screen    \$scene = Scene_Menu.new(4)  endend``

Instructions

Place above main and below all the default scripts, to call the script through events call: \$scene = Scene_MapMenu.new(i)
i is the number of the index you want it to start at when opening the map, see the index reference image for a better understanding, all other instructions/configuration can be found in the script or demo.
if your using the customized menu, you need all the scripts above(replace old ones and place Scene_Party below Scene_Menu) Scene_Menu and Scene_Party are the major edited ones, but the rest have been edited so when you escape out of them you end up in the right place in the menu.
also the new Scene_Menu has a small config at the top where you can set the menu's x,y and set the variable id the map uses to call it to the right index.

here is the index reference image in-case the demo goes down/you dont want to dowload it:
Spoiler: Show

Compatibility

no know compatibility issues

Credits and Thanks

• Diagostimo for the script

• Juan and Blizzard for the interpreter fix

Author's Notes

I will provide updates on this, so it is up to standards
also i have used images from pokemon for the map, just for a good understanding how it works.
if you are already using the interpreter fix script in your project then you can remove that part from the map script.
UPDATE:26/4/2012
added configurable text to the windows.
updated the demo.
UPDATE:9/5/2012
added teleporting methods that can be enabled/disabled
see the demo or script for instructions
UPDATE:3/6/2012
added configuration so you can change the size of the maps grid, see inside the script config for details.
25
##### Script Troubleshooting / how to stop a window from showing???
March 06, 2012, 08:44:21 pm
hey, i have a problem when trying to bypass a window from showing, ill show u what i mean,
so the config is like this:

#beging config
\$map_name = "examplename.png"
\$index0_name = "examplename.png"
\$index1_name = ""
\$index2_name = ""

then i have the C button to open a window depending where in the idex you are as so:

``  # if enter is being pressed     if Input.trigger?(Input::C)        if @index == 1          # Play decision SE          \$game_system.se_play(\$data_system.decision_se)          # Switch to item screen          \$scene = Scene_Index1.new        end      end    end``

what i want is say \$index1_name = "", i want it to not show the scene that its set up to show, so you have the option of showing a window, or not showing a window if theres no name there, iv tried multiple ways using:
``  # if enter is being pressed if Input.trigger?(Input::C)   if \$index1_name = ""    \$scene = Scene_MapMenu.new (1)     else       if @index == 1        # Play decision SE        \$game_system.se_play(\$data_system.decision_se)        # Switch to item screen        \$scene = Scene_Index1.new      end   endend``

but no luck, iv tried mixing it up abit but cant find a solution
26
##### Script Troubleshooting / self.z? [solved]
March 02, 2012, 11:00:54 pm
hi, i was wondering if anyone knows how i can change the self.z of a picture shown in a window, so it is behind my index's cursor_rect, or the other way around so the the self.z of the cursor is higher than the picture, heres my script for reference:
``#==============================================================================# ** Window_Map#------------------------------------------------------------------------------class Window_MapMenu < Window_Base  #--------------------------------------------------------------------------  # * Object Initialization  #--------------------------------------------------------------------------  def initialize    super(0, 0, 640, 480)    self.contents = Bitmap.new(width - 32, height - 32)    @index = 0    update_cursor_rect     refresh  end  #-------------------------------------------------------------------------  # * def index  #-------------------------------------------------------------------------  def index=(index)    @index = index    # Update Help Text (update_help is defined by the subclasses)    if self.active and @help_window != nil      update_help    end    # Update cursor rectangle    update_cursor_rect  end  #--------------------------------------------------------------------------  # * Cursor Rectangle Update  #--------------------------------------------------------------------------  def update_cursor_rect      x = 32 + @index % 17 * 32      y = 0 + @index / 17 % 14 * 32      self.cursor_rect.set(x, y, 32, 32)  end  #--------------------------------------------------------------------------  # * Refresh  #--------------------------------------------------------------------------  def refresh    @bitmap = RPG::Cache.picture("kantomap.png")    self.contents.blt(32, 0, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 160)  end    #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    super    # if enter is being pressed    if Input.trigger?(Input::C)      if @index == 172        # Play decision SE        \$game_system.se_play(\$data_system.decision_se)        # Switch to item screen        \$scene = Scene_PalletTown.new      end    end      # If right directional button is pushed      if Input.repeat?(Input::RIGHT)        # If directional button pressed down is not a repeat, or        # cursor is not positioned on the right edge        if Input.trigger?(Input::RIGHT) or           @index % 17 < 16          # Move cursor to right          \$game_system.se_play(\$data_system.cursor_se)          if @index % 17 < 16            @index += 1          end        end      end      # If left directional button is pushed      if Input.repeat?(Input::LEFT)        # If directional button pressed down is not a repeat, or        # cursor is not positioned on the left edge        if Input.trigger?(Input::LEFT) or           @index % 17 > 0          # Move cursor to left          \$game_system.se_play(\$data_system.cursor_se)          if @index % 17 > 0            @index -= 1          end        end      end      # If down directional button is pushed      if Input.repeat?(Input::DOWN)        # Move cursor down        if @index / 17 < 13          @index += 17          \$game_system.se_play(\$data_system.cursor_se)        end      end      # If up directional button is pushed      if Input.repeat?(Input::UP)        # Move cursor up        if @index / 17 > 0          @index -= 17          \$game_system.se_play(\$data_system.cursor_se)        end        end    update_cursor_rect  endend#---------------------------------------------------------------------------# * Scene Map_Menu#---------------------------------------------------------------------------class Scene_MapMenu  def initialize(index = 0)        @index = index  end  #-------------------------------------------------------------------------  # * MAIN  #-------------------------------------------------------------------------  def main    @mapmenu_window = Window_MapMenu.new    @mapmenu_window.index = @index    # Execute transition    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of windows    @mapmenu_window.dispose  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # Update windows    @mapmenu_window.update    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Switch to Menu screen      \$scene = Scene_Item.new      return    end  endend#---------------------------------------------------------------------------# * class Window_PalletTown#---------------------------------------------------------------------------class Window_PalletTown < Window_Base  #-------------------------------------------------------------------------  # * Object Initialization  #-------------------------------------------------------------------------  def initialize    super(0, 0, 416, 352)    self.contents = Bitmap.new(width - 32, height - 32)    refresh  end  #-------------------------------------------------------------------------  # * refresh  #-------------------------------------------------------------------------  def refresh    @bitmap = RPG::Cache.picture("pallettown.png")    self.contents.blt(0, 0, @bitmap, Rect.new(0, 0, @bitmap.width, @bitmap.height), 255)  endend#---------------------------------------------------------------------------# * Scene_PalletTown#---------------------------------------------------------------------------class Scene_PalletTown  #-------------------------------------------------------------------------  # * Main  #-------------------------------------------------------------------------  def main    @pallettown_window = Window_PalletTown.new    # Execute transition    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of windows    @pallettown_window.dispose  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # Update windows    @pallettown_window.update    # if mapmenu is active call update_map    # If B button was pressed    if Input.trigger?(Input::B)      # Play cancel SE      \$game_system.se_play(\$data_system.cancel_se)      # Switch to map screen      \$scene = Scene_MapMenu.new(172)      return    end  endend``

if anyone knows how i can accomplish this, i will be in your gratitude
27
##### Script Troubleshooting / [xp] command window [solved]
February 28, 2012, 12:34:49 am
hey guys, so i started looking into scripting as i want to advance my knowledge in ruby, i have got down with the basics, so to the point, i am trying to achieve my first script in a custom menu scene, so i was wondering if it is possible to use the super comand to give the selection (s1 = "" .ect) x and y positions in the window, or perhaps something similar, as i am trying to get another row of selections right besides my other one in the same window, so in the long run it is going to be one big grid of selections, here is the script for reference:
``#==============================================================================# **scene_MapMenu#==============================================================================class Scene_MapMenu  #----------------------------------------------------------------------  # * Object Initialization  #----------------------------------------------------------------------  def initialize(menu_index = 0)    @menu_index = menu_index  end  #----------------------------------------------------------------------  # * Main  #----------------------------------------------------------------------  def main    s1 = ""    s2 = ""    s3 = ""    s4 = ""    s5 = ""    s6 = ""    s7 = ""    s8 = ""    s9 = ""    s10 = ""    s11 = ""    s12 = ""    s13 = ""    s14 = ""    @command_window = Window_Command.new(65, [s1, s2, s3, s4, s5, s6, s7, s8, s9, s10, s11, s12, s13, s14])    @command_window.index = @menu_index    #call the window    @window = Scene_MapMenu.new    Graphics.transition    # Main loop    loop do      # Update game screen      Graphics.update      # Update input information      Input.update      # Frame update      update      # Abort loop if screen is changed      if \$scene != self        break      end    end    # Prepare for transition    Graphics.freeze    # Dispose of windows    @command_window.dispose  end  #--------------------------------------------------------------------------  # * Frame Update  #--------------------------------------------------------------------------  def update    # Update windows    @command_window.update  endend``
28
##### Script Requests / spritesheet movement
February 16, 2012, 10:59:15 pm
hey, im wondering if it exists or if anyone could make a script that overrides the animation when moving, basicly i want it to loop the three movement animations and cut out the stationary pose until you stop moving like so:
Spoiler: Show
.
i need this as i have a few wierd sprites that slightly bend over when moving, so when it returns to the stationary pose it seems to jerk, i also feel like this would make the movement more fluent, if anyone could direct me to a script that does this i would be very grateful and give credits, thanks
29
##### Event System Database / [xp]Basic show map event
February 16, 2012, 02:27:24 pm
Show Map
Version: 1.0
Type: Picture Event

Hi there, this is a basic picture showing event, that will show a map with an overlapped image for your location, enjoy

This event system will show a map image the size of the screen on the button press L (q key as default), with an overlapped flashing image to indicate the location on the map that you are at.

Features

• Requires item "map"
• Shows map on button press L (q key as default
• Completely customize-able to fit needs

Screenshots

Spoiler: Show

Demo

http://www.mediafire.com/?18x514fzzd1kyoc

Instructions

Its all in the demo, also if you want the scrolls default image for creating your own map, you can find it in the project root folder, in making the image i overlapped my maps image onto the scroll, then over lapped the border of the scroll over this, and deleted any part of the map on the tear lines, also to make the grid on the map image itself, using gimp, go to filters/render/pattern/grid, and customize as you require, also the overlayed flashing square is the size of a single grid square, to line it up in the event config, it is calculated in pixles, not event squares, obviously edit this to grid with the map you are on

Credits and Thanks

• You can credit me if you wish, mainly for the scroll image itself, the map itself is from the anime series one piece, so obviously don't use it for a commercial purposes.

Author's Notes

Please feel free to use all resources included, the maps are from the anime one piece, so obviously they would be better suited for a based fan game
30
##### Event System Requests / camera fix on event?
January 29, 2012, 04:51:14 am
so ye the title pretty much says it all, i have a switch that controls a pulley to move left or right, so at the start of my eventing sequence i need the camera to centre on the pulley and follow it, as the pulley leaves the seeable area of the switch, then to fix back onto the player once the event is exited so like this:

>something to fix camera onto event
>label-which way
>show text- which way would you like to go?
>show choices-left,right,none