Erase Save File and Item Storage Stuff

Started by Hadeki, January 15, 2009, 11:17:51 pm

Previous topic - Next topic

Hadeki

It's fine. :up:
As long as I can make my game without running into problems when I try to add the script, then you can take your time. So far I don't think I NEED the script to continue making my game.

Fantasist

Do you like ambient/electronic music? Then you should promote a talented artist! Help out here. (I'm serious. Just listen to his work at least!)


The best of freeware reviews: Gizmo's Freeware Reviews




Hadeki

Yet another quick question.
How do I change the name of a map during gameplay? Well, what I want to do is change the name of a map once a certain switch is turned on.

Hadeki

I tried using a parallel process event that shuts off once the name changes, but I have no idea how to change the name...  :(

Reno-s--Joker

Wait um... why would you want to change the name?
I might be wrong but it may be a lot easier to change the "name"... if you know what I mean. :shifty:

G_G

try
$data_maps[id_here].name = "Penguins On Crack"

Hadeki

I tried that script, Game Guy, and it didn't really work. Well, I may be using it in an incorrect way, I guess.
I have a conditional branch where if a certain switch is on, it calls the script you gave me. But the map's name stays the same when I turn the switch on.
P.S. I'm checking if the map name changes by using a script that shows the map name in the menu.

And... what, Reno?

nathmatt

April 05, 2009, 06:37:40 pm #47 Last Edit: April 05, 2009, 06:49:41 pm by nathmatt
y not just use a variable then u can change the map name whenever u want because its not realy the map name if u want to check the map name use this
$map_infos = load_data('Data/MapInfos.rxdata')
$map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name}
from winkos hud

so example using the first variable would be
$game_variables[1] = load_data('Data/MapInfos.rxdata')
$game_variables[1].keys.each {|key| $game_variables[1][key] = $game_variables[1][key].name}
the would just use a call script $game_variables[1] = "Map new name"
note this will not change the original map name just look like it
also not tested but should work
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Hadeki

I used your method and it gave me a wrong number of arguments error. I'm not sure how to apply the scripting you gave me though.
Would I set
     $game_variables[1] = load_data('Data/MapInfos.rxdata')
     $game_variables[1].keys.each {|key| $game_variables[1][key] = $game_variables[1][key].name}
as a parallel event and then
     $game_variables[1] = "Map new name"
as another event that starts when a certain switch is turned on?

nathmatt

April 05, 2009, 07:08:15 pm #49 Last Edit: April 05, 2009, 07:09:32 pm by nathmatt
what is displaying the map name if ur using a script show the script that might help
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Hadeki

I'm using the location name window thing by Juan. I think I got it from Chaos Project.

Spoiler: ShowHide
#==============================================================================
# ** Location Window
#------------------------------------------------------------------------------
# Juan 
# Version 1.4
# made 10/13/07
# Date last time updated 12/30/07
#==============================================================================
# Any bugs email me juanpena1111@yahoo.com
# Version History
#
# Version 1.0
# -> This script was first made.
# Version 1.1
# -> Fixed font bug
# Version 1.2
# -> Removed * in map name.
# Version 1.3
# -> You can now change the location name.
# Version 1.4
# -> Improed coding
#
# Compatibility:
# This script changes the windows steps window to display the map name. What  that means
# is this script will not work on some cms(custom menu systems) if they
# don't use the step window
#
# Features
# Displays the map name.
# Removed the * in map name.
# Less code than other location scripts
#
# Author's Notes
# Any bugs email me juanpena1111@yahoo.com
# Credit me and enjoy.
#
#
#==============================================================================
# ** Window_Location
#------------------------------------------------------------------------------
#  This window displays map location on the menu screen.
#==============================================================================

class Window_Location < Window_Base
  #--------------------------------------------------------------------------
  # * Object Initialization
  #--------------------------------------------------------------------------
  def initialize
    super(0, 0, 160, 96)
    self.contents = Bitmap.new(width - 32, height - 32)
    refresh
  end
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if $fontface != nil
    self.contents.font.name = $fontface
    elsif $defaultfonttype != nil
    self.contents.font.name = $defaultfonttype
    end
    self.contents.font.size = 21   
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 80, 32, " ")
    self.contents.font.color = normal_color
    if $game_map.name.include?('*')
    self.contents.draw_text(4, 32, 120, 32, $game_map.name.delete!('*'), 2)
    else
    self.contents.draw_text(4, 32, 120, 32, $game_map.name, 2)
    end
  end
end

nathmatt

April 05, 2009, 07:30:04 pm #51 Last Edit: April 05, 2009, 07:57:56 pm by nathmatt
here u go no need to use a switch just use this to change it $game_variables[1] = "mapname"
then this to change it back $game_variables[1] = $game_map.name
Spoiler: ShowHide

#==============================================================================
# ** Location Window
#------------------------------------------------------------------------------
# Juan 
# Version 1.4
# made 10/13/07
# Date last time updated 12/30/07
#==============================================================================
# This script changes the step window to a location window(displays map name.)
# by changing the steps wiindow to display a location window.
# Any bugs email me juanpena1111@yahoo.com
# Version History
#
# Version 1.0
# -> This script was first made.
# Version 1.1
# -> Fixed font bug
# Version 1.2
# -> Removed * in map name.
# Version 1.3
# -> You can now change the location name.
# Version 1.4
# -> Improed coding
#
# Compatibility:
# This script changes the windows steps window to display the map name. What  that means
# is this script will not work on some cms(custom menu systems) if they
# don't use the step window
#
# Features
# Displays the map name.
# Removed the * in map name.
# Less code than other location scripts
#
# Instructions
# Make a new script above main and paste this script there. You should
# also configure the location name. Just change the Location Name = 'Location'
# FAQ (Frequently Asked Questions):
# None yet

# Author's Notes
# Any bugs email me juanpena1111@yahoo.com
# Credit me and enjoy.
#
#
#==============================================================================
# module Juan_Configuration
#==============================================================================

module Juan_Configuration
 
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# START Configuration
#:::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::: 
# Begin Configuration
Location_Name = 'Location'
# End Configuration.
end
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
# END Configuration
#::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

#==============================================================================
# Scene_Title
#==============================================================================

class Scene_Title

  alias main_juans_custom_menu_later main
  def main
    $map_infos = load_data('Data/MapInfos.rxdata')
    $map_infos.keys.each {|key| $map_infos[key] = $map_infos[key].name}
    main_juans_custom_menu_later
    $game_variables[1] = $game_map.name
end
end
#===================================================
# * Class Scene_Title Ends
#===================================================


#===================================================
# * Class Game_Map Begins
#===================================================
class Game_Map
def name
return $map_infos[@map_id]
end
end
#===================================================
# * Class Game_Map Ends
#===================================================



#===================================================
# * Class Window_Steps Begins
#===================================================
class Window_Steps < Window_Base
  #--------------------------------------------------------------------------
  # * Refresh
  #--------------------------------------------------------------------------
  def refresh
    if $fontface != nil
    self.contents.font.name = $fontface
    elsif $defaultfonttype != nil
    self.contents.font.name = $defaultfonttype
    end
    self.contents.font.size = 24     
    self.contents.clear
    self.contents.font.color = system_color
    self.contents.draw_text(4, 0, 80, 32, Juan_Configuration::Location_Name)
    self.contents.font.color = normal_color
    if $game_map.name.include?('*')
    self.contents.draw_text(4, 32, 120, 32, $game_variables[1].delete!('*'), 2)
    else
    self.contents.draw_text(4, 32, 120, 32, $game_variables[1], 2)
    end
  end
end
#===================================================
# * Class Window_Steps Ends
#===================================================
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Hadeki

Waaaaait. Am I able to see the name of other maps? And can I change the name of more than one map during game play? It seems like this script is a lot more work than it should be.
But I'm not really a good scripter...

Also, I get this error when I try to test play my game:
"Script 'Window_Location' line 69: NameError occurred.
undefined method `main' for class `Scene_Title'"

nathmatt

April 05, 2009, 07:59:38 pm #53 Last Edit: April 05, 2009, 08:05:30 pm by nathmatt
hmm i need to work on this some more because its not refreshing when i leave the map
Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Hadeki

I did put it above main, and I remember changing the location name script a little bit to fit my game better.
Is that script the problem though? It seems like the script wouldn't really change anything as long as I changed the map's actual name.
Also, I may just make it so when a certain switch is turned on the player is transferred to a similar map with the new name. Should I just do that?

nathmatt

Join Dead Frontier
Sorry, I will no longer be scripting for RMXP. I may or may not give support for my scripts. I don't have the will to script in RGSS anymore.
My script


Hadeki

Okay. Thank you for your help. I just wanted to make sure there wasn't a super easy way to deal with it.

Aqua

Why not instead of changing the name of the map, you just duplicate the map and have 2 different names? :D

shdwlink1993

A slightly better-working version of the same thing:

Place this script anywhere between the original Location Window script and Main:

class Game_Map 
  def name
    case @map_id
    when 4
      if $game_switches[1]
        return 'Name'
      else
        return 'Different Name'
      end
    when 34
      if $game_switches[322]
        return 'Diabolical Overlord Airway Flight 73'
      else
        return 'Unknown Aircraft'
      end
    when MAP_ID
      if $game_switches[SWITCH_ID]
        return 'NAME 2'
      else
        return 'NAME 1'
      end
    else
      return $map_infos[@map_id]
    end
  end
end


Basically, you just switch out the numbers and names. The last entry with the capital letters is a template to show you what I mean. This should help you out, I think.

EDIT: Ah, crud. You already decided to do something completely different.  :'(
Stuff I've made:




"Never think you're perfect or else you'll stop improving yourself."

"Some people say the glass is half full... some half empty... I just wanna know who's been drinking my beer."

Hadeki

Quote from: Aqua on April 05, 2009, 08:11:16 pm
Why not instead of changing the name of the map, you just duplicate the map and have 2 different names? :D


Ha ha. I agree. I did decide to do that.


BUT WAIT!
Shadow Link, you are a genius. Thank you. It works perfectly.