RMRK is retiring.
Registration is disabled. The site will remain online, but eventually become a read-only archive. More information.

RMRK.net has nothing to do with Blockchains, Cryptocurrency or NFTs. We have been around since the early 2000s, but there is a new group using the RMRK name that deals with those things. We have nothing to do with them.
NFTs are a scam, and if somebody is trying to persuade you to buy or invest in crypto/blockchain/NFT content, please turn them down and save your money. See this video for more information.
Agility Plus

0 Members and 1 Guest are viewing this topic.

***
Rep:
Level 82
We learn by living...
How to make your agility work, i.e., partially dodging those fireballs and rolling with the blows.

Feel free to skip the rant and go straight to the code.

Agility Sucks Rant
Spoiler for Rant:
Have you ever noticed that high agility (and dexterity) characters seem almost worthless? I found out it's basically true. For every +100% agility you have over your enemy's dex, you only gain an 8% evasion,
for every +100% dexterity have over your enemy's agility, you only gain a 4% critical.

Try to remember the stats are usually (especially for monsters) ranges between about 50 and 200, and most encounters are going to have these comparisons within 10-20% of each other. The difference between a goblin and an archangel for example is only 9 points: 103 vs. 112. That's 8% difference. 8% of 8% is only 0.00699%, which wont even register in the computer!

Now you know when you get a ring of agility +15 you are actually only getting 8% of an average 15% bonus, which translates to 0.012, or a 1% chance of evasion. By the time most characters get to level 13, their average agility scores will be sufficiently high enough (and matching enemies) that the computer won't register the characters as having any evasion whatsoever with most opponents.

The point is, those stats (agility and dex) don't do much of anything. So I made this super short script to make Agility less lame. 
go to line 297 of Game Actor (and 313 if you want to effect mdef) or whatever line your version of Game Actor has for "return pdef1 + pdef2 + ..." and add the green line:

    return pdef1 + pdef2 + pdef3 + pdef4 + pdef5 + [Integer((agi - 50)/5), 0].max

then Save.

That's it! Now your agility will do something (if it's over 50), for every 5 points. You can change that number however you like but I recommend keeping it higher, rather than lower. The higher that "/5" the less useful agility will be, the smaller it is, like "/2" or "/1", the more powerful agility becomes. I've got mine set up so every 100 points over 50 agility is +20 PDEF. That means if you have an agility of 999, you would have a base PDEF of 189, roughly equivalent to wearing mythril plate and shield... without having to wear it   ;D

My work on Dexterity is a bit tangent at this point, and related to projectiles, but I will probably post more on that when the bugs are worked out. ^^

P.S. - This is for RPGmaker XP, I don't know if it will work in VX.
P.S.S - I think I posted in the wrong forum unless this code also works in VX.
« Last Edit: May 26, 2010, 05:13:37 AM by shintashi »

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
Won't work in VX, since the base code is different. We don't have pdef and such. Still a great script snippet.

***
Rep:
Level 82
We learn by living...
thanks ^^ I wrote it when I noticed my "agility +200" script test didn't seem to work. I was just trying to figure out if I could correctly increase attributes using short scripts, rather than default options in eventing, and I noticed the goblins were killing me just as fast after a 300+ agility. I think anyone with an obscenely high stat should notice some effect in the game, otherwise, what's the point of putting it in?

As for Dex, Right now I've got a sling & stone effect, sling + no stones = 0 damage, stones + no sling = some dex based damage, and stones + sling = descent damage. I'm probably going to modify the stones + sling effect to have a modifier based on dex, as right now the modifier is based only on stone size. If I can perfect the sling effect, the bow + arrow and thrown knives etc. items become possible. Maybe even a boomerang?

*****
Rep:
Level 84
This text is way too personal.
Bronze - GIAW 11 (Hard)Silver - GIAW Halloween
By the way, I think you should make your script a standalone one. It's more plug and play.

And your ammo system sounds like it could work. Good luck with that!

***
Rep:
Level 82
We learn by living...
Stand Alone? How do I do that?

I figured it was set up that way, so I would make a Dexterity Plus Article too. If there's some kind of posting formats I aught to use, that would be nice to know.

***
Rep:
Level 82
We learn by living...
Here's a more dynamic version that doesn't give armor bonuses, but significantly improves Evasion and defend. I should mention it is compatible with the original Agility plus (which would make agility extremely formidable).


in Game battler 3:

defending against physical attacks
around line 55-65
   
Code: [Select]
     # Guard correction ==> modified by shintashi
        if self.guarding?
          mu = (self.agi / attacker.dex) * (self.agi / attacker.dex)
        self.damage /= (2 + mu)
        end
      end
around line 65-75
Code: [Select]
      # Second hit detection ==> modified by shintashi
mu = (self.agi / attacker.dex) * (self.agi / attacker.dex)
      eva = 8 * mu + self.eva

Defending against magic and skills
around lines 140-150
Code: [Select]
        # Guard correction ==> modified by shintashi
        if self.guarding?
      mu = (self.agi / user.dex) * (self.agi / user.dex)
          self.damage /= (2 + mu)
        end
    end

and around lines 150-165

   
Code: [Select]
  # Second hit detection
      mu = (self.agi / user.dex) * (self.agi / user.dex)
      eva = 8 * mu + self.eva

I created a fencer and with a 95 Agility he was able to dodge ghosts approximately 50% of the time. This also increases damage reduction when doing "defend" as your main action. If your agility were say 50% higher than the opponent, you might take 1/4.25 rather than 1/2 damage.
« Last Edit: December 15, 2010, 08:40:14 AM by shintashi »