Simulating a Skill Formula oustide of battle?

Hero_Claive

(Phoenix Ember)
Veteran
Joined
Jan 5, 2016
Messages
149
Reaction score
88
First Language
English
Primarily Uses
RMVXA
Been experimenting trying to create a window in Scene_Skill that shows hypothetical damage output of a given skill. This is easier said than done, however, as I'm having an increasing amount of trouble getting the program to return a numeric value from the skill's formula outside of battle. I'm doing this by simulating an @actor argument in the Window class and $data_enemies[999] which is just a dummy with 0 Defense. All I did after that was use @skill.damage.formula, then @actor.send(formula), but that returns an error even when the exact method is defined under Game_Battler.

I can give more examples/actual code if needed, but I'm curious if anyone knows an immediate solution to return a value for a given skill outside of battle using a hypothetical enemy. I found the precise method "make_damage_value(user, item)" but not only does it straight up return 0, it also calculates a lot of things I don't want (I only want to simulate the formula, without variance or crit).

If anyone has any idea on how to do this, I'd be more than appreciative.
 

Another Fen

Veteran
Veteran
Joined
Jan 23, 2013
Messages
564
Reaction score
275
First Language
German
Primarily Uses
Hey there,

You were on the right track, the evaluation of the damage formula is shown in the first line of that method:
item.damage.eval(user, self, $game_variables)

However, $data_enemies[X] is probably incompatible with most formulas. The easiest way to get a target dummy would be to use $game_actors[X] with an unused actor instead. ($data_enemies and $data_actors only contain your database settings and have a different layout than actual battlers.)
 

Hero_Claive

(Phoenix Ember)
Veteran
Joined
Jan 5, 2016
Messages
149
Reaction score
88
First Language
English
Primarily Uses
RMVXA
Great catch! I did try that method but like a numbskull, still tried to use $data_enemies. I created a dummy actor as you instructed and it works beautifully. Thanks a ton!
 

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

Latest Threads

Latest Profile Posts

so hopefully tomorrow i get to go home from the hospital i've been here for 5 days already and it's driving me mad. I miss my family like crazy but at least I get to use my own toiletries and my own clothes. My mom is coming to visit soon i can't wait to see her cause i miss her the most. :kaojoy:
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

Forum statistics

Threads
105,868
Messages
1,017,070
Members
137,577
Latest member
SadaSoda
Top