Is there a way to make one variable equal to a batch of variables?

Ashtonion

Classic Creator
Veteran
Joined
Jan 3, 2014
Messages
112
Reaction score
0
First Language
english
Primarily Uses
I'm trying to make a skill where every enemy's hp and mp get halved, so I made a variable for each enemy 1-8's hp and mp, then I realized that would take forever so I came here thanks! :)
 

boldpaste2

The Dragon Heretics
Veteran
Joined
Dec 7, 2013
Messages
797
Reaction score
439
First Language
English
Primarily Uses
No need for all that ^^.

Go into your skill editor in the database and use this formula. It will halve the targets HP by there current health.

hp / 2 This is HP Damage

mp / 2 This is MP Damage

I think these would only work as separate skills though, you can probably force an action when one of the skills are executed.

!
 
Last edited by a moderator:

Ashtonion

Classic Creator
Veteran
Joined
Jan 3, 2014
Messages
112
Reaction score
0
First Language
english
Primarily Uses
I tried the hp one and it said null :o Did  do it wrong, or do I need to put something else with it? I'm not good with formulas lol
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
It should not say null. Copy and paste the formula out of your skill.


It should be HP damage with

Code:
b.hp / 2
or MP damage with
Code:
b.mp / 2
 

boldpaste2

The Dragon Heretics
Veteran
Joined
Dec 7, 2013
Messages
797
Reaction score
439
First Language
English
Primarily Uses
It should not say null. Copy and paste the formula out of your skill.

It should be HP damage with

b.hp / 2or MP damage with
Code:
b.mp / 2
Ah, I forgot to specify a or b xD
 

Ashtonion

Classic Creator
Veteran
Joined
Jan 3, 2014
Messages
112
Reaction score
0
First Language
english
Primarily Uses
Oh I forgot the "b" thanks, now could I do hp and mp at the same time?
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
do this

Code:
b.mp*=0.5;b.hp/2
This way it halves the mp then deals half hp as damage
 

Shaz

Veteran
Veteran
Joined
Mar 2, 2012
Messages
40,098
Reaction score
13,704
First Language
English
Primarily Uses
RMMV
Two issues with that ...


b.mp*=0.5 is going to potentially leave you with fractions. Either do this:

b.mp/=2;b.hp/2or this:
Code:
b.mp = (b.mp*0.5).to_i;b.hp/2
Also, I suspect the log/popup/whatever notification you have, would only show the hp damage.


This is working on the assumption that you put HP Damage as the type for the skill. If you put it as MP damage, you would need to reverse the formula:

Code:
b.hp/=2;b.mp/2
otherwise it's going to calculate half the hp, then take that amount off MP instead.
 

Engr. Adiktuzmiko

Chemical Engineer, Game Developer, Using BlinkBoy'
Veteran
Joined
May 15, 2012
Messages
14,682
Reaction score
3,003
First Language
Tagalog
Primarily Uses
RMVXA
Also, I suspect the log/popup/whatever notification you have, would only show the hp damage.
yes, it would only show the damage to HP.
 
Last edited by a moderator:

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

Latest Threads

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,858
Messages
1,017,023
Members
137,565
Latest member
Callmelogann
Top