Save-Point
CTB - A Final Fantasy X-like Battle System, Version 3.2 - Printable Version

+- Save-Point (https://www.save-point.org)
+-- Forum: Material Development (https://www.save-point.org/forum-8.html)
+--- Forum: Scripts Database (https://www.save-point.org/forum-39.html)
+--- Thread: CTB - A Final Fantasy X-like Battle System, Version 3.2 (/thread-2298.html)



CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - skrotkanon - 11-24-2009

Nope, just one in the Bar 1.4.1 script.
I'll check in here in an hour or so I guess, watching Dexter.


CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - Charlie Fleed - 11-24-2009

I guess I need a direct look at your project then. If you can make me have a demo...


CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - skrotkanon - 11-25-2009

Oh and thanks a lot for actually spending time on this, I appreciate it. =)

EDIT: Took out the link like you suggested


CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - Charlie Fleed - 11-25-2009

Ok, it was a division by zero. It is caused by your first actor that does not have SPs. Use this modified version of the refresh method for the Bar class:

Code:
#--------------------------------------------------------------------------
  # ? Refresh
  #--------------------------------------------------------------------------
  def refresh(value,max)
    @bar_bg=RPG::Cache.picture(@bar_background)
    @bar_fg=RPG::Cache.picture(@bar)
    @src_bg = Rect.new(0, 0, @bar_bg.width, @bar_bg.height)
    @src_fg = Rect.new(0, 0, @bar_fg.width, @bar_fg.height)
    value=[value,max].min
    if value==max and @highlight_complete
      @bar_fg=RPG::Cache.picture(@bar_complete)
    end
    x_ratio=@width/200.0
    y_ratio=@height/32.0
    bg_dest = Rect.new(@x, @y, @width, @height)
    @bitmap.stretch_blt(bg_dest, @bar_bg, @src_bg, @back_opacity)
    return if max==0
    dest = Rect.new(@x+(4*x_ratio).ceil, @y+(4*y_ratio).ceil, ((@width-8*x_ratio)*value/max).ceil, (@height-8*y_ratio))
    @bitmap.stretch_blt(dest, @bar_fg, @src_fg, @opacity)
  end

EDIT: I'd suggest you to remove the link above, and to use PMs to send links.


CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - skrotkanon - 11-25-2009

Yeah it works now, that really wasn't something I thought would mess things up.
And again, thanks a lot for fixing it. :)
It's been bugging me for days, now I can finally go back to continuing the project.


CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - Charlie Fleed - 11-25-2009

To be honest I would consider that a bug, because 0 SPs is a condition that is "legal" for RMXP, so that makes your support request also a bug report, and I think I will use that modified version starting from the next release.


CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - skrotkanon - 11-25-2009

Damn this is awesome, I've been looking like crazy for a script to make battles more interesting.
You sir are a genius. ;D


CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - Archeia - 11-30-2009

Charlie~ I was just wondering, for the same agi characters, how do you actually work on whose turn is next? Do you just pick someone at random from the list of clashes and then check them off the list till the next set of turns? It's just been bothering me lately =w=;


CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - Charlie Fleed - 11-30-2009

When you say "set of turns" maybe you are thinking of the way the default BS and some other BSs work, with all the battlers ordered in a list, all executing their actions until everyone in the list has executed exactly one action. The CTB doesn't work in this way, in that if a battler has a very high agi value as compared with the other battlers, he/she can have several turns in a row, with the other battlers waiting.
This BS uses a variable that indicates the time that has passed since the beginning of the battle. At the beginning of the battle, for each battler a random moment for the first action is determined. This moment is random, but it is also related to the agi value. Just as an example, if A's agi value is 10 and B's agi value is 20, the moment for A could be anywhere in the range 0-100 secs and the moment for B in 0-50 secs. As you can see it is likely that B will take action before A, but it is not sure, as there is some randomness involved. When two battlers have the same agi value, who will act first is random. After an action has been executed, the next action for that battler is placed in the time line by applying a delay, that is different depending on the kind of action.

0--------------------------100--------------------------200--------------------------300--------------------------400--------------------------500 secs--------------------------
-A---B------------A---B-------------A----B-----------A*---B----------------B-------A-----------B--------A----------B----

In the above example A and B have the same agi value. For the first action A's random time comes before B's one. If they both keep attacking, the same delay will be applied on and on, but when A performs a skill (A*) its delay is larger and B gets two consecutive turns.


CTB - A Final Fantasy X-like Battle System, version 3.1 (NEW Jul 4 2010) - Archeia - 12-01-2009

Aahh so our assumptions were correct, thanks for the confirmation Sir Charlie~ :D