Main Menu
  • Welcome to The RPG Maker Resource Kit.

How to enable/disable the 1st-Person CMS?

Started by gameo, May 15, 2007, 10:55:29 AM

0 Members and 1 Guest are viewing this topic.

gameo

I'm currently using the 1st-Person CMS (Can't remember who made it though), and it works marvelous. But it would be nice if there were a way to disable it when i have more than 1 member in the party. NOT like in the script if its not nessesary, but in an event, perhaps.
Does 2+2 equal a peanut?

gameo

Anyone? I think i was being very specific.
Does 2+2 equal a peanut?

modern algebra

Well, we don't know what the script is, so I am unfortunately not able to tell you a Call Script which would disable it. Does the Change Menu Access not disable it? If it doesn't, try renaming the class to Scene_Menu maybe. If neither of those work, post the script and I will be able to tell you a solution.

WcW

So one of the main members of the site forgot to SEARCH for it- that's new.  Its on the second page in the Scripts Database, here's a link: http://rmrk.net/index.php/topic,6408.0.html
Just name it Scene_Menu, as it has nothing inside of it to disable it.
If you are reading this, the government of the U.S.A. is currently planting a chip in your brain.
People like decreasing my Rep. In fact, people like decreasing most others people's rep.

modern algebra

Well, if he's using that particular 1-person CMS, then it is already titled properly and he can use the Event Command to disable menu access.

There are more than one 1-person CMSes out there though, and so maybe it is a different one.

I may have misread the question anyway. It seems like you want that menu to appear only if you have just one member, and do you want a different menu to appear if you have more then one? Aside from advising against it for stylistic reasons, it's not hard to do, though if you do it through events, you may have some little problems occur. Scripting would be the way to go with this type of thing. It would only be maybe a couple of lines of script.

WcW

Common Event it if you don't want script. Just make it where every time a party member is added, increase a variable by one, and every time one leaves, decrease the variable by one.  The make a common event where Conditional Statement is variable is greater than 1, the menu is disable, and else it is enabled.  Simple.  But modern's way is better, less space used up.
If you are reading this, the government of the U.S.A. is currently planting a chip in your brain.
People like decreasing my Rep. In fact, people like decreasing most others people's rep.

Zeriab

Do you want another menu to come up if you have more than 1 person in the party?

gameo

Allright, i'll try again.

When i have 1 person in the party, the 1st-person script should be enabled.

When i then add a member or more to the party, it should disable, and the DMS should appear. (Default Menu System, but you properbly know that)
Does 2+2 equal a peanut?

modern algebra

#8
Okay, that's no problem.

If you are using Constance's 1-person CMS, then just find the Scene_Menu class inside the script, and replace it with this:


class Scene_Menu
#--------------------------------------------------------------------------
# * Main Processing
#--------------------------------------------------------------------------
def main
  if $game_party.actors.size == 1
#*************Character Coding****************
#Character's Small Status Window
@window_character = Window_Character.new
@window_character.y =280
#-----------------------
#Character's Large Status Window
@window_status_character = Window_StatusCharacter.new
@window_status_character.x =200
@window_status_character.y =280
#-----------------------
#Character's Animated Sprite Window
@window_sprite = Window_Sprite.new
@window_sprite.y =280
@window_sprite.frame_update
@window_sprite.opacity = 0
@window_sprite.back_opacity = 0
#-----------------------
#Character's Battler Window
@window_battler = Window_Battler.new
@window_battler.x = 240
@window_battler.y = 252
@window_battler.z = 501
@window_battler.opacity = 0
@window_battler.back_opacity = 0
@window_battler.contents_opacity = 100
#================================
#**********Command Window Coding************
#The command window which bases it's commands off of @commands
@commands = ["Item", "Skill", "Equip", "Load", "Save", "Quit"]
@command_window = Window_NewCommand.new(@commands)
#Dummy Window containing the command's words
@window_commands = Window_Commands.new
@window_commands.z = 500
@window_commands.opacity = 0
@window_commands.back_opacity = 0
#Dummy Window containing the pictures of the icons
@window_icons = Window_Icons.new
@window_icons.opacity = 0
@window_icons.back_opacity = 0
@window_icons.contents_opacity = 100
#================================
#************Miscellaneous Coding**************
#Creates the Sprite's Frame
@update_frame = 0
#-----------------------
#Location Window
@window_location = Window_Location.new
@window_location.x =420
#-----------------------
#Playtime Window
@playtime_window = Window_PlayTime.new
@playtime_window.x = 270
#-----------------------
#Map in the Background
@spriteset = Spriteset_Map.new
#Holds ALL windows in one instance variable for better management
@windows =[@window_location, @window_character, @window_status_character,
                    @playtime_window, @command_window, @window_battler, @window_commands,
                    @window_icons, @window_sprite, @spriteset]
#================================
# Execute transition
Graphics.transition
# Main Loop
loop do
# Update game screen
Graphics.update
#Update input information
Input.update
#**********Frame Updates for Sprite*************
@update_frame += 1
if @update_frame == 5
@update_frame = 0
@window_sprite.frame_update
end
#**********Frame Updates for Sprite*************
# Frame update
update
#Abort Loop if Screen is Changed
if $scene != self
break
end
end
#Dispose of Windows
Graphics.freeze
@windows.each {|windows| windows.dispose}
else
  $scene = Scene_Menu_2.new
end
end
#================================
#Update Method
def update
@playtime_window.update
@command_window.update
#Sets a Condition for Command Window
if @command_window.active
update_command
return
end
end
#Update Command Method
def update_command
if Input.trigger?(Input::B)
$game_system.se_play($data_system.cancel_se)
$scene = Scene_Map.new
return
end
if Input.trigger?(Input::C)
if $game_party.actors.size == 0 and @command_window.index < 4
$game_system.se_play($data_system.buzzer_se)
return
end
#Case for Command Window's Index
case @command_window.index
when 0
$game_system.se_play($data_system.decision_se)
$scene = Scene_Item.new
when 1
$game_system.se_play($data_system.decision_se)
$scene = Scene_Skill2.new(0)
when 2
$game_system.se_play($data_system.decision_se)
$scene = Scene_Equip2.new(0)
when 3
$game_system.se_play($data_system.decision_se)
$scene = Scene_Load2.new
when 4
if $game_system.save_disabled
$game_system.se_play($data_system.buzzer_se)
return
end
$game_system.se_play($data_system.decision_se)
$scene = Scene_Save.new
when 5
$game_system.se_play($data_system.decision_se)
$scene = Scene_End.new
end
return
end
end
end


Then rename the Scene_Menu class for the Default to Scene_Menu_2, and it will work

If you are not using Constance's One Person CMS (the one linked above), I will go over what I did.

Basically, directly under def main in the Scene_Menu class,

I put this:

if game_party.actors.size == 1

then, right before the final end in that method, I put

else
  $scene = Scene_Menu_2.new
end


And, as I said before, you need to rename the Default Menu class to Scene_Menu_2

If you don't understand, post the script you are using and I will do it for you.


gameo

Well, it works, but when i enter any of the options in the DMS, and go back it gives me this error on some different lines, like Scene_Skill and Scene_Equip:


In skills:

Script 'Scene_Skill' line 83: Argument error occured.

wrong number of arguments(1 for 0)


It would be the same for equip, status, and items, just on different lines.




Does 2+2 equal a peanut?

modern algebra

OKay, just go inside each of the respectful scene scripts, and find the line that says

$scene = Scene_Menu.new(X), where X is a number

then replace it with Scene_Menu_2.new(X)

Just add the _2 and you should be fine.

If you need help finding the line, just use CTRL-F inside the script editor, or just go into them in the menu and it will give you the error and when you open the script editor, that will be a line you need to change.

Zeriab

You can do something like this:
[spoiler=code]#==============================================================================
# ** CMS chooser (Scene_Menu)
#------------------------------------------------------------------------------
#  This class points to the appropiate CMS when Scene_Menu is called
#  Edit this class at will.
#==============================================================================

class Scene_Menu
  #--------------------------------------------------------------------------
  # * Object Initialization
  #     *args : These arguments will be passed on to the chosen scene
  #--------------------------------------------------------------------------
  def initialize(*args)
    @args = args
  end
  #--------------------------------------------------------------------------
  # * Main Processing
  #   edit this to your liking
  #   try to add the arguments to the new scene by (*@args)
  #   there's an rescue option where you can handle errors
  #--------------------------------------------------------------------------
  def main
    if $game_party.actors.size == 1
      $scene = Scene_Menu_1_Person.new(*@args)
    else
      $scene = Scene_Menu_Ori.new(*@args)
    end
  rescue StandardError => err
    # In case something goes wrong.
    # You can print an error message or just use it as a default action
    $scene = Scene_Menu_Ori.new
  end
end
[/spoiler]

Just rename the Scene_Menu class of the DMS to Scene_Menu_Ori and the Scene_Menu class of the 1 person CMS to Scene_Menu_1_Person to use this script.
You can always modify it to suit your needs.
I assume that the 1 person CMS does not use the DMS.

It's hard doing more without knowing the script you are using ^_^