ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
658
Reaction score
937
First Language
German
Primarily Uses
RMMV
@Indinera
I don't really like using ternary operator in my formulas, they look ugly and disorganized.
I rather use normal JS formatting

Your formula would look like this then:


JavaScript:
c=a.atk-b.def; if (a.hpRate() < 0.3) {250 + 4*c} else if (a.hpRate() < 0.5) {4*c} else {c}

If you really don't use the formula in this way, you can just use your own formula and test it out.
The numbers won't lie.
 

Indinera

Indie Dev
Veteran
Joined
Mar 13, 2012
Messages
2,085
Reaction score
893
First Language
French
Thank you, saving this for future reference in case I bump into an issue.
Ternary formulas look ugly but they are very compact, which is something I like.
I don't like having to scroll through a long formula with a box so small it displays like 20% of it at once.
 

Flauschifluff

Warper
Member
Joined
Apr 19, 2021
Messages
1
Reaction score
0
First Language
German
Primarily Uses
RMMV
Hello. So, I can't seem toget the Variables working properly. The Formula is this:

60 + (a.atk * (a.level * 0.2) + a.luk) * (1 + v[2]) - b.def * 5

Everytime used the variable 2 will be changed, a random number between and including 0 and 9.
Could there be difficulties if the variable isn't defined yet?
While writing this edited the event slightly, it now works on the second use onward. Might be unlucky RNG rolls but it seems to be very close.
A normal Attack without the multiplication of 1 + v[2] deals around 50 damage and all rolls i got so far was just ranging between 50 and 70, that could be within the 20% variance couldn't it?
 

emelian65

Veteran
Veteran
Joined
Sep 13, 2015
Messages
195
Reaction score
65
First Language
Spanish
Hello, it may be weird to ask, but is there an actual way to use, something like the Evation rate in the damage formula, I was thinking in something simple as a.eva, but I think is not a flat number but a percentage (if the system actually has a way of finding the eva value for actor and enemy), I dont0 want to to be a hit or miss just a suimple damage, is it possible?
 

ScorchedGround

Blizzards most disappointed fan (More than ever)
Veteran
Joined
Apr 12, 2020
Messages
658
Reaction score
937
First Language
German
Primarily Uses
RMMV
@emelian65
You can use all parameters in the damage formulas.
However, most of them are not actually processed as % numbers, but rather decimals.

Basically,
100% evasion rate translates to 1.
50% evasion rate translates to 0.5.

So you could do something like

(a.hit * 100) to convert the decimal back to the % number.

Here is the list of all parameters you can use:

Base Parameters

mhp - max hp
mmp - max MP
atk - attack
def - defence
mat - magic attack
mdf - magic defence
agi - agility
luk - luck

Extra Parameters (Default Value is 0 -> 0%)

hit - Hit rate
eva - Evasion rate
cri - Critical rate
cev - Critical evasion rate
mev - Magic evasion rate
mrf - Magic reflection rate
cnt - Counter attack rate
hrg - HP regeneration rate
mrg - MP regeneration rate
trg - TP regeneration rate

Special Parameters (Default Value is 1 -> 100%)

tgr - Target Rate
grd - Guard effect rate
rec - Recovery effect rate
pha - Pharmacology
mcr - MP Cost rate
tcr - TP Charge rate
pdr - Physical damage rate
mdr - Magical damage rate
fdr - Floor damage rate
exr - Experience rate
 
Last edited:

arkantos

Villager
Member
Joined
Dec 22, 2014
Messages
22
Reaction score
2
First Language
Español
Primarily Uses
RMMV
Hi, Can anyone give me some guidance? I want to make a skill similar to the knights of FFT, where they broke parts of the equipment. (swords, armor, etc).

 

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
2,780
Reaction score
1,630
First Language
English
Primarily Uses
RMMV
Hi, Can anyone give me some guidance? I want to make a skill similar to the knights of FFT, where they broke parts of the equipment. (swords, armor, etc).
This has nothing to do with a damage formula. This would be accomplished by placing a state on the target, or calling a common event, or using an action sequence (I'd do it there).

You'll get more luck posting your own thread to ask about it.
 
Last edited:

Corporal_Siva

Warper
Member
Joined
Mar 4, 2021
Messages
1
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm trying to make an attack that deals more damage the less HP a user has, but it won't seem to work for me. This is the formula I'm using.



a.mhp/a.hp*30*a.atk/b.def < 200*a.atk/def ? a.mhp/a.hp*30*a.atk/b.def : 200*a.atk/b.def;
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
656
Reaction score
269
First Language
English
Primarily Uses
RMMV
For starters, you have one def that's missing the b. in front of it.

Even with that fixed, I think your formula does the opposite of what you want. If I recall correctly, there is a.hpRatio() which is just another way to write a.mhp/a.hp, but unless I'm missing something, what you actually need here is (1 - a.hpRatio()).
 

TheGentlemanLoser

"And when we fall, we will fall together..."
Veteran
Joined
Dec 30, 2020
Messages
338
Reaction score
451
First Language
English
Primarily Uses
RMMV
Hey, so this one's pretty tricky and I have no idea if it's even possible, honestly.

I'm using SRD's Timed Attack w/ the Timed Attack Arrows feature. The plugin created a new (variable? argument? what is the correct terminology for this I'm hopeless) for use in damage formulae, $gameTemp.tas_power which returns a result between 0 and 1, meaning an attack would deal full damage with a perfect input and 0% with a fail. I wasn't crazy about that but it was very easy to modify, I just used ($gameTemp.tas_power + 0.5) so that a failure does half damage and a success does 1.5x damage, easy peezy.

So that's better, but I have a feeling what I *really* want to do will be harder, if it's possible. Is there anything I can write in the formula bar to make it check if $gameTemp.tas_power = 1 and if it is, initiate a followup skill (also identified in the formula bar and probably the same skill)? So if you're "on beat" with the button presses, you can keep spamming the attack as long as you have the resources to activate the skill and don't miss an input.

I have VE_BasicModule and VE_FollowUpSkills installed but turned off and not yet config'd, because I'm not sure if VE_FollowUpSkills can be made to work with this weird idea I have.

Another question, would math.min(actualdamageformulahere, b.hp-1) result in a damage expression that can reduce the target to 1HP but not actually kill them, i.e. a "nonlethal" skill? Suppose that's easy enough to test, although that's for a different project I'm not actively working on atm so couldn't hurt to ask.
 

miragewolf

Villager
Member
Joined
Jul 23, 2019
Messages
28
Reaction score
2
First Language
Traditional Chi
Primarily Uses
RMMV
Hi, how would I be able to emulate D&D multi attack with this, such as +20/+15/+10 to hit?

It seems the formula would read lie this.

a.addstate(x); a.atk-b.def;

But a.atk-b.def; a.addstate(x); would result in error aka 0 point damage

(x state is the penalty from first attack), haven't succeeded in making another attack after first debuff

Also the game crashes if I've Yanfly's damage core on with the below formula. Is there something wrong with it? Tried to make grab type of attack.

if (a.mat +a.hp/10 +13) > (b.hp/10 + b.mat + Math.random(20)){b.addState(27); a.atk + a.mat - 8 -b.def} else {(a.atk *0.8 + a.mat -8- b.def)}
 

hosercanadian

Veteran
Veteran
Joined
Jul 18, 2016
Messages
53
Reaction score
15
First Language
English
Primarily Uses
I am looking for some help on using a script call in the damage formula. I am attempting to use the QSprite plugin in the damage formula when an attack occurs.

I have tried using Common Events, but this just has the sprite motion occur after the attack.

Any help would be appreciated.

My formula is below:

this.pluginCommand("QSprite", [$gameVariables.value(4), "play","atk"]); a.atk * 4 - b.def * 2
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
656
Reaction score
269
First Language
English
Primarily Uses
RMMV
You can abbreviate $gameVariables.value(4) to just v[4].

Besides that, the reason your formula doesn't work is because it expects this to be a game interpreter, but it's actually something else… I can't remember what specifically, perhaps an "action"?

My first suggestion would be to dive into the QSprite plugin source code to figure out what the QSprite plugin command actually does. If it's something simple, you might be able to simply substitute that code in place of the pluginCommand call.
 

Andar

Veteran
Veteran
Joined
Mar 5, 2013
Messages
34,306
Reaction score
8,750
First Language
German
Primarily Uses
RMMV
pluginCommand(
beside the answer above, the plugin commands were never meant to be called by script at all - their entire function is to replace script commands with an easier framework.
As such a plugin contains a function that processes the arguments of the event command into their true script functions, and you now called that process by script. That is as if you want to travel from Berlin to Brussels by taking the "shortcut" through Tokio on the other side of Earth...

You should go into the plugin code and look for the function that processes the plugin commands, then check there what script function is called by that and use this script call directly, completely bypassing the plugin command option.
 

hosercanadian

Veteran
Veteran
Joined
Jul 18, 2016
Messages
53
Reaction score
15
First Language
English
Primarily Uses
You can abbreviate $gameVariables.value(4) to just v[4].

Besides that, the reason your formula doesn't work is because it expects this to be a game interpreter, but it's actually something else… I can't remember what specifically, perhaps an "action"?

My first suggestion would be to dive into the QSprite plugin source code to figure out what the QSprite plugin command actually does. If it's something simple, you might be able to simply substitute that code in place of the pluginCommand call.

beside the answer above, the plugin commands were never meant to be called by script at all - their entire function is to replace script commands with an easier framework.
As such a plugin contains a function that processes the arguments of the event command into their true script functions, and you now called that process by script. That is as if you want to travel from Berlin to Brussels by taking the "shortcut" through Tokio on the other side of Earth...

You should go into the plugin code and look for the function that processes the plugin commands, then check there what script function is called by that and use this script call directly, completely bypassing the plugin command option.

Thanks to both of you on the input.

Unfortunately the QSprite plugin is a bit out of my scope. I just spent a few hours trying to narrow down the exact portion that causes the Sprite motion to occur and I am having a tough time narrowing it down.

Link to plugin: https://quxios.github.io/plugins/QSprite

I am ultimately trying to use this plugin with the SRPG plugin to have on map battles with more animation frames than the 3 allowed by the SRPG plugin. Any additional insight would be appreciated.
 

Solar_Flare

Veteran
Veteran
Joined
Jun 6, 2020
Messages
656
Reaction score
269
First Language
English
Primarily Uses
RMMV
The key section to examine for this purpose appears to be here.

For your specific example, you would need to find the subsection for cmd === 'play'. Based on that, the following code should do what you want:

JavaScript:
QPlus.getCharacter(v[4]).playPose('atk', false, false, false, false);

I'm not certain if all the falses are required; you might be able to shorten it to this:

JavaScript:
QPlus.getCharacter(v[4]).playPose('atk');

If you need to do a different command, just look through the above link (or your local copy thereof) to find the name that needs to replace playPose for that command.
 

Latest Threads

Latest Posts

Latest Profile Posts

I'm just so close to replacing LUK with a different stat, maybe DEX but we'll see.
Slapped together a title screen and working on some dungeon clutter + portraits for Dubhghaill and Einar. Usual CW for minor body horror wrt Einar
QVLJIgD.png

OaPcYUy.png

r55FiUJ.png

EIgO94y.png
cT1V4nb.png
>studying for months for an exam
>does exam
>waits 3 months for the results to come out
>me trying to login, incorrect password
>I get recovery password
>me trying to login, incorrect password

What the heck. As a son of a Karen, I'm going to file a few complaints.

Forum statistics

Threads
117,145
Messages
1,104,938
Members
153,214
Latest member
jzu1999
Top