Help - Search - Members - Calendar
Full Version: ASCIIgod FF1 based Hit counter damage multiplyer
RPG RPG Revolution Forums > Scripting > Script Tutorials > RGSS2
ASCIIgod
my new script is called FF1 based hit counter damage multiplyer like in the title. so what it does is it revives the old FF1 attacking system which has a "hit" on the head of the characters. you see i was getting tired of using agi for no reason at all. so i deviced a way to make it as useful as any stat rmvx provided us. so i made this new script...

the whole script is in the spoiler with the codebox in it and oh sorry for no screenies and this is version 2.3

2.3 new stuffs...

fix some bugs...

added that each hit is animated(meaning when you do attack and you hit 3 the animation will play 3 times too)

new code
awesome
CODE
#######################################################################
#########
# #
# #
# ASCIIgod FF1 styled hit damage multiplyer Ver.2.3 #
# #
# #
################################################################################
=begin

to explain this script, if you already played FF1, you will notice that
when you attacked a hit will show on the head of the character. this hit
counts how many attack is done, multiplying damage.

instruction:
HIT_EACH_AGI = how many AGI does it need to make 1 Hit
MAX_HIT_CAP = maximum hits can an actor do
HIT_TEXT = used on default Battle. what text is shown after attacking
DAMAGE_CALC_TYPE = the type of battle calculation to use
= 0 [default]
= 1 [default w/o variance]
=end
module ASCIIgod
  module AGIHIT

    HIT_EACH_AGI = 25
    MAX_HIT_CAP = 20
    HIT_TEXT = "%sHits Done"
    DAMAGE_CALC_TYPE = 1

  end
end

class Game_Battler
  def make_attack_damage_value(attacker)
    hit_count = attacker.agi / ASCIIgod::AGIHIT::HIT_EACH_AGI
    if attacker.agi < ASCIIgod::AGIHIT::HIT_EACH_AGI
      hit_count = 1
    elsif hit_count >= ASCIIgod::AGIHIT::MAX_HIT_CAP
    hit_count = ASCIIgod::AGIHIT::MAX_HIT_CAP
  end

  case ASCIIgod::AGIHIT::DAMAGE_CALC_TYPE
    when 0
      damage = attacker.atk - self.def # base calculation
      damage = 0 if damage < 0 # if negative, make 0
      damage *= elements_max_rate(attacker.element_set) # elemental adjustment
      damage /= 100
      if damage == 0 # if damage is 0,
        damage = rand(2) # half of the time, 1 dmg
      elsif damage > 0 # a positive number?
        critical_rate = attacker.cri / 10
        @critical = (rand(100) < critical_rate) # critical hit?
        @critical = false if prevent_critical # criticals prevented?
        damage += attacker.cri if @critical # critical adjustment
      end
      damage = apply_variance(damage, 20)
      damage = apply_guard(damage) # guard adjustment
      damage *= hit_count
      @hp_damage = damage # damage HP
    when 1
      damage = attacker.atk - self.def # base calculation
      damage = 0 if damage < 0 # if negative, make 0
      damage *= elements_max_rate(attacker.element_set) # elemental adjustment
      damage /= 100
      if damage == 0 # if damage is 0,
        damage = rand(2) # half of the time, 1 dmg
      elsif damage > 0 # a positive number?
        critical_rate = attacker.cri / 10
        @critical = (rand(100) < critical_rate) # critical hit?
        @critical = false if prevent_critical # criticals prevented?
        damage += attacker.cri if @critical # critical adjustment
      end
      damage = apply_guard(damage) # guard adjustment
      damage *= hit_count
      @hp_damage = damage # damage HP
    end
  end
end

class Scene_Battle < Scene_Base

  def execute_action_attack
    i = 0
    text = sprintf(Vocab::DoAttack, @active_battler.name)
    @message_window.add_instant_text(text)
    hit_count = @active_battler.agi / ASCIIgod::AGIHIT::HIT_EACH_AGI
    
    if @active_battler.agi < ASCIIgod::AGIHIT::HIT_EACH_AGI
      hit_count = 1
    elsif hit_count >= ASCIIgod::AGIHIT::MAX_HIT_CAP
      hit_count = ASCIIgod::AGIHIT::MAX_HIT_CAP
    end
    
    text2 = sprintf("and "+ASCIIgod::AGIHIT::HIT_TEXT, hit_count)
    @message_window.add_instant_text(text2)
    targets = @active_battler.action.make_targets
    for target in targets
      target.attack_effect(@active_battler)
      while i < hit_count
        i += 1
        display_attack_animation(targets)
      end#end loop do
    end#end for
    display_action_effects(target)
  end#end def
  
end#end class

Kaimi
Interesting.
shinto
I've been working with this for a day or so. No bugs and replicates an effect I've been trying to recreate for a while very well..

FF1 , Wizardry . . ect.

Many thanks to you. happy.gif - Shinto

Don't necropost unless for a bug report. ~Kread
SaturnJohn
ASCIIgod, the codebox you have does not conform to my computer. as in every time i try to copy/paste it in, it f**** up and is pasted only on one line of script. i have no idea why this happens. it only occurs with the scrollbar boxes that contain code, though.
Kread-EX
It seems to work for me... maybe a browser problem as the codeboxes have been modified recently. Try to quote his post, and inside the text editor, copy the contents between the codebox tags.
SaturnJohn
huh. it worked! thanks Kread! sorry the thanks is late, though.
dj_iskascribble
edit* the script doesnt seem to work for me. My chars have agi well over 25 and it doesnt display any amount of extra hits nor does it do any additional damage. please help i really wanna use this script
i even tried starting a brand new project just to see if it was a script conflict issue and i still cant get it to work. sad.gif(
ShinGamix
So this script is a hit combo counter?
ASCIIgod
QUOTE (ShinGamix @ Jul 27 2011, 09:14 PM) *
So this script is a hit combo counter?


what it does is emulate FF1's hit. when you attack a number will appear telling how many strike you did.

since using the default battle you cant see all hits, so i made a little calculation upgrade to make it more cooler

the new calculation is somewhat like this

hit = actor.agi / agi_need.
((damage x 4) x hit) - (defence x 2)

so if your agi is 100 and agi_need is 25 then hit is 4

make it like this

attack = 50
defence = 100

normally you will miss since

attack x 4 - defence x 2 right

that will be

200 - 200 = 0!

but with hit

thats

attack = 50 x 4
defence = 100

or

((50 x 4) x 4) = 800

100 x 2 = 200

then 800 - 200 then your max damage is 600!
dj_iskascribble
I still am not able to get this to work for me, I have the actors agi well above 25 and it isnt doing any extra damage or displaying that there is multiple hits. I even tried just that one script in a brand new project and It still isnt working for me sad.gif
ASCIIgod
thats pretty pecurial.... that shouldnt be... did you read everything? how about do this...

if you added it in a fresh project and still dont work....

wait a while and i will work again on it and fix any residual bugs


just grab the updated version

Updated wooohoooooo
dj_iskascribble
still isnt working for me sad.gif(. is there any way that you could upload a demo that shows it working so I can try to troubleshoot it on my own?
ASCIIgod
QUOTE (dj_iskascribble @ Aug 31 2011, 02:11 PM) *
still isnt working for me sad.gif(. is there any way that you could upload a demo that shows it working so I can try to troubleshoot it on my own?


is it really necessary? demo isnt gonna do any good if your a nincompoom.... as i said its already been fixed and i also added some stuffs... just copy the thing inside the codebox and your on the go... its pre-configured...
dj_iskascribble
QUOTE (ASCIIgod @ Aug 31 2011, 07:21 AM) *
QUOTE (dj_iskascribble @ Aug 31 2011, 02:11 PM) *
still isnt working for me sad.gif(. is there any way that you could upload a demo that shows it working so I can try to troubleshoot it on my own?


is it really necessary? demo isnt gonna do any good if your a nincompoom.... as i said its already been fixed and i also added some stuffs... just copy the thing inside the codebox and your on the go... its pre-configured...


thats all fine and good but copy and paste still doesnt do anything. Its posted under materials, i play test a level 50 whatever with like 140 agi and in battle it only hits 1 time and theres no text theres no additional anything. It changes my default battle algorithms and thats it. It makes everything do considerably less damage (which i like) but nothing else. If its supposed to show hit animations more than once, it doesnt. it doesnt do anything.
ASCIIgod
QUOTE (dj_iskascribble @ Sep 2 2011, 04:02 PM) *
QUOTE (ASCIIgod @ Aug 31 2011, 07:21 AM) *
QUOTE (dj_iskascribble @ Aug 31 2011, 02:11 PM) *
still isnt working for me sad.gif(. is there any way that you could upload a demo that shows it working so I can try to troubleshoot it on my own?


is it really necessary? demo isnt gonna do any good if your a nincompoom.... as i said its already been fixed and i also added some stuffs... just copy the thing inside the codebox and your on the go... its pre-configured...


thats all fine and good but copy and paste still doesnt do anything. Its posted under materials, i play test a level 50 whatever with like 140 agi and in battle it only hits 1 time and theres no text theres no additional anything. It changes my default battle algorithms and thats it. It makes everything do considerably less damage (which i like) but nothing else. If its supposed to show hit animations more than once, it doesnt. it doesnt do anything.


"It changes my default battle algorithms and thats it." thats the reason... another battle algo will cause my script to break apart.... so try to show your battle algo to me so i can rewrite my own code to your own tuning... obviously your not an adept coder your own so ill do the fix for you...
Kaimi
Is it possible to make it compatible with Battle Engine Melody with a popup? And I'd like an option which allows to choose which stats is used to determine hit number: AGI or Yanfly's DEX.
ASCIIgod
QUOTE (Kaimi @ Sep 19 2011, 10:09 PM) *
Is it possible to make it compatible with Battle Engine Melody with a popup? And I'd like an option which allows to choose which stats is used to determine hit number: AGI or Yanfly's DEX.


thats a big N-O ma man... melody can make that w/o my script... just make your own so called melodies... i dont work for melody BTW
Kaimi
Oh, well. Still, thanks for reading, and... keep p the good work.
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.