Author Topic: [XP] Custom Defense Script  (Read 8550 times)

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4506
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
[XP] Custom Defense Script
« on: October 31, 2008, 06:32:50 PM »
Custom Defense Script
Authors: winkio
Version: 1.00
Type: Battle Add-on
Key Term: Battle Add-on

Introduction

This script will change the defense processing for party members so that instead of damage getting reduced by half when they defend, you can define how much damage is reduced by based on their shield.

Features

  • Custom defense processing
  • Easy to use
  • Small script

Screenshots

None needed

Script

Put this below the default scripts and above any scripts that deal with battle.
(click to show/hide)

Instructions

This script will make the damage taken when defending correspond to the shield.
The shield's shield_mdef and shield_pdef should be an integer from 0-100.  This
number will be converted into a percent (60 -> 60%).  damage taken when
defending will be reduced by this percent of its original using the pdef
percent for attacks and the mdef percent for skills (Ex. 10 damage reduced by
60% = 10 - 6 = 4 damage).

Put it below default scripts and above any battle scripts.

Compatibility

Incompatible with any script that modifies HOW damage is CALCULATED
Compatible will Blizz-ABS pretty much everything else
Note:  With Blizz-ABS, you must turn off the FULL_DEFEND option in the config section of Blizz-ABS

Credits and Thanks

  • Winkio
  • Originally produced for Galatea

Author's Notes

It is really easy to modify anything with how damage is calculated in RMXP, so if you need custom damage calculators or other adjustments, just let me know.
« Last Edit: February 21, 2009, 01:04:07 PM by Blizzard »

Offline Galatea

  • Transcended Spirit
  • ***
  • Posts: 126
  • LV: 8
  • Gender: Male
  • Im Listening. . . *Chuckles*
    • View Profile
Re: [XP]Custom Defense Script
« Reply #1 on: October 31, 2008, 08:03:51 PM »
Wow, that was fast!
Thx dude!

*Powers you up!*

Edit: Opss , cant find the FULL_DEFEND. .
Helppppp!  :^_^':

Edir: Ohh, ignore me. i got it now.  :^_^':
XD
« Last Edit: October 31, 2008, 08:24:08 PM by Galatea »

FlyingHamsta

  • Guest
Re: [XP] Custom Defense Script
« Reply #2 on: November 05, 2008, 01:18:21 AM »
One suggestion would be to include critical damage modifier as well in the same script, or other options added to spruce up defense (adding sp/hp recovery as an option, etc.)  Just seems kind of unnecessary to have a script do something that one could achieve by changing one line of code.

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4506
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: [XP] Custom Defense Script
« Reply #3 on: November 05, 2008, 01:33:17 AM »
This is a script I made for Galatea because all he wanted was the shield def change.  Any other changes to damage calculation are custom to each game.  Why would I change the system if not everybody wants it to?

And yes, there is only one line of code changed in the calculation scripts, but that was all that was needed, along with four other methods to handle passing in the new shield data.

Why make a script if I'm just changing a few lines?  Because it is easier to use and modify.  Why else do people make scripts instead of just editing the existing ones?


Isn't it nice to have an independent script that just handles one small system?  or do we all have to have ultra-scripts split into three parts like Blizz-ABS and TOA?

Offline Aqua

  • Lexima Warrior
  • *******
  • Posts: 2554
  • LV: 118
  • Gender: Female
  • Quack!
    • View Profile
Re: [XP] Custom Defense Script
« Reply #4 on: November 05, 2008, 01:46:47 AM »
Nice script Winkio.

Would you mind if I editted a bit to fit my game (so it's states that do the def change instead of shields).  Of course, I'd give you credit! :)

Offline winkio

  • Epiq
  • Administrator
  • Guardian of Chaos
  • *****
  • Posts: 4506
  • LV: 199
  • Gender: Male
  • I am lying.
    • View Profile
Re: [XP] Custom Defense Script
« Reply #5 on: November 05, 2008, 01:59:54 AM »
np, you don't really even need to give me credit.  For something small like this, I really don't mind if you just change a few lines. 

And do you mean states or stats?  Because if you mean states, then that wouldn't be a part of the defending area, but of the main area.  And for either one, make sure you do it for Game_Battler instead of Game_Actor (Game_Actor only affects party members, Game_Battler is for party members and enemies as well.)  I used Actor in this one because enemies don't have shields.

Offline Aqua

  • Lexima Warrior
  • *******
  • Posts: 2554
  • LV: 118
  • Gender: Female
  • Quack!
    • View Profile
Re: [XP] Custom Defense Script
« Reply #6 on: November 05, 2008, 02:02:00 AM »
Yeah I meant states.

If state 8 is inflicted, then all damage is 50%.  Stuff like that...

Thanks for the tips.

:)

Offline Diokatsu

  • Wind God
  • Lexima Warrior
  • *******
  • Posts: 2805
  • LV: 52
  • Gender: Male
  • Fuck yes.
    • View Profile
Re: [XP] Custom Defense Script
« Reply #7 on: November 05, 2008, 02:07:16 AM »
Quite nice, a neat idea.

I like it and I might just try and use it when I resolve my storyline 8)

Offline Blizzard

  • This sexy
  • Administrator
  • has over 9000 posts
  • *****
  • Posts: 19916
  • LV: 642
  • Gender: Male
  • Magic midgets.
    • View Profile
    • You're already on it. (-_-')
Re: [XP] Custom Defense Script
« Reply #8 on: November 05, 2008, 03:14:04 PM »
I agree with winkio, small systems have a lot of sense. They are usually compatible and very portable with many systems. I tried making Tons work that way. I put in many small systems that can work with each other. Practically you can remove any of Tons' subscripts and it should still work fine. It's just that I made it a collection to make it easier to test, make compatible with other systems and with the systems within.
Check out Daygames and our games:

King of Booze      King of Booze: Never Ever      Pet Bots
Drinking Game for Android      Never have I ever for Android      Pet Bots for Android
Drinking Game for iOS      Never have I ever for iOS      Pet Bots for iOS
Drinking Game on Steam


Quote from: winkio
I do not speak to bricks, either as individuals or in wall form.

Quote from: Barney Stinson
When I get sad, I stop being sad and be awesome instead. True story.