Storing enemy stats/attributes inside variables to apply in Damage Formula, won't work.

Bulletcaster

Warper
Member
Joined
Jan 22, 2018
Messages
1
Reaction score
0
First Language
German
Primarily Uses
RMMV
Hi guys, this is actually my first time posting a thread on this website. I hope I am easy to understand.
I have the following situation:

I have assigned certain enemy attributes to variables for each of them. I used the command "Control Variables"
In this case for:
enemy ID #5 Current HP --> V[1]
enemy ID #5 MAX HP --> V[2]
enemy ID #6 Current HP --> V[3]
enemy ID #6 MAX HP --> V[4]

Both enemy 5 and 6 have 500 max hp.
Also, lets consider current hp to be 370hp for #5 and 450hp for #6.

The idea is, to create an attack that takes the current damage dealt to the specified enemies (#5 and #6), make some calculations, and return it to the target.

Whether I create an event with parallel running span or a common event linked to an event in the map, or even on the troop events,
the damage returned is always 0.
c=((v[1]/v[2])-1)*-1; d=((v[3]/v[4])-1)*-1; e=d+c; e<=0?e*-1*v[4]+(v[1]*c):e>=0?e*v[4]+(v[1]*c):0;

If the variables were substituted with the expected values, it would look like:

c = (( 370 / 500 ) -1 )* -1; d = (( 450 / 500 ) -1 ) * -1; e = d + c; e <= 0? e * -1 *500 + (370*c):e >= 0? e * 500 + (370*c): 0

Result as damage output should be: 276

I have another one that uses the caster and the target in the formula, instead of the Variables.. and that works just fine.
However, this one doesn't :-(

I attached some Screenshots too. Sorry for it being in German, language was set automatically.
(In the command list, it says "Control Variables" and my Plugin list looks messy too XD)

Thanks in advance for anyone who is willing to help me in this case.
 

Attachments

Last edited:

Users Who Are Viewing This Thread (Users: 0, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

Couple hours of work. Might use in my game as a secret find or something. Not sure. Fancy though no? :D
Holy stink, where have I been? Well, I started my temporary job this week. So less time to spend on game design... :(
Cartoonier cloud cover that better fits the art style, as well as (slightly) improved blending/fading... fading clouds when there are larger patterns is still somewhat abrupt for some reason.
Do you Find Tilesetting or Looking for Tilesets/Plugins more fun? Personally I like making my tileset for my Game (Cretaceous Park TM) xD
How many parameters is 'too many'??

Forum statistics

Threads
105,860
Messages
1,017,040
Members
137,569
Latest member
Shtelsky
Top