buddysievers 21 Posted December 15, 2015 (edited) I will check that Edit: Yep youre right, it comes up every time an enemy hits me after i killed an enemy with overkill. Edited December 15, 2015 by buddysievers Share this post Link to post Share on other sites
Shiggy 630 Posted December 15, 2015 I was editing while you posted, so I'm bumping for you to see the update 1 Share this post Link to post Share on other sites
buddysievers 21 Posted December 15, 2015 (edited) this will produce undefined method actor in create_popup(["", nil], rule) if $overkill_flag && self.actor Edit: must be something like user.is_a(Game_Actor) i think Edit2: Its user.actor Thx soooo much for all of this! Edit3: Im sorry but there is still a bug, the exp behavior isnt correct. When i kill a Slime with 100MHP with 3 attacks like 30-40 dmg per hit i have an little exp bonus even there was no overdamage popup. Edit4: Also i have found an exp related bug, when i kill 2 Slimes with overkill which both give 3000 exp i have a total of 18000 not 12000... Edited December 15, 2015 by buddysievers 1 Share this post Link to post Share on other sites
Shiggy 630 Posted December 15, 2015 it was actor? and not actor indeed (typos, typos everywhere) ^-^. Replace (self.exp * overkill_ratio) with (self.exp * (overkill_ratio-1)) 1 Share this post Link to post Share on other sites
buddysievers 21 Posted December 15, 2015 (edited) Ok this fixes the second bug, but there is still this little exp bonus when i kill them with weak attacks. Edit: Also can i change overkill_ratio > 1.25 to 1.50 that u need 50% more damage instead of 25%? Edit2: I get 4100 exp total now when i kill both without overkill... should be 6000 without. Edited December 15, 2015 by buddysievers 1 Share this post Link to post Share on other sites
Shiggy 630 Posted December 15, 2015 The exp bonus % is the overdamage % so 1% overdamage means 1% exp bonus, that up to max 100% It's not a bug ,it's a feature ^-^ More seriously, you want overkill xp to start at which %? Yes you can change 1.25 to 1.5 to make the overkill appear at 50% more damage. 1 Share this post Link to post Share on other sites
buddysievers 21 Posted December 15, 2015 (edited) ok i want that you need 50% more damage then you need to kill the enemy to enable overkill at all. so if Slime a have 100HP you need at least 150 dmg to get an overkill. then the exp bonus should be like this, if you do an overkill with exact 50% overdamage you get 50% more exp, when you do an overkill with 75% overdamage you get 75% exp bonus up to 100% with 100% or more damage then you actually need to kill the enemy. when you dont have any overdamage at all you should get the normal exp in my test case 3000exp per slime so 6000 for the whole troop. with overdamage its possible to get 9000 - 12000 exp depending on the bonus %. Edit: Im rly sry for my bad english and that i couldnt explain it better. Edited December 15, 2015 by buddysievers 1 Share this post Link to post Share on other sites
Shiggy 630 Posted December 15, 2015 (edited) so overkill bonus xp should start at 50 % , if you still want proprtions just change the line if overkill_damage > 0 to if $overkill_flag if you want 50 % bonus xp between 50 and 75 then 75% bonus xp between 75 and 100 and 100% bonus xp above class Game_Battler < Game_BattlerBase alias overkill_item_apply item_apply def item_apply(user, item) original_hp = @hp overkill_item_apply(user, item) #--- return unless self.enemy? return unless user.actor? return unless @result.hp_damage > original_hp #--- $overkill_flag = false overkill_damage = (@result.hp_damage - original_hp).to_f overkill_ratio = [overkill_damage/original_hp,1].min $overkill_flag = true if overkill_ratio > 1.25 if overkill_flag bonus=0.5 bonus=0.75 if overkill_ratio > 1.75 bonus= 1 if overkill_ratio > 2 end if $bonus_xp $bonus_xp+=(self.exp * bonus).to_int else $bonus_xp =(self.exp * bonus).to_int end end end Edited December 15, 2015 by Shiggy 1 Share this post Link to post Share on other sites
buddysievers 21 Posted December 15, 2015 (edited) the bonus should not be like 50%, 75%, 100% it should be from 50%-100% so 67% is possible as example. There is a typo, if overkill_flag should be if $overkill_flag but when i attack i get a an error, nil cant be coerced to Fixnum Edited December 15, 2015 by buddysievers Share this post Link to post Share on other sites
Shiggy 630 Posted December 15, 2015 so changing if overkill_damage > 0 to if $overkill_flag should be enough 1 Share this post Link to post Share on other sites
buddysievers 21 Posted December 15, 2015 (edited) there is no "overkill_damage > 0" ^^ class Game_Battler < Game_BattlerBase alias overkill_item_apply item_apply def item_apply(user, item) original_hp = @hp overkill_item_apply(user, item) return unless self.enemy? return unless user.actor? return unless @result.hp_damage > original_hp $overkill_flag = false overkill_damage = (@result.hp_damage - original_hp).to_f overkill_ratio = [overkill_damage / original_hp, 1].min $overkill_flag = true if overkill_ratio > 1.50 if $overkill_flag bonus = 0.5 bonus = 0.75 if overkill_ratio > 1.75 bonus = 1 if overkill_ratio > 2 end if $bonus_xp $bonus_xp+=(self.exp * bonus).to_int else $bonus_xp =(self.exp * bonus).to_int end end end Edited December 15, 2015 by buddysievers 1 Share this post Link to post Share on other sites
Shiggy 630 Posted December 15, 2015 (edited) from the stuff before sry it wasn't clear enoughyou should have this class Game_Battler < Game_BattlerBase alias overkill_item_apply item_apply def item_apply(user, item) original_hp = @hp overkill_item_apply(user, item) #--- return unless self.enemy? return unless user.actor? return unless @result.hp_damage > original_hp #--- $overkill_flag = false overkill_damage = (@result.hp_damage - original_hp).to_f overkill_ratio = [(overkill_damage/original_hp),2].min $overkill_flag = true if overkill_ratio > 1.5 if $overkill_flag if $bonus_xp $bonus_xp+=(self.exp * (overkill_ratio-1)).to_int else $bonus_xp =(self.exp * (overkill_ratio-1)).to_int end end end end Hopefully all should be fine now Edited December 15, 2015 by Shiggy 1 Share this post Link to post Share on other sites
buddysievers 21 Posted December 15, 2015 (edited) We need to set $bonus_xp to 0 somewhere outside of the classes so it not crash anymore when there was no overkill at the end of the battle ^^ Edit: Also there is again 18k instead of 12k max exp Edit2: Replace again (self.exp * overkill_ratio) with (self.exp * (overkill_ratio-1))? Edited December 15, 2015 by buddysievers 1 Share this post Link to post Share on other sites
Shiggy 630 Posted December 15, 2015 (edited) if $bonus_xp is supposed to prevent that ... put this at the end of the script module BattleManager #-------------------------------------------------------------------------- # * Setup #-------------------------------------------------------------------------- def self.setup(troop_id, can_escape = true, can_lose = false) init_members $bonus_xp=0 $game_troop.setup(troop_id) @can_escape = can_escape @can_lose = can_lose make_escape_ratio end end It also means you can reduce if $bonus_xp$bonus_xp+=(self.exp * (overkill_ratio-1)).to_intelse$bonus_xp =(self.exp * (overkill_ratio-1)).to_int end to $bonus_xp =(self.exp * (overkill_ratio-1)).to_int "Edit2: Replace again (self.exp * overkill_ratio) with (self.exp * (overkill_ratio-1))?" Yes and check overkill_ratio too,i edited those errors just after posting Edited December 15, 2015 by Shiggy 1 Share this post Link to post Share on other sites
buddysievers 21 Posted December 15, 2015 (edited) Ok now is everything how it should be! Tested all possibilitys and works like a charm now. Thx soooo much again for all this work and patience!!! Here are the finished scripts if anyone is interested: # Overkill/Overdamage Bonus Exp # Credits: # Shiggy for making this script. # Archeia Nessiah for the "Overkill Snippet". module BattleManager class << self alias :overkill_battle_manager_setup :setup end def self.setup(troop_id, can_escape, can_lose) $bonus_xp = 0 overkill_battle_manager_setup(troop_id, can_escape, can_lose) end end class Game_Battler < Game_BattlerBase alias :overkill_game_battler_item_apply :item_apply def item_apply(user, item) original_hp = @hp overkill_game_battler_item_apply(user, item) return unless self.enemy? return unless user.actor? return unless @result.hp_damage > original_hp $overkill_flag = false overkill_damage = (@result.hp_damage - original_hp).to_f overkill_ratio = [(overkill_damage/original_hp - 1), 2].min $overkill_flag = true if overkill_ratio > 1.5 if $overkill_flag $bonus_xp =(self.exp * (overkill_ratio - 1)).to_int end end end class Game_Troop < Game_Unit alias :overkill_game_troop_exp_total :exp_total def exp_total total = overkill_game_troop_exp_total + $bonus_xp $bonus_xp=0 return total end end # Overkill/Overdamage Bonus Exp Popups # Credits: # Shiggy for making this script. # Archeia Nessiah for the "Overkill Snippet". # # Requires YSA - Battle Popup script to work. # Maybe works with Yanlfy Battle Engine but idk... # # Add the line below to :word_setting # :overkill => "OVERKILL!", # Text display for overkill. # # Add the line below to :style_setting # :overkill => [255, 255, 255, 16, false, false, Font.default_name], # # Add the line below to :effect_setting # :overkill => [:affect, :up , :wait], class Game_Battler < Game_BattlerBase alias :overkill_popup_game_battler_item_apply :item_apply def item_apply(user, item) overkill_popup_game_battler_item_apply(user, item) $overkill_flag = false end end class Game_BattlerBase alias :overkill_popup_game_battlerbase_make_damage_popups :make_damage_popups def make_damage_popups(user) overkill_popup_game_battlerbase_make_damage_popups(user) rule = :overkill create_popup(["", nil], rule) if $overkill_flag && user.actor end end Edit: Idk why my code is that strange formatted?! Edited December 15, 2015 by buddysievers Share this post Link to post Share on other sites