Main Menu
  • Welcome to The RPG Maker Resource Kit.

Floating Location Window

Started by Tsunokiette, February 06, 2006, 10:22:49 PM

0 Members and 1 Guest are viewing this topic.

Tsunokiette

Do you want a window to pop up everytime you enter a new map area? Just insert this above main.

class Scene_Title
 #Dubealex Addition (from XRXS) to show Map Name on screen
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
class Game_Map
#Dubealex Addition (from XRXS) to show Map Name on screen
def name
$map_infos[@map_id]
end
end
class Window_Float_Location < Window_Base
  def initialize(location = '')
     super(0,416,232,64)
     self.contents = Bitmap.new(width - 32, height - 32)
     self.contents.font.name = 'Times New Roman'
     self.contents.font.size = 22
     self.opacity = 100
     self.back_opacity = 100
     @location = location
     @wait_count = 70
     show_location
  end
  def show_location
     self.contents.clear
     self.contents.font.color = normal_color
     w = self.contents.width
     h = self.contents.height
     self.contents.draw_text(0,0,w,h,@location,0)
     wait
  end
  def wait
    loop do
      self.update
      @wait_count -= 1
      if @wait_count == 0
        break
      end
    end
    self.dispose
  end
  def update
    Graphics.update
  end
end
class Scene_Map
 def transfer_player
   # Clear player place move call flag
   $game_temp.player_transferring = false
   # If move destination is different than current map
   if $game_map.map_id != $game_temp.player_new_map_id
     # Set up a new map
     $game_map.setup($game_temp.player_new_map_id)
   end
   # Set up player position
   $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
   # Set player direction
   case $game_temp.player_new_direction
   when 2  # down
     $game_player.turn_down
   when 4  # left
     $game_player.turn_left
   when 6  # right
     $game_player.turn_right
   when 8  # up
     $game_player.turn_up
   end
   # Straighten player position
   $game_player.straighten
   # Update map (run parallel process event)
   $game_map.update
   # Remake sprite set
   @spriteset.dispose
   @spriteset = Spriteset_Map.new
   # If processing transition
   if $game_temp.transition_processing
     # Clear transition processing flag
     $game_temp.transition_processing = false
     # Execute transition
     Graphics.transition(20)
   end
   location = $game_map.name
   float_location = Window_Float_Location.new(location)
   # Run automatic change for BGM and BGS set on the map
   $game_map.autoplay
   # Frame reset
   Graphics.frame_reset
   # Update input information
   Input.update
 end
end


Yes I realize the code itself isn't that pretty, but I'll clean it up later, it was a quick job.

BTW: credit to dubealex for the location name itself.
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They're bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I'm the only one, I'm the only one."

Neko

Great script! but is there a way to make it so you can walk while it says the location?
QuoteZxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens
Pwnzorz'd

Neko

No answer? Seems kinda mean =\ (   Sorry for double post =[  )
QuoteZxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens
Pwnzorz'd

Tsunokiette

Quote from: NekoNo answer? Seems kinda mean =\ (   Sorry for double post =[  )

Well you happened to pick the 3 hours I was at karate -_- lol.

I'm working on that atm lol.

EDIT: well, I can, but as soon as you move anywhere, you go straight in that direction until the window goes away no matter what you press; which shouldn't be happening, so...
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They're bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I'm the only one, I'm the only one."

Neko

Erm.. ummm.. can you not make it like a regular message window really? like have it auto bring up a message window?
QuoteZxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens
Pwnzorz'd

blueXx

Quote from: NekoErm.. ummm.. can you not make it like a regular message window really? like have it auto bring up a message window?

if you want that you don't need a script..
put a message button on each teleporter

something like:

teleport(new map)
-message: Welcome to place X

and then you can have all sorts of useless stuff in the message ~_~

tsu , nice script, though being stuck until it goes away is sort of not the way i like it ~_~
holy shit my sig was big!

Neko

ok, but is there a way to make it kinda transparent and on the bottom corse like that?
QuoteZxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens
Pwnzorz'd

blueXx

Quote from: Nekook, but is there a way to make it kinda transparent and on the bottom corse like that?

message display options button.
just don't show window and bottom

using slipknot's script or rm2k3 or rm2k you can even make the window go away after a certain period of time
holy shit my sig was big!

Tsunokiette

To reduce the ammount of time the window shows, just find this line -

@wait_count = 70

And make the number lower.
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They're bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I'm the only one, I'm the only one."

blueXx

yar.. but any lower than that will make the map name hard to read
i actually want it a little bit longer but allowing the game to keep going with it could be really nice... >>
holy shit my sig was big!

Tsunokiette

Quote from: blueXxyar.. but any lower than that will make the map name hard to read
i actually want it a little bit longer but allowing the game to keep going with it could be really nice... >>

Got it... done... works...

(I kept forgetting to update the input, so here it is, and it also fades out now. I just forget to update the graphics sometimes.)

Here ya go.

class Scene_Title
 #Dubealex Addition (from XRXS) to show Map Name on screen
$map_infos = load_data("Data/MapInfos.rxdata")
for key in $map_infos.keys
$map_infos[key] = $map_infos[key].name
end
end
class Game_Map
#Dubealex Addition (from XRXS) to show Map Name on screen
def name
$map_infos[@map_id]
end
end
class Window_Float_Location < Window_Base
  def initialize(location = '')
     super(0,416,232,64)
     self.contents = Bitmap.new(width - 32, height - 32)
     self.contents.font.name = 'Times New Roman'
     self.contents.font.size = 22
     self.opacity = 200
     self.back_opacity = 200
     @location = location
     @wait_count = 200
     show_location
  end
  def show_location
     self.contents.clear
     self.contents.font.color = normal_color
     w = self.contents.width
     h = self.contents.height
     self.contents.draw_text(0,0,w,h,@location,0)
     wait
  end
  def wait
    loop do
      self.update
      $scene.update
      Input.update
      @wait_count -= 1
      if @wait_count == 0
        break
      end
    end
    for i in 1..40
      self.opacity -= 5
      self.back_opacity -= 5
      self.contents_opacity -= 5
      Graphics.update
      $scene.update
      Input.update
    end
    self.dispose
  end
  def update
    Graphics.update
  end
end class Scene_Map
 def transfer_player
   # Clear player place move call flag
   $game_temp.player_transferring = false
   # If move destination is different than current map
   if $game_map.map_id != $game_temp.player_new_map_id
     # Set up a new map
     $game_map.setup($game_temp.player_new_map_id)
   end
   # Set up player position
   $game_player.moveto($game_temp.player_new_x, $game_temp.player_new_y)
   # Set player direction
   case $game_temp.player_new_direction
   when 2  # down
     $game_player.turn_down
   when 4  # left
     $game_player.turn_left
   when 6  # right
     $game_player.turn_right
   when 8  # up
     $game_player.turn_up
   end
   # Straighten player position
   $game_player.straighten
   # Update map (run parallel process event)
   $game_map.update
   # Remake sprite set
   @spriteset.dispose
   @spriteset = Spriteset_Map.new
   # If processing transition
   if $game_temp.transition_processing
     # Clear transition processing flag
     $game_temp.transition_processing = false
     # Execute transition
     Graphics.transition(20)
   end
   location = $game_map.name
   float_location = Window_Float_Location.new(location)
   # Run automatic change for BGM and BGS set on the map
   $game_map.autoplay
   # Frame reset
   Graphics.frame_reset
   # Update input information
   Input.update
 end
end
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They're bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I'm the only one, I'm the only one."

Neko

YOU ARE A GOD! lol This is perfect thank you
QuoteZxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens
Pwnzorz'd

blueXx

holy shit my sig was big!

dwarra

Nice scripts  :P

This could be very useful.

Does it work?

Neko

It works great!!!I think I'm going to shorten the time that the window is up though.. its up for like 5 seconds or somthing but nobugs from what Ive seen so far =]
QuoteZxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens
Pwnzorz'd

Tsunokiette

Quote from: NekoIt works great!!!I think I'm going to shorten the time that the window is up though.. its up for like 5 seconds or somthing but nobugs from what Ive seen so far =]

*cough* there's only one, but it wont happen unless you go to a different map before the window goes away.

(it simply layers)
"The wonderful thing about Tiggers
Is Tiggers are wonderful things
Their tops are made out of rubber
Their bottoms are made out of springs

They're bouncy, trouncy, flouncy, pouncy
Fun, fun, fun, fun, fun!
But the most wonderful thing about Tiggers
Is I'm the only one, I'm the only one."

Neko

Can you like put a line or two that erases it when changed???
QuoteZxmelee says: I FUCKED A CHICK GEEZ
Neko says: I doubt it was a girl
Neko says: Was "she" working the corners?
Zxmelee says: Well, I was lying...
Zxmelee says: but, oh man. They were all over me
Neko says: With a few bucks
Neko says: That hapens
Pwnzorz'd

Blizzard

I found another bug. If you enter a map, the BGM of the new map won
Get King of Booze for Android, for iOS, for OUYA or for Windows!
Visit our website.
You can also love/hate us on Facebook or the game itself.



Get DropBox, the best free file syncing service there is!