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
267
Reaction score
241
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
267
Reaction score
241
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

Grading the last exams for this semester and I need a break because I am laughing too hard xD
edit: Video link removed due to well Internet problems making it essentially nothing anyway. :kaoswt:
Sleep logic:
4 hours or less = I feel like I'm dying
5-6 hours: Feeling well rested
More than 6 hours: I feel like I'm dying
Women always say "I want to be spoiled" then get mad when I spoil them. Why would you say that if you didnt actually want to know the ending?


decided to have subclasses work differently in my game. They summon in a partner when you select one. this took some work tho as I had to get the class scene to pop up as a common event instead of straight from the menu. it was the only way to add/remove party members while on the menu screens.

Forum statistics

Threads
131,543
Messages
1,220,681
Members
173,220
Latest member
ZecaVn
Top