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
> Floating Location Window
Rydin
post Oct 6 2005, 01:34 AM
Post #1


Level 43


Group: Retired Admin Staff
Posts: 1,185
Type: None
RM Skill: Undisclosed




You know the window some RPG games have that display your location? Well this is similar to it. This script will create a window that will appear with custom text on it for a short while in the upper-middle part of the screen. The good thing is that it's totally customizable.. you put your location in and you decide when/where you want it to pop up.


Full size image: here

On a note I didn't really custom script this out. This was mostly inspired by Advocates new game, I found his location window unique so I learned how it worked. If any credits were to be given, you should thank him.

To make it work just make a new script below Window_DebugRight and make a new script called Window_Location.

Paste the following code in to it:
QUOTE (DrakeOneil @ Oct 10 2008, 11:18 AM) *
Hey! I did the rest of the work and took the rest of the [/color]?[color="#000000"] away from it so here.

CODE
class Window_Location < Window_Base
#------------------------------
attr_accessor :location
#--------------------------------------------------------------------------
# Initialize the Object.
#--------------------------------------------------------------------------
def initialize
super(144, 4, 352, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
self.contents.font.name = "Arial"
self.contents.font.size = 22
self.opacity = 0
self.z = 1050
@dummy_window = Window_Base.new(144, 10, 352, 52)
@dummy_window.z = 1000
@dummy_window.opacity = 255
@dummy_window.visible = false
@location = ""
@frames = -1
refresh
end
#----------------------------------
def location=(location)
if location != ""
@location = location
@frames = 120
@dummy_window.visible = true
self.visible = true
refresh
else
@location = ""
@dummy_window.visible = false
self.visible = false
end
end
#--------------------------------------------------------------------------
# Refresh.
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(0, 0, self.width - 32, 32, @location, 1)
end
# -------------
def dispose
super
@dummy_window.dispose
end
#--------------------------------------------------------------------------
# Frame Update.
#--------------------------------------------------------------------------
def update
super
if @frames > 0
@frames -= 1
end
if @frames == 0
@frames = -1
self.visible = false
@dummy_window.visible = false
end
end
end


Then in Scene_Map go to def main and paste below '@message_window = Window_Message.new' this:

CODE
@location_window = Window_Location.new


Then paste below '@message_window.dispose' this:

CODE
?  @location_window.dispose


Then in def update, paste below '@message_window.update' this:

CODE
?  @location_window.update


Then at the end of the class before the last 'end' past this:

CODE
? def set_location(location)
?  ? @location_window.location = location
? end


Then you're complete! In order to make it work you'll have to create a new auto-start event on the map and make it call script:

CODE
$scene.set_location("location name")


Then make a switch that will turn it off. You don't have to make new switches for every location window you turn off, just make one and use it over-over again then when you leave the area make the teleport event turn off the location switch.

If you'd like to see this script in action you can view the demo.
NOT AVAILABLE as of December 21.2008
Let me know if you have any problems.
Reason for edit: Original Script was corrupted + Demo is non-existent
Go to the top of the page
 
+Quote Post
   
grand552
post Oct 17 2005, 05:38 PM
Post #2



Group Icon

Group: Member
Posts: 3
Type: None
RM Skill: Beginner




I Have recently moved from rm2k3 to rmxp so im new at scripting. I tried this script but I only ger an error:

?????'window_location' ? 28??? RGSSERORR???????
Disposed window

what does this mean am i missing something? sad.gif
Go to the top of the page
 
+Quote Post
   
Rpgx
post Oct 18 2005, 12:36 PM
Post #3


lolwut?
Group Icon

Group: Revolutionary
Posts: 924
Type: Event Designer
RM Skill: Undisclosed




Hi there! I think that you may have pasted somthing wrong. I tried that script before and I got the exact samething. Then I deleted the script and copyed/pasted it again and it worked fine. Althought I recommend you make a back up copy of your orginal script if you didn't already. If you forgot to just make a new file and copy that file's script.

Hope it works for you!


__________________________




I don't have a lot of userbars....
Go to the top of the page
 
+Quote Post
   
Rydin
post Oct 18 2005, 01:43 PM
Post #4


Level 43


Group: Retired Admin Staff
Posts: 1,185
Type: None
RM Skill: Undisclosed




Hm.. yes, you should probly take rpgx's idea by redoing the script. If you have the same error then paste your code up here.
Go to the top of the page
 
+Quote Post
   
Rpgx
post Oct 18 2005, 03:57 PM
Post #5


lolwut?
Group Icon

Group: Revolutionary
Posts: 924
Type: Event Designer
RM Skill: Undisclosed




Hey Grand! I just wanted to post something to ask if you got it to work yet. Tell me if ya did. Otherwise do what Rydain said and post the script up. I'll check it with Rydain's if he doesn't have the time! If he does well then he'll tell ya. . Actually I think I will give you the script again. If you copyed everything and it still doesn't work I'll try to inform Rydain or inform Darkling to inform Rydain

Peace!


__________________________




I don't have a lot of userbars....
Go to the top of the page
 
+Quote Post
   
grand552
post Nov 7 2005, 01:31 PM
Post #6



Group Icon

Group: Member
Posts: 3
Type: None
RM Skill: Beginner




QUOTE (Rpgx @ 18th October 2005)
Hey Grand! I just wanted to post something to ask if you got it to work yet. Tell me if ya did. Otherwise do what Rydain said and post the script up. I'll check it with Rydain's if he doesn't have the time! If he does well then he'll tell ya. . Actually I think I will give you the script again. If you copyed everything and it still doesn't work I'll try to inform Rydain or inform Darkling to inform Rydain

Peace!
*

Yes as a matter of fact I did get it working, However What i did to make it work was copy the code from the "Demo" this way I know i did it right, Just to make sure the script was posted right I did what you said by cuting and pasting it again and it worked fine then 2, And i must say this is a great Script You can really do a lot with it! Thank you both for your help biggrin.gif
Go to the top of the page
 
+Quote Post
   
Rpgx
post Nov 7 2005, 02:06 PM
Post #7


lolwut?
Group Icon

Group: Revolutionary
Posts: 924
Type: Event Designer
RM Skill: Undisclosed




Ah screww that! My old game got erased which isn't such a bad thing because now I can use this script! I must say it is awesome!

This post has been edited by Rpgx: Nov 12 2005, 07:33 AM


__________________________




I don't have a lot of userbars....
Go to the top of the page
 
+Quote Post
   
Noobitron
post Jan 26 2006, 03:41 AM
Post #8


Level 2
Group Icon

Group: Member
Posts: 17
Type: None
RM Skill: Advanced




Cool, the demo worked perfect biggrin.gif
Go to the top of the page
 
+Quote Post
   
Noobitron
post Jan 27 2006, 03:30 AM
Post #9


Level 2
Group Icon

Group: Member
Posts: 17
Type: None
RM Skill: Advanced




Wow, this turned out great when i added to my game. :Smilie7:
Go to the top of the page
 
+Quote Post
   
jens009
post Feb 13 2006, 01:58 AM
Post #10


L Did you know? Death gods... only eat apples
Group Icon

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled




Okay I'm having problems with this one...

The demo doesnt work and when i tried pasting it I get a weird error that
says

"nomethoderror occur while running script. undefined method 'set_location for #<Scene_Map:0x2097548>


__________________________

My RMXP Project:


Farewell RRR. =]
Go to the top of the page
 
+Quote Post
   
Rpgx
post Feb 13 2006, 11:17 AM
Post #11


lolwut?
Group Icon

Group: Revolutionary
Posts: 924
Type: Event Designer
RM Skill: Undisclosed




OH the link was broken. Sorry if I said that I don't have it in the PM. Here is the new link..

http://www.rrrevolution.com/uploads/location_demo.zip

There ya go. Hope it helps. :Smilie6:

ALSO. Please listen up all you newbs. smile.gif In the script it shows that A variable thing. Well that is just a japenese variable. If you use the script delete that.

So all these ?'s Must be deleted. I deleted some. Well only 4.

CODE
class Window_Location < Window_Base
 #------------------------------
 attr_accessor :location
 #--------------------------------------------------------------------------
 # Initialize the Object.
 #--------------------------------------------------------------------------
 def initialize
?  ? super(144, 4, 352, 64)
?  ? self.contents = Bitmap.new(width - 32, height - 32)
?  ? self.back_opacity = 255
?  ? self.contents.font.name = "Arial"
?  ? self.contents.font.size = 22
?  ? self.opacity = 0
?  ? self.z = 1050
?  ? @dummy_window = Window_Base.new(144, 10, 352, 52)
?  ? @dummy_window.z = 1000
?  ? @dummy_window.opacity = 255
?  ? @dummy_window.visible = false
?  ? @location = ""
?  ? @frames = -1
?  ? refresh
? end
? #----------------------------------
? def location=(location)
?  ? if location != ""
?  ?  ? @location = location
?  ?  ? @frames = 120
?  ?  ? @dummy_window.visible = true
?  ?  ? self.visible = true
?  ?  ? refresh
?  ? else
?  ?  ? @location = ""
?  ?  ? @dummy_window.visible = false
?  ?  ? self.visible = false
?  ? end
? end
? #--------------------------------------------------------------------------
? # Refresh.
? #--------------------------------------------------------------------------
? def refresh
?  ? self.contents.clear
?  ? self.contents.draw_text(0, 0, self.width - 32, 32, @location, 1)
? end
? # -------------
? def dispose
?  ? super
?  ? @dummy_window.dispose
? end
? #--------------------------------------------------------------------------
? # Frame Update.
? #--------------------------------------------------------------------------
? def update
?  ? super
?  ? if @frames > 0
?  ?  ? @frames -= 1
?  ? end
?  ? if @frames == 0
?  ?  ? @frames = -1
?  ?  ? self.visible = false
?  ?  ? @dummy_window.visible = false
?  ? end
? end
end


This post has been edited by Rpgx: Feb 13 2006, 11:20 AM


__________________________




I don't have a lot of userbars....
Go to the top of the page
 
+Quote Post
   
jens009
post Feb 13 2006, 01:12 PM
Post #12


L Did you know? Death gods... only eat apples
Group Icon

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled




QUOTE (Rpgx @ Feb 13 2006, 11:17 AM)
OH the link was broken. Sorry if I said that I don't have it in the PM. Here is the new link..

http://www.rrrevolution.com/uploads/location_demo.zip

There ya go. Hope it helps.  :Smilie6:

ALSO. Please listen up all you newbs.  smile.gif  In the script it shows that A variable thing. Well that is just a japenese variable. If you use the script delete that.

So all these ?'s Must be deleted. I deleted some. Well only 4.

CODE
class Window_Location < Window_Base
?#------------------------------
?attr_accessor :location
?#--------------------------------------------------------------------------
?# Initialize the Object.
?#--------------------------------------------------------------------------
?def initialize
? ?? super(144, 4, 352, 64)
? ?? self.contents = Bitmap.new(width - 32, height - 32)
? ?? self.back_opacity = 255
? ?? self.contents.font.name = "Arial"
? ?? self.contents.font.size = 22
? ?? self.opacity = 0
? ?? self.z = 1050
? ?? @dummy_window = Window_Base.new(144, 10, 352, 52)
? ?? @dummy_window.z = 1000
? ?? @dummy_window.opacity = 255
? ?? @dummy_window.visible = false
? ?? @location = ""
? ?? @frames = -1
? ?? refresh
? end
? #----------------------------------
? def location=(location)
? ?? if location != ""
? ?? ?? @location = location
? ?? ?? @frames = 120
? ?? ?? @dummy_window.visible = true
? ?? ?? self.visible = true
? ?? ?? refresh
? ?? else
? ?? ?? @location = ""
? ?? ?? @dummy_window.visible = false
? ?? ?? self.visible = false
? ?? end
? end
? #--------------------------------------------------------------------------
? # Refresh.
? #--------------------------------------------------------------------------
? def refresh
? ?? self.contents.clear
? ?? self.contents.draw_text(0, 0, self.width - 32, 32, @location, 1)
? end
? # -------------
? def dispose
? ?? super
? ?? @dummy_window.dispose
? end
? #--------------------------------------------------------------------------
? # Frame Update.
? #--------------------------------------------------------------------------
? def update
? ?? super
? ?? if @frames > 0
? ?? ?? @frames -= 1
? ?? end
? ?? if @frames == 0
? ?? ?? @frames = -1
? ?? ?? self.visible = false
? ?? ?? @dummy_window.visible = false
? ?? end
? end
end

*


Thanks RPGX!!

By the way instead of deleting all A's better yet click

View and then click encoding then click Unicode

Saves time

Thanks again rpgx!


__________________________

My RMXP Project:


Farewell RRR. =]
Go to the top of the page
 
+Quote Post
   
Rpgx
post Feb 13 2006, 01:21 PM
Post #13


lolwut?
Group Icon

Group: Revolutionary
Posts: 924
Type: Event Designer
RM Skill: Undisclosed




No problem. I love helping people. Yes that would be an easier way. But sometimes it doesn't work because its unicoded in the first place. Once I looked at a script and I selected unicode but it still had that A thing.


__________________________




I don't have a lot of userbars....
Go to the top of the page
 
+Quote Post
   
sithious
post Apr 26 2006, 11:09 AM
Post #14


Level 12
Group Icon

Group: Revolutionary
Posts: 204
Type: Artist
RM Skill: Skilled




Ok, sory for resurecting a old topic, but i was wondering what changes id have to meke to this script to make the little window fade away nd not just dissapere.


__________________________


Dont hate me cos i spell bad.
Go to the top of the page
 
+Quote Post
   
sithious
post Apr 27 2006, 12:53 AM
Post #15


Level 12
Group Icon

Group: Revolutionary
Posts: 204
Type: Artist
RM Skill: Skilled




Sry for DP, but heres something i also need to ask... When i make the location window for my world map and i enter a village then exit it, the floting window doesnt appere again.... How do i make it appere always.
The swich seems to kill that option but if i dont imput the swich the entire thing freezes up -.-" HEEEEEEEEEEEEEEELLLLLLLLLLLLLLPPPPPPPPPPP


__________________________


Dont hate me cos i spell bad.
Go to the top of the page
 
+Quote Post
   
platipus
post Jun 18 2006, 12:49 PM
Post #16


Level 11
Group Icon

Group: Revolutionary
Posts: 191
Type: Event Designer
RM Skill: Skilled




The picture and the demo link doesnt work anymore =/.


__________________________
using xp now and will continue to until a better rpg maker
Go to the top of the page
 
+Quote Post
   
jens009
post Jun 18 2006, 01:36 PM
Post #17


L Did you know? Death gods... only eat apples
Group Icon

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled




QUOTE (platipus @ Jun 18 2006, 12:49 PM)
The picture and the demo link doesnt work anymore =/.
*


Read the whole post to find out where you can download the demo..

QUOTE
Sry for DP, but heres something i also need to ask... When i make the location window for my world map and i enter a village then exit it, the floting window doesnt appere again.... How do i make it appere always.
The swich seems to kill that option but if i dont imput the swich the entire thing freezes up -.-" HEEEEEEEEEEEEEEELLLLLLLLLLLLLLPPPPPPPPPPP


Okay put the segment of the script in autorun event

THen after the script has been place place an erase command below it..

So it should look like this:
CODE
New Event:
Trigger: Autorun
@>Script: $scene.set_location("location name")
@>Erase Event


This post has been edited by jens009: Jun 18 2006, 01:39 PM


__________________________

My RMXP Project:


Farewell RRR. =]
Go to the top of the page
 
+Quote Post
   
DrakeOneil
post Oct 10 2008, 11:18 AM
Post #18


Level 5
Group Icon

Group: Member
Posts: 71
Type: Developer
RM Skill: Advanced




Hey! I did the rest of the work and took the rest of the [/color]?[color="#000000"] away from it so here.

CODE
class Window_Location < Window_Base
#------------------------------
attr_accessor :location
#--------------------------------------------------------------------------
# Initialize the Object.
#--------------------------------------------------------------------------
def initialize
super(144, 4, 352, 64)
self.contents = Bitmap.new(width - 32, height - 32)
self.back_opacity = 255
self.contents.font.name = "Arial"
self.contents.font.size = 22
self.opacity = 0
self.z = 1050
@dummy_window = Window_Base.new(144, 10, 352, 52)
@dummy_window.z = 1000
@dummy_window.opacity = 255
@dummy_window.visible = false
@location = ""
@frames = -1
refresh
end
#----------------------------------
def location=(location)
if location != ""
@location = location
@frames = 120
@dummy_window.visible = true
self.visible = true
refresh
else
@location = ""
@dummy_window.visible = false
self.visible = false
end
end
#--------------------------------------------------------------------------
# Refresh.
#--------------------------------------------------------------------------
def refresh
self.contents.clear
self.contents.draw_text(0, 0, self.width - 32, 32, @location, 1)
end
# -------------
def dispose
super
@dummy_window.dispose
end
#--------------------------------------------------------------------------
# Frame Update.
#--------------------------------------------------------------------------
def update
super
if @frames > 0
@frames -= 1
end
if @frames == 0
@frames = -1
self.visible = false
@dummy_window.visible = false
end
end
end


__________________________
Time will always go on,
Will you?
Go to the top of the page
 
+Quote Post
   
jens009
post Dec 21 2008, 10:56 AM
Post #19


L Did you know? Death gods... only eat apples
Group Icon

Group: +Gold Member
Posts: 2,976
Type: Scripter
RM Skill: Skilled




Thanks DrakeOneil. I have updated the original post so that they use the version of the script you fixed.
I'm adding this now to the script catalog.


__________________________

My RMXP Project:


Farewell RRR. =]
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: 21st May 2013 - 06:35 PM
RPG RPG Revolution is an Privacy Policy and Legal
eXTReMe Tracker