Chaos Project

RPG Maker => General Discussion => Troubleshooting / Help => Topic started by: evilbob on January 30, 2008, 11:19:50 am

Title: [RESOLVED] Small question involving a script and a switch
Post by: evilbob on January 30, 2008, 11:19:50 am
Hi, I was wodnering if its possible to edit a script so that it will only come into effect when a switch is on?  I tried fiddling around but I don't really know what im doing :(  Basically i'm trying to make it so when  a switch is on the battle system will be the GTBS, and when it's off it will be the normal battle system (in this case minkoff's). 

I'm guessing its probably not doable, but I'd thought I'd ask.

Thanks in advance for any help

p.s like the new forums :)
Title: Re: Small question involving a script and a switch
Post by: Blizzard on January 30, 2008, 12:26:39 pm
It actually it, but it would require some nasty extra coding. Best would be if a scripter adds that to your game. Or an alternative would be that your rename one of the "scenes" into something else than Scene_Battle. Then you would simply call it instead of the real battle scene from the actual battle scene with this extra script:
class Scene_Battle
 
  alias main_battler_override_later main
  def main
    if $game_switches[XXX]
      main_battler_override_later
    else
      $scene = Scene_Battle2.new
    end
  end
 
end


In that case, if you turn on switch XXX, it will allow the original battle scene while when turned off it will call the renamed scene. That would be the quickest and easiest way that I know. The question is just if everything will work right. You can try it if you want. Put this script below ALL scripts and ABOVE Main.
Title: Re: Small question involving a script and a switch
Post by: Fantasist on January 30, 2008, 01:12:51 pm
I'm guessing both of those systems are aliased, so you might also need to copy all the Scene_Battles and rename their classes.

off topic: ShowHide
Multiple Battle Systems... I should release QC before all of it's features are eventually thought out and become popular :o
Title: Re: Small question involving a script and a switch
Post by: Nortos on January 31, 2008, 12:35:37 am
btw easy replacing words just right click and than replace it replaces words very easily on page you're on if you didn't know, saves me a lot of time
Title: Re: Small question involving a script and a switch
Post by: evilbob on January 31, 2008, 05:33:14 am
Thank you everyone for replying so fast, I really appreciate it!

I'll try doing what you said but i'm quite hung over :P  No doubt i'll be back with a more specific question!  Thanks ever so much!