Display the Map Location - Printable Version +- Save-Point (https://www.save-point.org) +-- Forum: Archives (https://www.save-point.org/forum-105.html) +--- Forum: Creation Asylum Archives (https://www.save-point.org/forum-90.html) +---- Forum: Scripts & Code Snippets (https://www.save-point.org/forum-92.html) +----- Forum: RPG Maker XP Code (https://www.save-point.org/forum-93.html) +------ Forum: Enhancement/Modification Scripts (https://www.save-point.org/forum-98.html) +------ Thread: Display the Map Location (/thread-6551.html) |
Display the Map Location - Mister C Major - 07-17-2007 Display the Map Location by Mister C Major Jul 17 2007 This is a locked, single-post thread from Creation Asylum. Archived here to prevent its loss. No support is given. If you are the owner of the thread, please contact administration. Good Afternoon Everyone, Before I begin, I would like to say this idea was not my own. Around an year ago I was looking for a script which served the same purpose as the one I am posting today. To my luck I found it. An year later, after my computer crashed along with my game file, and after Creation Asylum "refreshed" itself, I came to look for the script again. To no avail, I was unable to find the post. So I reprogrammed the idea in my own lines. Again I do not take credit for the idea, just the reprogramming. So today I post my own variation of the script for all to enjoy. The Location Window Obvious from the section this post is in, this is an enhancement script designed to add a very small flair to your game. The final product will be as the picture shown. The only aspect of this picture we will be worrying about today is going to be the white font which reads "Testing". (Imageshack link broken) For quick setup, follow the instructions in the code box. For a detailed explanation, skip the code box. [Spoiler=The Location Window] At this to Line 31 of the Scene_Title Class Code: $data_mapinfos=load_data("Data/MapInfos.rxdata") To test, add this code to a call script command in an event. Code: print $data_mapinfos[$game_map.map_id].name.to_s Code: As I try to do with all my posted scripts, not only will I post the code but I will be explaining the Science behind it, aka the meaning and reason I used the code. To access this data, we need to send a call to the $data_mapinfos variable with a call number (more commonly known as a parameter) where the parameter is the id of the map. The current map id can be found in the Game_Map class. To access the variable we use the following code which will return the map_id variable. Code: $game_map.map_id So to print the map name, the code will look as follows, Code: $data_mapinfos[$game_map.map_id].name.to_s where "name" is the variable from the "MapInfos.rxdata" file and "to_s" is the command to turn the data stored in "name" into a format which can be printed on the computer screen (again commonly referred to as a "string"). To test this, paste the following into a "Call Script" command within an event and activate the event. Code: print $data_mapinfos[$game_map.map_id].name.to_s If you guys have any comments on how I can improve my scripts, improve my posts, and/or improve how to teach my scripts, don't hesitate to comment! Thanks for reading and I hope this helps make your game extra spiffy ^^. |