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 Posts

Latest Profile Posts

Steam page is now live!
1632768058957.png
just discovered thig game called Willowbrooke Post... beautiful artstyle if I do say so myself... does anyone know what this kind of style is called??
In one of my game projects, I am working on an arena where you can fight combatants or bet on monsters, and, man, it is taking so long, lmao. I do not think that it helps that I am using an evented combat system with a lot of things that I have to edit.
Time to take a little break from the project to work on another for Skyrim. Shouldn't take too long, as it's just fulfilling an easy to do request(more than likely I'll get beaten to the punch but...) this also gives me an excuse to play Skyrim again LOL.
Dawg.gifKhat.gif
I made two new friends today. I'm not sure which style I like the best..?

Forum statistics

Threads
115,412
Messages
1,089,667
Members
150,154
Latest member
monoko
Top