Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

RPGXP: How can I turn off an entire 'Class' or Script?

Okay, when it comes to scripting, I definately am new, it's only been this past week that I've started looking towards editing my own scripts to get my desired effects. So I appologize if these things have been said one thousand times over. I looked through the FAQ, and all over the internet (maybe not in the right places).

But I have been trying to create a Menu Configuration which turns off an entire Script Page in the Script Editor from the Menu Screen.
I'll start with the facts:
I am using Cogwheel's RTAB as a battle system, Minto for the RTAB Menu configuration. However I also wanted to add the Option of classical Battle system... or in other words a default RMXP Battle System...

I had figured the easiest way to do that would to be to add the option within the Menu Configuration which would simply turn off the "Scene_Battle" Class/Page which held Cogwheel's Script and pulling up the Original 4 Scene_Battle pages to do their job. I have edited it so that it does indeed give that last option, however I do not know how to tell that option to do just that. Is there a way to turn that Page off in a command?

I appreciate the comments.
 
Hmm... I'm not entirely sure this will work, but try the following:

Look for "Class Scene_Battle" in the RTAB script and rename it "Class Scene_Battle2".

Then, go to Scene_Map and look for "def call_battle", replace it with the following.

If $game_switches[?] == on
$scene = Scene_Battle.new
else
$scene = Scene_Battle2.new
end

That way, if the switch ? (choose that switch yourself) is on, the battle style loaded will be the default one, if it's not, it will load the RTAB.

EDIT: Nevermind, I tried it myself and it causes conflicts with the rest of the script...
 
Doctor":391h5quw said:
Hmm... I'm not entirely sure this will work, but try the following:

Look for "Class Scene_Battle" in the RTAB script and rename it "Class Scene_Battle2".

Then, go to Scene_Map and look for "def call_battle", replace it with the following.

If $game_switches[?] == on
$scene = Scene_Battle.new
else
$scene = Scene_Battle2.new
end

That way, if the switch ? (choose that switch yourself) is on, the battle style loaded will be the default one, if it's not, it will load the RTAB.

EDIT: Nevermind, I tried it myself and it causes conflicts with the rest of the script...

lol...thanks, I appreciate the help though, and even taking the time to test it ^.^... I didn't actually expect any replies.

I keep racking my brain over a system that'll work, even if I can't write it correctly.
 

OS

Sponsor

This method does work.

I just created a test class (Scene_BattleX) and created the same conditional inside the call_battle method of Scene_Map. It works perfectly.

See:

Code:
  #--------------------------------------------------------------------------
  # * Battle Call
  #--------------------------------------------------------------------------
  def call_battle
    # Clear battle calling flag
    $game_temp.battle_calling = false
    # Clear menu calling flag
    $game_temp.menu_calling = false
    $game_temp.menu_beep = false
    # Make encounter count
    $game_player.make_encounter_count
    # Memorize map BGM and stop BGM
    $game_temp.map_bgm = $game_system.playing_bgm
    $game_system.bgm_stop
    # Play battle start SE
    $game_system.se_play($data_system.battle_start_se)
    # Play battle BGM
    $game_system.bgm_play($game_system.battle_bgm)
    # Straighten player position
    $game_player.straighten
    # Switch to battle screen
    if $game_switches[1] == true
      $scene = Scene_Battle.new
    else
      $scene = Scene_BattleX.new
    end
  end

This is what call_battle should look like. Replace the '1' in $game_switches[1] with the switch number you want to use. Make sure that the Scene_BattleX is the same name as the second battle script. It works for me, but if you can't get it to work, show me the second battle system and I'll see if I can help ya out.
 
¬_¬ That's exactly what I told him to do, OS. But Cogwheel's RTAB script doesn't like having it's name changed, apparently, and would require further change to make it operational. These changes, however, are beyond my current level of skill.
 

OS

Sponsor

I know it's what you said, but I didn't know if it went across very clear, because I didn't know if Elginive knew how to alter the code correctly. Sorry.

If the script is posted I can take a look at it.

Peace.
 
OS":2m52go0z said:
I know it's what you said, but I didn't know if it went across very clear, because I didn't know if Elginive knew how to alter the code correctly. Sorry.

If the script is posted I can take a look at it.

Peace.

Thank you, I am really new to the whole editing of scripts, so lol... I do unfortunately need quite simplistic instructions to make it work. Which script are you needing? Cogwheel's RTAB?
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top