DecoyJackal

Villager
Member
Joined
Jun 24, 2020
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
Basically in a another game I'm working on, I'm trying to to make a skill call "Mend" that has 20% to fail, but I don't want to see the "There was no effect on %1!" message at all, so I've figured a good way to get around it is to code it in Lunatic Mode, but despite reading all the tips & tricks tutorials I'm still deeply confused by what "evals" I should use?

All I know is that it is gonna involve Yanfly's Battle Engine Core, Skill Core, and maybe Damage Core?

The skill goes a little something like this:
  • A message is sent to the battlelog saying: "(User) tries to mend its wounds..."
  • A selected animation plays.
  • A random number is generated between 1 and 0.
  • If the random number is below 0.8, then it "succeeds".
  • Then the user recovers 2.5 * MAT of HP with 10% variance.
  • And if possible, then a additional message is added saying: "...and recovers (HP Recovered) HP."
  • However if the random numbers passes 0.8, then it "fails", saying: "...but failed to."
So... is it possible to recreate? For the record it's my first time using Lunatic Mode, and once you guys showed me how to do it, I think I may able to comprehend it.
 

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
210
Reaction score
160
First Language
English
Primarily Uses
RMMZ
It should be possible. Been awhile since I've used SkillCore, so I'm rusty. It involves javascript coding though, if you didn't already know that.

I think the easiest method would be in the pre-damage eval, since that's where the split will happen for success/failure. There's a variable defined for that section for the resulting "damage"(healing if the skill is set up correctly). I BELIEVE it's "value". Anyway, set up the skill, with the formula you want. Then in the skill notes area, create a temporary variable in the correct notetag set, and set it to your random number. (Math.round()) Then check if the number is below 0.8. If it is not, set the value equal to zero.

For the battle log message... I don't know offhand how to set that. It's in the code somewhere but I've never bothered to look for it before. But if you figure that part out, set the message to your fail message if your number was above 0.8, and the success message if it was below.
 

DecoyJackal

Villager
Member
Joined
Jun 24, 2020
Messages
11
Reaction score
0
First Language
English
Primarily Uses
RMMV
Alright so... I think I managed to get working, while I'm not new to coding, I'm still quite new JavaScript and to Lunatic Mode as a entirely. I'm just leaving this here for future reference.

Code:
<setup action>
display action
</setup action>

<target action>
action animation
wait for animation
if (Math.random() < 0.80)
   action effect: target
else
   eval: BattleManager.addText("...but fails to.", 60)
end
</target action>

<finish action>
clear battle log
</finish action>

So if there is anyone else who is reading this... is there any sort way I could get the resulting number of HP Recovered for so I could use it for future battle text messages?
 

Drakkonis

Veteran
Veteran
Joined
Mar 5, 2021
Messages
210
Reaction score
160
First Language
English
Primarily Uses
RMMZ
So if there is anyone else who is reading this... is there any sort way I could get the resulting number of HP Recovered for so I could use it for future battle text messages?
If you're using SkillCore, yes. Post-damage eval contains the resulting damage/healing. You could set a game variable to that value to reuse later.
 

Latest Threads

Latest Profile Posts

Playing Aroma Indosiar theme song.
Aroma is an Indonesian TV show about cooking. :)
Working on a characteeer! (Why is it so hard to color hair?) ;-;
Silly-Sketches.png
Just finished eventing a couple simple puzzles in RMMV, for my very first game "Sample Quest." Just messing around, throwing things together, and calling it a story XD On a non-RM note, got my hair cut today!
I feel the need to inform everyone on the forums NOT to go with Web Hosting Canada for your hosting needs. It is by far the worst customer service and just overall experience I have ever had with hosting and I am Canadian...
BCj
Got another eye surgery monday. Hope I'll recover quick and all's well. A bit tired of surgeries. On a happy note, working on the next chapter of Escalia so hope I can continue soon :)

Forum statistics

Threads
115,370
Messages
1,089,338
Members
150,063
Latest member
nortom
Top