[RESOLVED] Small question involving a script and a switch

Started by evilbob, January 30, 2008, 11:19:50 am

Previous topic - Next topic

evilbob

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 :)

Blizzard

January 30, 2008, 12:26:39 pm #1 Last Edit: January 30, 2008, 12:27:11 pm by Blizzard
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.
Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Fantasist

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
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




Nortos

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

evilbob

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!