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.
[VX] Changing the Critical Hit Formula

0 Members and 1 Guest are viewing this topic.

**
Rep:
Level 83
Project of the Month winner for March 2010
Hi, everyone. I have one request and one question. As specified in the subject of this topic, I'm using RPG Maker VX (not Ace). I'll start with the request.

Request: changing the critical hit damage formula, editing Mithran's Critical Skills v 1.4 Script.

I am using a script affecting critical strikes and I am trying to change a formula, taking the critical damage multiplier down from 2 to 1.5 (meaning that critical strikes should deal 50% increased damage/healing, not 100%).

The formula used in the script is the following:

Code: [Select]
@hp_damage *= 2 if @critical

What I want is to make the multiplier 1.5. I tried changing it to:

Code: [Select]
@hp_damage *= 1.5 if @critical

but that would often create decimals which cannot be shown properly. Decimals wouldn't make sense anyway, but I am also using SBS Battle System (yes, Tankentai), so the project simply has no way to show the output numbers. Having said all that, for what I can tell, the calculations seem correct. I tried to round up the results, but using:

Code: [Select]
@hp_damage *= (1.5).floor if @critical
Or "(1.5).ceil"

resulted as if I put in just 1 as a multiplier. I don't know that much about scripting, unfortunately, so I tried working my way around it, test after test, trying "== damage.floor*3/2", or "*= 3/2" and such. It seems that the closest I could get to was my first attempt: "*= 1.5 if @critical". I tried googling the language used to modify calculations and formulas, I couldn't find anything to solve this myself.

If you need it, here is the full Script: Mithran's Critical Skills v 1.4. Thank you.


Question: is there a way to make something happen when dealing a critical strike?

This is not really a request, because I am not asking you guys to come up with a script to add this feature. If you thought about this, or know ways to make this work, even through common events, let me know. I have been googling and searching forums for scripts affecting critical strikes. All scripts won't go further than changing the critical strike chance, but that's not enough. Of course, if you can think of a simple script to add this feature, and if you believe that this feature is something people would use, be my guest and write the script down, but to be honest I see this as a lot of work.
Current Project:


*
Rep:
Level 97
2014 Most Unsung Member2014 Best RPG Maker User - Engine2013 Best RPG Maker User (Scripting)2012 Most Mature Member2012 Favorite Staff Member2012 Best RPG Maker User (Scripting)2012 Best MemberSecret Santa 2012 ParticipantProject of the Month winner for July 20092011 Best Use of Avatar and Signature Space2011 Best RPG Maker User (Scripting)2011 Most Mature Member2011 Favourite Staff Member2011 Best Veteran2010 Most Mature Member2010 Favourite Staff Member
For your request, you were very close. Try this:

Code: [Select]
@hp_damage = (@hp_damage * 1.5).floor

**
Rep:
Level 66
RMRK Junior
Try: 

@hp_damage += (@hp_damage / 2)) if @critical;

answer to the 2nd question, use an "if" statement somewhere in your code, like:

 if @critical { do something }

**
Rep:
Level 83
Project of the Month winner for March 2010
Thanks a lot. Both of you!
Current Project: