Help - Search - Members - Calendar
Full Version: Supporting multiple battle systems
RPG RPG Revolution Forums > Scripting > Script Development and Support
Tsukihime
Is there an easy way to modify an existing battle system to make it so that a different battle system depending on whether a certain condition has been met?

For example suppose I had the standard battle system, and then in certain events I would run it maybe as a side-view, or even as a completely different one (maybe using the fire emblem scripts).

Kind of like mini-games, or perhaps even as part of the story.

I would guess the structure would be like

CODE
If some condition is satisfied (map name, event name, event comment, etc)
   execute battle using these set of scripts
else if some other condition
   execute battle using these set of scripts
else
   maybe default


Where I abstract it so that I have generic "interface" that is exposed to the rest of the game (ie: Scene_Battle.new), but then the rest of the code would load different subclasses.

Performance-wise, how would it behave? I'm thinking only the transition to the battle scene as well as loading time, but maybe there's something I'm overlooking?

I would structure it such that the generic flow is the same, but I would instantiate one of the subclasses and call those methods.
maximusmaxy
The problem is most custom battle systems overwrite the existing standard battle system. Placing a seccond custom battle system script would then usually overwrite the first script if they both overwrite the Scene_Battle. Some battle systems like Atoa's support multiple battle styles in the same script which i believe can be changed while playing, which might be what your looking for.

It really just depends what scripts you want to use together and how the scripts are written. You could use a CBS and an ABS together since they are both utilized in different scenes however i highly doubt 2 ABS's or 2 CBS's would be compatible since one would cancel out the other. I'm not saying it isn't possible, although it may require quite a bit of scripting to get the scripts to be compatible together.

However i may be mistaken, i believe there is a part in the SDK which is used to counter this problem (enabling and disabling scripts) although i am not very familiar with the SDK and i believe scripts can only be enabled/disabled on runtime and not during gameplay.
Tsukihime
Functions overwriting other functions might be the major problem.

In the best case you would end up with two separate scene_battle classes, but then there's all the other classes that may have had functions overwritten.

I guess for mini-games that are meant to be stand-alone and does not rely on anything, everything should be included in the module rather than relying on existing functionality.
Night_Runner
If your lucky, you might be able to get away with getting it working with a few small alterations...
in the custom battle system, change class Scene_Battle to class Scene_Battle2 < Scene_Battle, (so go get in to battle you need to have an event run the script $scene = Scene_Battle2.new) and change all alias calls to super, it may work.
But most likely you will find that the windows, sprites & the spritemap have all been tweaked in the script as well, and then you'd have to change them to Spriteset_Map2 < Spriteset_Map like with the Scene_Battle, and it gets very tedious and messy...
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2013 Invision Power Services, Inc.