Author Topic: [XP] Skill Damage Over Time for Blizz-ABS  (Read 14475 times)

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
[XP] Skill Damage Over Time for Blizz-ABS
« on: August 13, 2012, 02:14:31 AM »
Skill Damage Over Time for Blizz-ABS
Authors: KK20
Version: 1.02
Type: DoT Damage Modification
Key Term: Blizz-ABS Plugin

Introduction

States that applied damage over time (DoT) always dealt damage that was equal to some percentage amount of the player's HP. In Blizz ABS, any state that had 'slip damage' checked as true would always do damage equal to 2% of the battler's max HP every second (40 frames).
 
This script modifies that and allows some customizable DoT amounts. States with 'slip damage' will now be associated with a skill. In other words, every time DoT takes place, the affected battler will now take damage as if it was attacked by a skill. Essentially, you can make a DoT state called "Burn" and assign it to the skill "Fire". Instead of the battler taking 2% of max HP damage, it will now take damage as if it were being hit by "Fire".
 
Also, you can assign how many times DoT will take place during the duration of the state. No longer will DoT have to take place every second of gameplay. You can make DoT take place once every 3 seconds, only once in 20 seconds, or even 3 times every second.

Features

  • Damage over time can be represented with skill damage rather than being a set number.
  • Damage can take place a number of ticks during its duration rather than every second.
  • Because damage over time is a skill, damage is based on the battler’s stats (if configured in the database as such). As the battler gets stronger, so does the damage over time.
  • Retains Blizz-ABS original damage over time method.

Screenshots

None.

Demo

Download

Script

Below the Blizz-ABS scripts (and above Main of course)
(click to show/hide)

Instructions

Instructions in the script. Configuration help is also there.
Don’t forget to set the states’ duration in the database!

Compatibility

Modified/aliased some methods in Map_Battler and Game_Battler. Might be best not to combine this with another DoT system.

Credits and Thanks

  • KK20 – Creating the script
  • sasofrass – For requesting

Author's Notes

Always looking for them bugs. Enjoy~
« Last Edit: March 25, 2017, 07:59:06 AM by KK20 »



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Kiwa

  • Transcended Spirit
  • ***
  • Posts: 155
  • LV: 4
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #1 on: September 20, 2013, 05:11:48 PM »
I'M NOT WORTHY!!!!

OMG KK20...
seriously.. thank you!!

What i had imagined was more in code...but this is just as simple as it can be modified openly within the GUI.
This worked beautifully, moded easily, AND!!! i saw my bouncing damage! hoary!

I'm sure ill have a silly question in the future. thanks for now :D
much love!

Offline Kiwa

  • Transcended Spirit
  • ***
  • Posts: 155
  • LV: 4
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #2 on: September 21, 2013, 05:03:50 AM »
So upon playing with this beautiful script (which has been pretty fun...i made 1000 ticks in like 4 seconds.. causing a waterfall of numbers lol).
I found something odd. (i know.. leave it to kiwa)

So i decided to make a healing spell (-10 damage) into a Dot... in my brain healing spell into a DOT= HoT (Heal over Time)
so..i went about it and heres what i found.

it ticked 1 damage and 3mana each tick.
The mana is probably due to a common event set to restore mana every little bit..odd that its now displayed during the duration of the "HoT" state and no other time.

not that this is really important but for the greater understanding i'm curious. will this work in heal forms?

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #3 on: September 22, 2013, 05:01:27 AM »
Theoretically it should heal. I mean, the damage done follows the exact same process as being hit by the skill itself. I'll have to check it out sometime. I probably did something stupid like [1, damage].max to prevent negative values (which would heal).



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Kiwa

  • Transcended Spirit
  • ***
  • Posts: 155
  • LV: 4
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #4 on: September 22, 2013, 08:09:49 AM »
There are 3 instances that have a .max

Code: [Select]
256:     power = [power, 1].max
272:     power = [power, 1].max
281:     amp = [damage.abs * skill.variance / 100, 1].max

Im scared to cause a blemish on this beautiful piece of code. lol.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #5 on: September 23, 2013, 05:37:41 PM »
I think it's this line:
Code: [Select]
      # Damage will always do at least 1 HP
      damage = (damage <= 0 ? 1 : damage)
Needs to have a check of some kind. Probably something like
Code: [Select]
if skill.power >= 0
  damage = (damage <= 0 ? 1 : damage)
else
  damage = (damage >= 0 ? -1 : damage)
end



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline firevenge007

  • Awakened Visionist
  • **
  • Posts: 82
  • LV: 0
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #6 on: October 23, 2013, 02:59:08 AM »
I was trying to use this script, and for some reason, when I put in :

when 48 then return [-1, 1000, 30, false] #Horrifying Poison

for a skill I wanted to use with poison, that would hit straight 1000s with 30 variance with a (-1) type, which would mean that it would take away HP.

What I got was a monster hitting up to 13,000 with poison damage, which is not what I intended.

Could anyone help me?

Thank you.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #7 on: October 23, 2013, 03:11:17 AM »
First off, wrong thread. I believe you mean this one: http://forum.chaos-project.com/index.php/topic,2481.0.html

Anyways, the -1 should be positive. Leaving it as negative means your poison would be doing 10x the amount of HP your character has.
Code: [Select]
    #  * TYPE refers to the thing sustaining damage.
    #      1 = HP, 2 = SP. If the type is positive, the amount is a literal
    #      number (eg. You lose about 50 HP). If the type is negative, then
    #      the amount is a fraction of the maximum (eg. You lose about 50% of
    #      your HP).



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline firevenge007

  • Awakened Visionist
  • **
  • Posts: 82
  • LV: 0
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #8 on: October 23, 2013, 07:39:48 AM »
I realized I wasa looking at the wrong thread when I accidently clicked on a link posted from the original thread. Sorry about that - but thank you for helping me. I owe you.

Offline Xim

  • Trained Member
  • *
  • Posts: 15
  • LV: 0
  • Gender: Male
    • View Profile
    • Steam Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #9 on: January 05, 2015, 08:55:22 PM »
Really Sorry for the necrobump but I keep getting this error.

Code: [Select]
Script 'Skill Damage Over Time' line 373:NoMethodError occured.

undefined method '[] =' for nil:NilClass

I thought I had a compatibility issue because your demo works fine. But I removed all my other scripts and it still happened for some reason. I even moved my Part 1 into your demo and it worked fine. So I'm totally stumped on why this would be happening and I don't know enough about coding to understand what that error message means.

Do you have any idea why this error message would occur?

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #10 on: January 07, 2015, 01:30:06 AM »
I'll be sure to take a look at it tomorrow. Considering this was made 2 years ago, some things might have changed in different versions of Blizz-ABS.

EDIT:
It seems that you have a script located below mine that modifies the Game_Battler#initialize method.
SHIFT + CTRL + F to look for all instances of class Game_Battler in any of your scripts below Skill Damage Over Time. Find the scripts that do NOT alias the initialize method.
Code: [Select]
class Game_Battler

  alias SOME_NEW_METHOD_NAME initialize #<========= You are looking for scripts that do not have anything that looks similar to this

  def initialize
Take those scripts and be sure to place them above Blizz ABS.
I did switch to version 2.87 and it still worked fine.

If this doesn't help, send me your Scripts.rxdata file



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Xim

  • Trained Member
  • *
  • Posts: 15
  • LV: 0
  • Gender: Male
    • View Profile
    • Steam Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #11 on: January 07, 2015, 08:58:44 AM »
Yeah, I'm still getting the error. I'm going to PM you my scripts.

EDIT: It will probably have to be tomorrow, for some reason it's taking like seven hundred years for me to put a file in my dropbox and I really need to get to bed. :facepalm:

EDIT 2: Couldn't sleep and now it's done so here you go (forget PMs I'm lazy/tired)
« Last Edit: January 07, 2015, 10:24:13 AM by Xim »

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #12 on: January 07, 2015, 10:02:08 PM »
I believe the problem is with your configuration.
Quote
[Instructions]
  > In order for skills to deal damage over time, check the box "Slip Damage"
 
  > If you want the state to wear off after so many seconds, check the box
    "Release at the end of battle".
    If you want the state to remain forever until it is cured, don't check it.
   
  > How frequent DoT takes place is based on the following formula:
        FREQUENCY = TURNS / TICKS
    where TURNS is the value you put in "After [ x ] turns" in the database
    and   TICKS is the number of times you want DoT to take place (config below)
Make sure that your database and script configurations are setup properly.
I was able to move the script just above 'Critical Sound' (had to remove Z-HUD scripts because I'm missing graphics) and get the script to work with the following configuration and by transferring my Enemies, Skills, and States files from the demo to the empty project.
Code: [Select]
      when 3 then return [7,1] # Venom
      #when 13 then return [123,2] # Burn
      #when 17 then return [124,1] # Toxic
      #when 19 then return [125,2] # Tornado
Could I also have your States and Skills files too?



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Xim

  • Trained Member
  • *
  • Posts: 15
  • LV: 0
  • Gender: Male
    • View Profile
    • Steam Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #13 on: January 08, 2015, 05:42:28 AM »
Yep, here you go.
Skills and states.

By the way, thanks a lot for putting in all this effort to try and fix this.
« Last Edit: January 08, 2015, 05:46:03 AM by Xim »

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #14 on: January 08, 2015, 06:25:06 AM »
Script still works fine for me. I didn't change anything other than just moving the script from below Main to between the Z-HUD and Critical Sound.
https://dl.dropboxusercontent.com/u/58874459/Scripts%20-%20Xim.rxdata

When exactly does the error occur?



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Xim

  • Trained Member
  • *
  • Posts: 15
  • LV: 0
  • Gender: Male
    • View Profile
    • Steam Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #15 on: January 08, 2015, 07:28:11 AM »
It happens as soon as the status effect gets inflicted.

The problem seems simpler than I thought though. It actually only happens when I load a save file that didn't start with the program, if I start a new game then it doesn't crash. I'm kind of embarrassed that I didn't notice this sooner.

But now the problem seems to be that it doesn't really do damage "over time", but simply only when the state is applied.

Offline Zexion

  • Addicted to LoL
  • Chaos User
  • ******
  • Posts: 1511
  • LV: 69
  • Gender: Male
  • My anaconda don't...jk it does
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #16 on: January 08, 2015, 07:43:42 AM »
Well the save thing happens a lot when adding stuff to blizz abs. You really shouldn't test using save files anyway. There are debug menus for this purpose.

Also, that is what the script is supposed to do. You apply the sate, and the character will be damaged over time by the skill. If you remove the state, you are removing damage over time.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #17 on: January 08, 2015, 07:52:54 AM »
Right, the script doesn't work with old save files. Every actor and enemy must be initialized with this specific variable that helps keep track of states applied. This only occurs when a new game is started (a saved game just loads the actor and enemy data--it doesn't need to re-initialize them).

For your current problem, you need to configure your states and/or script accordingly. For example, your Venom state has a 300 turn limit (in Blizz-ABS, that means 300 seconds) that is never removed (you didn't check the 'Release at the end of battle' box). Read 4.2.1. Status Effects in the Blizz-ABS manual.

Secondly, reread my script instructions, namely this part:
Quote
 > How frequent DoT takes place is based on the following formula:
        FREQUENCY = TURNS / TICKS
    where TURNS is the value you put in "After [ x ] turns" in the database
    and   TICKS is the number of times you want DoT to take place (config below)
This is what you put for your configuration:
Code: [Select]
when 3 then return [122, 1]
if TURNS = 300 and TICKS = 1, you are effectively saying that the damage frequency is once every 300 seconds. Go ahead and wait out a full 5 minutes--you'll see damage take place again.

If Venom is supposed to be removed after 5 minutes, check the 'Release at the end of battle' box and change the TICKS value to something larger, like 60 (which would be 300 / 60 = damage every 5 seconds).



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server

Offline Xim

  • Trained Member
  • *
  • Posts: 15
  • LV: 0
  • Gender: Male
    • View Profile
    • Steam Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #18 on: January 08, 2015, 08:07:08 AM »
:oops: Alright, now I understand.

I guess I took "plug and play" a little too seriously, I just figured if a script doesn't say it will corrupt old save files then it's good to go, but it this just a default with Blizz ABS features I'll keep in mind that I shouldn't be running new features with old save files. But thanks for helping me out.

Offline KK20

  • Master Scripter Fixer
  • Global Moderator
  • Guardian of Chaos
  • ****
  • Posts: 3038
  • LV: 372
  • Gender: Male
  • Bringer of Salt
    • View Profile
Re: [XP] Skill Damage Over Time for Blizz-ABS
« Reply #19 on: January 08, 2015, 08:12:35 AM »
I've made a small change so that it should work with save files now.
Glory to the ||=



Other Projects
RPG Maker XP AceUpgrade RMXP to RMVXA performance!
XPA TilemapTilemap rewrite with many features, including custom resolution!


NNID: KK20-CP
Discord: KK20 Tyler#8901
Join the CP Discord Server