Submit Your Article


 
RPG Maker

Welcome Guest ( Log In | Register )


  Games Resources RPG Maker VX RPG Maker XP Scripts Tutorials Downloads

 
Reply to this topicStart new topic
> Simple Location Window, Compatible with scripts that require tags in your map name.
AlphaWhelp
post May 28 2009, 02:04 PM
Post #1


Level 9
Group Icon

Group: Revolutionary
Posts: 147
Type: Developer
RM Skill: Skilled




Simple Location Window

Version
0.2a
Author
AlphaWhelp
Release Date
5/28



Introduction
This was an idea I got from Moghunter's script to display the location name in pretty graphic on your screen every time you went to a new map. Although, as time went on, I became a little dissatisfied with his script and wrote one of my own that had the quirks that I wanted it to have. This script will add a location window to your basic menu scene. The information in the window is the name you give the map in the RMVX editor, however, to not exclude people who wish to use certain scripts that require you to add stuff like [TAGS] into your map, I made it so that anything between [ and ] is ignored and not put into the location window. Even if you aren't using any scripts that require you to add such a tag, you can use it to add mini map notes for yourself.

I have not encountered any scripts which require you to add tags other than the [] tag. However, if you have such a script, let me know what special characters it uses and I will add support for compatibility with that script as well. Adding additional special characters to ignore is pretty easy.


Features
Add location window to menu scene
Option to turn the location window on and off with a switch
Automatically positions either directly underneath the menu options, or directly above the gold window.

Script
[Show/Hide] Simple Location Window
CODE
=begin
This script will add a small location window to your basic menu scene.

This script will not put any part of your map name in the location window
that lies between a [ and ] . This is to help with compatibility with
other scripts that require you to add tags between the characters [ and ]
to make them work (such as several KGC scripts).

This is also handy if you want to add minor notes to your map names, all
you have to do is put them between a [ and ] they will be omitted from
the location window.

If you absolutely can't help but have a strange map name that you don't
want your player to see, in the below module are some configuration
options that will allow you to turn the location window on and off with a
game switch. By default, if your ALWAYS_ON value is set to true, then
you may ignore the configuration option below it--it won't have any
impact on your game.

AlphaWhelp
Created 5/28/09, 5:37 P.M.
Version 0.2a
Changes from 0.1a
Now ignores anything between and including the characters [ and ]
=end

module ALPHAWHELP
### START CONFIG ###
LOCATION_WINDOW_ON_TOP = false ## Set to false to have the window appear low

ALWAYS_ON = true ## Set to false to hide the window at points in your game

LOCATION_WINDOW_VISIBLE_SWITCH = 98 ## Switch number that determines when the
## Location window is visible if ALWAYS_ON
## is set to false
### END CONFIG ###
end

class Window_Location < Window_Base
def initialize(x, y)
super(x, y, 160, WLH + 64)
self.contents = Bitmap.new(width - 32, height - 32)
refresh
end

def refresh
self.contents.clear
$maps = load_data("Data/MapInfos.rvdata")
map_id = $game_map.map_id
mapname = $maps[map_id].name
mapname.gsub!(/\[.*\]/) {""}
self.contents.font.color = system_color
self.contents.draw_text(0, -4, 128, 32, "Location :")
self.contents.font.color = normal_color
self.contents.draw_text(0, -4 + WLH, 128, 32, mapname, 1)
end
end


class Scene_Menu < Scene_Base
alias add_location_name_start start
def start
if ALPHAWHELP::LOCATION_WINDOW_ON_TOP
if ALPHAWHELP::ALWAYS_ON
@location_window = Window_Location.new(0, 176)
else
@location_window = Window_Location.new(0, 176) if $game_switches[ALPHAWHELP::LOCATION_WINDOW_VISIBLE_SWITCH]
end
else
if ALPHAWHELP::ALWAYS_ON
@location_window = Window_Location.new(0, 272)
else
@location_window = Window_Location.new(0, 272) if $game_switches[ALPHAWHELP::LOCATION_WINDOW_VISIBLE_SWITCH]
end
end
add_location_name_start
end

alias dispose_location_window terminate
def terminate
if @location_window != nil
@location_window.dispose
@location_window = nil
end
dispose_location_window
end
end


Customization
There are 3 options within the script.
The option to set the window to be always on, or on only when a specified switch is on as well.
Display the location window in one of two locations, depending on how you like it

Compatibility
This script should be compatible with other scripts which overhaul the menu system, but it may not look very pretty. The aesthetics of this script were made for the basic menu scene.

Screenshot
Too lazy, just use your imagination.


Installation
Plug-n-play
Be sure to configure it


FAQ
Should be really difficult to crash this script without deliberately trying to. If you are experiencing an error, send me a forum pm


Terms and Conditions
Free to use in any project

Credits
AlphaWhelp

This post has been edited by AlphaWhelp: May 29 2009, 09:16 AM


__________________________
My scripts...

Haste/Slow States for Tankentai SBS with ATB: http://www.rpgrevolution.com/forums/index....showtopic=18304 (scroll to the middle of the first post and find it under Add-ons)

Old Fashioned Game Overs http://www.rpgrevolution.com/forums/index....ic=29201&hl

Comic Book Cut Scenes http://www.rpgrevolution.com/forums/index....showtopic=30920

Force Preemptive or Surprise Battles: http://www.rpgrevolution.com/forums/index....showtopic=31668

[Show/Hide] Script Snippets written by me:
Fade Victory ME after battle end (fully compatible)
CODE
class Scene_Battle < Scene_Base
alias kill_victory_me battle_end
def battle_end(result)
RPG::ME.fade(500)
kill_victory_me(result)
RPG::ME.stop
end
end

Simple footsteps sound: Note Knock is a pretty terrible footstep sound, you should download your own.
CODE
class Game_Party < Game_Unit
alias footsteps_on_player_walk on_player_walk
def on_player_walk
footsteps_on_player_walk
RPG::SE.new("Knock", 1, 150).play
end
end

More to come as I think of them.
Go to the top of the page
 
+Quote Post
   
originalwij
post May 29 2009, 07:12 AM
Post #2


... 42 ...
Group Icon

Group: Revolutionary
Posts: 214
Type: Scripter
RM Skill: Masterful




nice little script

i have one suggestion though,

instead of cutting off the map name at "[", you should use this:
CODE
mapname.gsub!(/\[.*\]/) {""}

it will just remove all map name tags in brackets (I.E. [tag]) since some people put the tags before the map name


__________________________




Go to the top of the page
 
+Quote Post
   
AlphaWhelp
post May 29 2009, 08:45 AM
Post #3


Level 9
Group Icon

Group: Revolutionary
Posts: 147
Type: Developer
RM Skill: Skilled




QUOTE (originalwij @ May 29 2009, 08:12 AM) *
nice little script

i have one suggestion though,

instead of cutting off the map name at "[", you should use this:
CODE
mapname.gsub!(/\[.*\]/) {""}

it will just remove all map name tags in brackets (I.E. [tag]) since some people put the tags before the map name


Thanks for the suggestion, I didn't even think about putting tags before the map name, makes my code look cleaner, too.


__________________________
My scripts...

Haste/Slow States for Tankentai SBS with ATB: http://www.rpgrevolution.com/forums/index....showtopic=18304 (scroll to the middle of the first post and find it under Add-ons)

Old Fashioned Game Overs http://www.rpgrevolution.com/forums/index....ic=29201&hl

Comic Book Cut Scenes http://www.rpgrevolution.com/forums/index....showtopic=30920

Force Preemptive or Surprise Battles: http://www.rpgrevolution.com/forums/index....showtopic=31668

[Show/Hide] Script Snippets written by me:
Fade Victory ME after battle end (fully compatible)
CODE
class Scene_Battle < Scene_Base
alias kill_victory_me battle_end
def battle_end(result)
RPG::ME.fade(500)
kill_victory_me(result)
RPG::ME.stop
end
end

Simple footsteps sound: Note Knock is a pretty terrible footstep sound, you should download your own.
CODE
class Game_Party < Game_Unit
alias footsteps_on_player_walk on_player_walk
def on_player_walk
footsteps_on_player_walk
RPG::SE.new("Knock", 1, 150).play
end
end

More to come as I think of them.
Go to the top of the page
 
+Quote Post
   
Hypersonicbomb
post May 30 2009, 05:15 AM
Post #4


Level 2
Group Icon

Group: Member
Posts: 25
Type: Event Designer
RM Skill: Skilled




I really need to know this, i have an intro at the start of my game so if i rename the map "Intro" to "[Intro]" it wont pop up on the top? Is this correct?


__________________________
Lol look at the OMG one and i do not think the one at the top right corner likes you and the one under it is laughing at you cause you whacked your head on a Microphone and it made a massive noise. Please respect these cats except for the winking one(Scary lol)
Go to the top of the page
 
+Quote Post
   

Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 

Lo-Fi Version Time is now: 25th May 2013 - 09:40 AM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker