Lecode

(─‿‿─)
Regular
Joined
Dec 18, 2013
Messages
490
Reaction score
676
First Language
French
Primarily Uses
N/A
Damage Sequence 1.1


Lecode


Introduction


This script allows you to synchronize skills and items' damage with their animations.


To put it simply, the player can now deal damage during an animation.


Thus, you can decide to make real multiple-hits skills or to deal damage at a specific frame.


Screenshot

Spoiler



Qdsdpt1.png



Instructions


Version 1.0

Spoiler




<dmg_sequence: a,b,c,d...>


Specify the frame(s) where damages are dealt.
Example: <dmg_sequence: 6,12>
 



<effects_sequence: a,b,c,d...>


Specify the frame(s) where effects are applied.


By default, they are applied on the last hit.
 



<effects_each_hit>


This tag allows the skill/item to apply effects on each hit.



Version 1.1


(Don't bother with that version if you want a simple script/configuration)

Spoiler




<damage sequence>[frame,formula,effects?,crit?,never_miss?][frame,formula,effects?,crit?,never_miss?]ect...</damage sequence>


Specify the frames where damages are dealt.
You can also specify if you allow the skill/item to:
- Apply effects (effects?)
- Try to crit (crit?)
- Certain hit (nerver_miss?)
Also, you can set a custom damage formula for that specific frame.
Replace "formula" with "" or nil to use the default formula.



Demo + Script


Here.


Notes


The script is compatible with the default battle system and with Yanfly's battle engine.


Let me know if you face some compatibility issues. Perhaps I will solve them.
 
Last edited by a moderator:

 Nova

Regular
Regular
Joined
Feb 8, 2015
Messages
163
Reaction score
136
amazing. I've been looking for something like this for a long time :D
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Regular
Joined
May 15, 2012
Messages
14,693
Reaction score
3,034
First Language
Tagalog
Primarily Uses
RMVXA
Oooh, a pretty nice idea.
 

ArcaneEli

Mage of Thunder
Regular
Joined
Mar 24, 2012
Messages
255
Reaction score
76
First Language
English
Primarily Uses
If I bring a ring to your house will you marry me?
 

Sixth

Regular
Regular
Joined
Jul 4, 2014
Messages
2,207
Reaction score
877
First Language
Hungarian
Primarily Uses
RMVXA
Cool script, and it actually might work for something I planned to do long time ago! *-*


Now to add a possibility to make a separate damage formula for each hit performed... Am I asking too much? :D
 

Lecode

(─‿‿─)
Regular
Joined
Dec 18, 2013
Messages
490
Reaction score
676
First Language
French
Primarily Uses
N/A
If I bring a ring to your house will you marry me?
I'm not ready for that, lol.

Now to add a possibility to make a separate damage formula for each hit performed... Am I asking too much? :D
Hey, why not ? :)

I will think about that.

Thanks, everyone.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Regular
Joined
May 15, 2012
Messages
14,693
Reaction score
3,034
First Language
Tagalog
Primarily Uses
RMVXA
That will be easy to add now that he has this IMHO...
 

ToastyCheese

Villager
Member
Joined
Jul 30, 2013
Messages
20
Reaction score
26
First Language
English
Primarily Uses
I do have a question about this: How does the script handle accuracy? Is each frame counted as a separate accuracy roll, or is it "full move hits / full move misses." 

It may also be a good idea to add an option to configure this, if it's not well integrated in already
 

Probotector 200X

Probotect and Serve
Regular
Joined
Mar 14, 2012
Messages
914
Reaction score
169
Primarily Uses
This is pretty cool.

A separate damage formula (and/or different elemental) for each hit would be...amazing.
 

Lecode

(─‿‿─)
Regular
Joined
Dec 18, 2013
Messages
490
Reaction score
676
First Language
French
Primarily Uses
N/A
I do have a question about this: How does the script handle accuracy? Is each frame counted as a separate accuracy roll, or is it "full move hits / full move misses."
Accuracy / Crit / Evade / Cover, ect... are handled on each hit.

It's because I use the default way to deal damages. For compatibility sake.

It may also be a good idea to add an option to configure this, if it's not well integrated in already
Added to the todo-list.
 

ScoopJohn

The guy who asks too many questions
Regular
Joined
Sep 6, 2013
Messages
254
Reaction score
33
First Language
Italian
Primarily Uses
RMVXA
Amazing, it's centuries i've been waiting for it!
 

Kizami

Alejandro
Regular
Joined
Dec 23, 2012
Messages
38
Reaction score
12
First Language
Spanish
Primarily Uses
RMMV
This adds a lot of realism to the game; I really wanted something like this since a while, thank you very much!!! :D
 

Lecode

(─‿‿─)
Regular
Joined
Dec 18, 2013
Messages
490
Reaction score
676
First Language
French
Primarily Uses
N/A
Updated.

Code:
# Versions:#   1.0   - Initial release#   1.1   - Add the possibility to control critical#           and guaranted hits, and formula. Also, merge all tags into#           a unique one.
 
Last edited by a moderator:

MHRob

Card Master
Regular
Joined
Jun 30, 2014
Messages
133
Reaction score
24
First Language
English
Primarily Uses
RMVXA
Maybe it's a script compatibility but I'll ask anyways. Is it supposed to hit the player as well? I'm using the first version of the script, because I don't really need all the other features, just the real time damage sequence, and when I used it with a skill that hit's all enemies, it hits the player as well. Is this normal?
 
Last edited by a moderator:

Lecode

(─‿‿─)
Regular
Joined
Dec 18, 2013
Messages
490
Reaction score
676
First Language
French
Primarily Uses
N/A
No, it isn't normal at all :'o

What battle system are you using ?
 

MHRob

Card Master
Regular
Joined
Jun 30, 2014
Messages
133
Reaction score
24
First Language
English
Primarily Uses
RMVXA

omen613

Regular
Regular
Joined
May 22, 2012
Messages
309
Reaction score
110
First Language
English
Primarily Uses
Nice script.

I'm sure many people in the community will make very good use of it.

...now to take another look at my skill list lol
 

DoubleX

Just a nameless weakling
Regular
Joined
Jan 2, 2014
Messages
1,876
Reaction score
1,029
First Language
Chinese
Primarily Uses
N/A
I received a compatibility report between this script and DoubleX RMVXA Confusion Edit.

The cause is that the battler instance variable @leds_sprite is a sprite, which has an instance variable @leds_battler, which is that battler.

Whenever a deep copy is to be made for such battlers via Marshal(usually Marshal.load(Marshal.dump)), crashes will come as sprites can't be serialized and Marshal will crash whenever it tries to copy an unserializable object.

As I've solved an extremely similar compatibility issue with my scripts before, I realized yours will also be incompatible with these scripts:

Yanfly Engine Ace - Victory Aftermath

Yami Engine Symphony - Equipment Learning

Theolized Sideview Battle System

Victor Engine - Custom Slip Effect

And I've come up with this fix:

if $imported[:TSBS]alias ledmgseq_copy copydef copy(obj, &argb) # Added to store then clear all battler's unserializables if is_battler = obj.is_a?(Game_Battler) unserializables = obj.ledmg_unserializables obj.clear_ledmg_unserializables end # clone = ledmgseq_copy(obj, &argb) # Rewritten # Added to restore all battler and his/her/its clone's unserializables if is_battler obj.restore_ledmg_unserializables(unserializables) clone.restore_ledmg_unserializables(unserializables) end clone #end # copyend # if $imported[:TSBS]if $imported["YEA-VictoryAftermath"] || $imported["YES-EquipmentLearning"]class << BattleManager # Edit alias ledmgseq_process_victory process_victory def process_victory(*argv, &argb) # Added to store then clear all party members' unserializables unserializables = {} $game_party.all_members.each { |mem| unserializables[mem] = mem.ledmg_unserializables mem.clear_ledmg_unserializables } ledmgseq_process_victory(*argv, &argb) # Added to restore all party members' unserializables $game_party.all_members.each { |mem| mem.restore_ledmg_unserializables(unserializables[mem]) } # end # process_victoryend # BattleManagerend # if $imported["YEA-VictoryAftermath"] || $imported["YES-EquipmentLearning"]if $imported["DoubleX RMVXA Confusion Edit"]class Game_Action # Edit def evaluate_item_with_target(target) # Rewrite target.result.clear # Added to store then clear all unserializables from subject and target subject_unserializables = subject.ledmg_unserializables target_unserializables = target.ledmg_unserializables subject.clear_ledmg_unserializables target.clear_ledmg_unserializables # eval_target = Marshal.load( Marshal.dump(target) ) eval_subject = Marshal.load( Marshal.dump(subject) ) # Added to restore all unserializables for subject, target and their clones subject.restore_ledmg_unserializables(subject_unserializables) eval_subject.restore_ledmg_unserializables(subject_unserializables) target.restore_ledmg_unserializables(target_unserializables) eval_target.restore_ledmg_unserializables(target_unserializables) # eval_target.make_damage_value(eval_subject, item) if item.for_opponent? return eval_target.result.hp_damage.to_f / [eval_target.hp, 1].max end recovery = [-eval_target.result.hp_damage, eval_target.mhp - eval_target.hp].min.to_f / eval_target.mhp end # evaluate_item_with_targetend # Game_Actionend # if $imported["DoubleX RMVXA Confusion Edit"]class Game_Battler # Edit def ledmg_unserializables # New unserializables = { leds_sprite: @leds_sprite } unserializables[:item_in_use] = @item_in_use if $imported[:TSBS] if $imported[:ve_custom_slip_effect] unserializables[:state_user] = @state_user end unserializables end # ledmg_unserializables def clear_ledmg_unserializables # New @leds_sprite = nil @item_in_use = nil if $imported[:TSBS] @state_user = {} if $imported[:ve_custom_slip_effect] end # clear_ledmg_unserializables def restore_ledmg_unserializables(unserializables) # New @leds_sprite = unserializables[:leds_sprite] @item_in_use = unserializables[:item_in_use] if $imported[:TSBS] return unless $imported[:ve_custom_slip_effect] @state_user = unserializables[:state_user] || {} end # restore_ledmg_unserializablesend # Game_Battler
I wanted to solve the compatibility issue with yours on my side(as DoubleX RMVXA Confusion Edit Compatibiltiy Fix), but as I failed to find any way to detect yours' presence(like using $imported[:script_name]), I think it's better to give you the fix and let you decide(you don't have to credit nor even mention me if you decided to use this fix on your side) :)
 

Lecode

(─‿‿─)
Regular
Joined
Dec 18, 2013
Messages
490
Reaction score
676
First Language
French
Primarily Uses
N/A
I see. Thanks for reporting this issue :)

I'll look at your fix.
 

DoubleX

Just a nameless weakling
Regular
Joined
Jan 2, 2014
Messages
1,876
Reaction score
1,029
First Language
Chinese
Primarily Uses
N/A
Almost forgot that your script will also crash, due to the same reason, when an actor tries to access his/her/its equips in the equip window:

def update_help super if @actor && @status_window temp_actor = Marshal.load(Marshal.dump(@actor)) temp_actor.force_change_equip(@slot_id, item) @status_window.set_temp_actor(temp_actor) end end
So the fix should address this part as well:

if $imported[:TSBS]alias ledmgseq_copy copydef copy(obj, &argb) # Added to store then clear all battler's unserializables if is_battler = obj.is_a?(Game_Battler) unserializables = obj.ledmg_unserializables obj.clear_ledmg_unserializables end # clone = ledmgseq_copy(obj, &argb) # Rewritten # Added to restore all battler and his/her/its clone's unserializables if is_battler obj.restore_ledmg_unserializables(unserializables) clone.restore_ledmg_unserializables(unserializables) end clone #end # copyend # if $imported[:TSBS]if $imported["YEA-VictoryAftermath"] || $imported["YES-EquipmentLearning"]class << BattleManager # Edit alias ledmgseq_process_victory process_victory def process_victory(*argv, &argb) # Added to store then clear all party members' unserializables unserializables = {} $game_party.all_members.each { |mem| unserializables[mem] = mem.ledmg_unserializables mem.clear_ledmg_unserializables } ledmgseq_process_victory(*argv, &argb) # Added to restore all party members' unserializables $game_party.all_members.each { |mem| mem.restore_ledmg_unserializables(unserializables[mem]) } # end # process_victoryend # BattleManagerend # if $imported["YEA-VictoryAftermath"] || $imported["YES-EquipmentLearning"]if $imported["DoubleX RMVXA Confusion Edit"]class Game_Action # Edit def evaluate_item_with_target(target) # Rewrite target.result.clear # Added to store then clear all unserializables from subject and target subject_unserializables = subject.ledmg_unserializables target_unserializables = target.ledmg_unserializables subject.clear_ledmg_unserializables target.clear_ledmg_unserializables # eval_target = Marshal.load( Marshal.dump(target) ) eval_subject = Marshal.load( Marshal.dump(subject) ) # Added to restore all unserializables for subject, target and their clones subject.restore_ledmg_unserializables(subject_unserializables) eval_subject.restore_ledmg_unserializables(subject_unserializables) target.restore_ledmg_unserializables(target_unserializables) eval_target.restore_ledmg_unserializables(target_unserializables) # eval_target.make_damage_value(eval_subject, item) if item.for_opponent? return eval_target.result.hp_damage.to_f / [eval_target.hp, 1].max end recovery = [-eval_target.result.hp_damage, eval_target.mhp - eval_target.hp].min.to_f / eval_target.mhp end # evaluate_item_with_targetend # Game_Actionend # if $imported["DoubleX RMVXA Confusion Edit"]class Game_Battler # Edit def ledmg_unserializables # New unserializables = { leds_sprite: @leds_sprite } unserializables[:item_in_use] = @item_in_use if $imported[:TSBS] if $imported[:ve_custom_slip_effect] unserializables[:state_user] = @state_user end unserializables end # ledmg_unserializables def clear_ledmg_unserializables # New @leds_sprite = nil @item_in_use = nil if $imported[:TSBS] @state_user = {} if $imported[:ve_custom_slip_effect] end # clear_ledmg_unserializables def restore_ledmg_unserializables(unserializables) # New @leds_sprite = unserializables[:leds_sprite] @item_in_use = unserializables[:item_in_use] if $imported[:TSBS] return unless $imported[:ve_custom_slip_effect] @state_user = unserializables[:state_user] || {} end # restore_ledmg_unserializablesend # Game_Battlerclass Window_EquipItem < Window_ItemList # Edit alias ledmgseq_update_help update_help def update_help(*argv, &argb) # Added if @actor unserializables = @actor.ledmg_unserializables @actor.clear_ledmg_unserializables end # ledmgseq_update_help(*argv, &argb) @actor.restore_ledmg_unserializables(unserializables) if @actor # Added end # update_helpend # Window_EquipItem
If this compatibility fix will have to be placed above Yanfly Engine Ace - Ace Equip Engine, the below separate snippet will have to be placed below that script as well:

class Window_EquipItem < Window_ItemList # Edit alias ledmgseq_update_help_compatibility update_help def update_help(*argv, &argb) # Added if @actor unserializables = @actor.ledmg_unserializables @actor.clear_ledmg_unserializables end # ledmgseq_update_help_compatibility(*argv, &argb) @actor.restore_ledmg_unserializables(unserializables) if @actor # Added end # update_helpend # Window_EquipItem
It's because of the below part of that script:

Code:
  #--------------------------------------------------------------------------  # overwrite method: update_help  #--------------------------------------------------------------------------  def update_help    super    return if @actor.nil?    return if @status_window.nil?    return if @last_item == item    @last_item = item    temp_actor = Marshal.load(Marshal.dump(@actor))    temp_actor.force_change_equip(@slot_id, item)    @status_window.set_temp_actor(temp_actor)  end
 

Latest Threads

Latest Posts

Latest Profile Posts

AAAGH... I hate navigating the new RPG Maker website!
Forgive my rudimentary video editing skills, thought I'd start sharing progress on my status posts as well. Here's the second character of my roster, Mǽlhafoc, the Ælven ranger.

And if you missed the first one many moons ago, here's Vilhelm, the tarnished knight.
Knocked through three more rough draft sprites. (A frog beast thing, a skeleton, and vampire bat) down to seven sprites and a thing more appropriately done as tiles.

Forum statistics

Threads
135,013
Messages
1,252,903
Members
177,934
Latest member
Ehsan
Top