Chaos Project

RPG Maker => RPG Maker Scripts => Script Requests => Topic started by: Scoryth on July 12, 2012, 09:21:30 am

Title: (XP) Requesting some tweaks to Battle Dome System.
Post by: Scoryth on July 12, 2012, 09:21:30 am
I'm using Nathmatt's Battle Dome with Blizz-ABS. There are a couple of things I would like to tweak to the Battle Dome system because I'm kind of OCD about it lol. First, after you kill the last enemy in battle, I would like there to be some kind of short gap in time between the defeat of the last enemy and the pop up of the results screen. Currently, as the last enemy dies, it instantly pops up, and I just want a little bit of time in between that. For example, in the DBS, once you kill the last enemy, there's usually a second or so that goes by before the results box appears. I'd like something like that - just a brief moment from defeat to screen.

Second, I'd like there to be a way to pause the action to cast a spell's animation. For example, say an enemy is casting a really epic attack. I'd like something that pauses the action so the animation can fully run. Then once the animation is complete, the damage pops occur and play resumes. Something along the lines of Secret of Mana or Secret of Evermore, if you're familiar with those games. During spell animations, all characters are paused, the animation plays, then damage pops and play continues.

If my descriptions are difficult to understand, feel free to ask so I can clarify.

Here is Nathmatt's Battle Dome system.
http://forum.chaos-project.com/index.php/topic,3183.0.html (http://forum.chaos-project.com/index.php/topic,3183.0.html)

Thanks for any help you can provide.
Title: Re: (XP) Requesting some tweaks to Battle Dome System.
Post by: ThallionDarkshine on August 03, 2012, 03:41:41 pm
The first thing I can do, the second seems a lot harder.

Go to line #235 of the second part of the battle dome script. Enter this code:

wait_count = 0
loop do
    break if wait_count = Graphics.frame_count * 2
    wait_count += 1
end


That should work, but let me know if you have any problems.
Title: Re: (XP) Requesting some tweaks to Battle Dome System.
Post by: ForeverZer0 on August 03, 2012, 06:00:38 pm
@Thallion:
That is incorrect. It will simply go on until a "script is hanging" error crashes the game.

If you want only a pause, without anything else updating, you can even use a stupid method like this:

def wait(frames = 40)
 loop { Graphic.update; break if frames <= 0; frames -= 1  }
end


You can simply insert a call to that method anywhere you please and it will suspend script processing right there for the given number of frames.
Title: Re: (XP) Requesting some tweaks to Battle Dome System.
Post by: ThallionDarkshine on August 03, 2012, 10:43:16 pm
Yeah, I forgot the graphics.update and double equals signs. Here's the updated code:

wait_count = 0
loop do
    Graphics.update
    wait_count += 1
    break if wait_count == Graphics.frame_count * 2
end
Title: Re: (XP) Requesting some tweaks to Battle Dome System.
Post by: KK20 on August 04, 2012, 12:22:47 am
That's still not going to work Thallion. Every time you call Graphics.update the 'frame_count' increases by one. 'wait_count' is never going to catch up to 'Graphics.frame_count * 2', creating a 'Script is hanging'.

And even if you do drop the Graphics.update, 'frame_count' may be a ridiculous high value. That loop would have to wait a looooooooooong time before 'wait_count' could ever catch up to it.

The suggestion that FZer0 posted is the most logical. Set a timer, count it down by one, and when it reaches zero, stop.
Title: Re: (XP) Requesting some tweaks to Battle Dome System.
Post by: Blizzard on August 04, 2012, 02:32:32 am
Line 193.

@phase = 4 if $game_map.battlers_group(BlizzABS::Alignments::ENEMY_GROUP).size == 0


Change it to:

if $game_map.battlers_group(BlizzABS::Alignments::ENEMY_GROUP).size == 0
  @phase = 4
  self.delay(40) # 40 frames = 1 second
end
Title: Re: (XP) Requesting some tweaks to Battle Dome System.
Post by: nathmatt on August 04, 2012, 09:10:06 am
Quote from: Blizzard on August 04, 2012, 02:32:32 am
Line 193.

@phase = 4 if $game_map.battlers_group(BlizzABS::Alignments::ENEMY_GROUP).size == 0


Change it to:

if $game_map.battlers_group(BlizzABS::Alignments::ENEMY_GROUP).size == 0
  @phase = 4
  self.delay(1) #number of seconds
end



edit: my method already multiplies it by 40
Title: Re: (XP) Requesting some tweaks to Battle Dome System.
Post by: ThallionDarkshine on August 04, 2012, 10:04:16 am
I realized that I used the wrong variable:

wait_count = 0
loop do
    Graphics.update
    wait_count += 1
    break if wait_count == Graphics.frame_rate * 2
end