Please help to use YEP's Dagme core.

I would like to create a new damage formula using the damage core.
<damage formula>
</damage formula>
Using this.

This skill is designed to do quite random damage.
When using a skill, it sets the variable from 0 to 500.

<Before Eval>
$gameVariables.setValue(298,Math.floor(Math.random() * 500));
</Before Eval>

I use the skill core plugin here.

At this time, if the variable is 0~50, a.luk * 1 will be used.
51 to 120, a.luk * 3, 121 to 220, a.luk * 7...
I want to use it like this.

What can I do?
What have you already tried to achieve your aim, and what is/isn't working about your approach?
What have you already tried to achieve your aim, and what is/isn't working about your approach?

When the variable is 0~50 or 51~120, etc.
I don't know how to make multiple checks like this.
Ahh. You'd just use if statements.

Code:
var randomValue = $gameVariables.value(298);
if (randomValue >= 0 && randomValue <= 50) { // code for 0-50 here }
else if (randomValue >= 51 && randomValue <= 120) { // code for 51-120 here }
else if (randomValue >= 121 && randomValue <= 220) { // code for 121-2220 here }

And so on and so forth.
Ahh. You'd just use if statements.

Code:
var randomValue = $gameVariables.value(298);
if (randomValue >= 0 && randomValue <= 50) { // code for 0-50 here }
else if (randomValue >= 51 && randomValue <= 120) { // code for 51-120 here }
else if (randomValue >= 121 && randomValue <= 220) { // code for 121-2220 here }

And so on and so forth.

So... like this?

<damage formula>
var randomValue = $gameVariables.value(298);
if (randomValue >= 0 && randomValue <= 50) { a.luk * 1 - b.def * 2}
else if (randomValue >= 51 && randomValue <= 180) { a.luk * 3 - b.def * 2 }
else if (randomValue >= 181 && randomValue <= 400) { a.luk * 5 - b.def * 2 }
else if (randomValue >= 401 && randomValue <= 460) { a.luk * 8 - b.def * 2 }
else if (randomValue >= 461 && randomValue <= 500) { a.luk * 13 - b.def * 2 }
</damage formula>


edit +)
Oh, it doesn't work.
value = 500;
I think the value should come out like this.
Code:
<damage formula>
var randomValue = $gameVariables.value(298);
if (randomValue >= 0 && randomValue <= 50) { value = user.luk - target.def * 2}
else if (randomValue >= 51 && randomValue <= 180) { value = user.luk * 3 - target.def * 2 }
else if (randomValue >= 181 && randomValue <= 400) { value = user.luk * 5 - target.def * 2 }
else if (randomValue >= 401 && randomValue <= 460) { value = user.luk * 8 - target.def * 2 }
else if (randomValue >= 461 && randomValue <= 500) { value = user.luk * 13 - target.def * 2 }
</damage formula>
Code:
<damage formula>
var randomValue = $gameVariables.value(298);
if (randomValue >= 0 && randomValue <= 50) { value = user.luk - target.def * 2}
else if (randomValue >= 51 && randomValue <= 180) { value = user.luk * 3 - target.def * 2 }
else if (randomValue >= 181 && randomValue <= 400) { value = user.luk * 5 - target.def * 2 }
else if (randomValue >= 401 && randomValue <= 460) { value = user.luk * 8 - target.def * 2 }
else if (randomValue >= 461 && randomValue <= 500) { value = user.luk * 13 - target.def * 2 }
</damage formula>

Oh, thank you! it working!
Additionally, I was stupidly set to 'none' rather than 'decrease HP' in skill settings.

Just one more thing, please.
I want to display it using BattleManager.addText using the Message Core plugin, but what should I do at this time?

if (randomValue >= 0 && randomValue <= 50) { value = user.luk - target.def * 2}
var text = ' TEXT'
var wait = 60;
BattleManager.addText(text, wait);
else if (randomValue >= 51 && randomValue <= 180) { value = user.luk * 3 - target.def * 2 }
var text = ' TEXT'
var wait = 60;
BattleManager.addText(text, wait);
else if (randomValue >= 181 && randomValue <= 400) { value = user.luk * 5 - target.def * 2 }
var text = ' TEXT'
var wait = 60;
BattleManager.addText(text, wait);
else if (randomValue >= 401 && randomValue <= 460) { value = user.luk * 8 - target.def * 2 }
var text = ' TEXT'
var wait = 60;
BattleManager.addText(text, wait);
else if (randomValue >= 461 && randomValue <= 500) { value = user.luk * 13 - target.def * 2 }
var text = ' TEXT'
var wait = 60;
BattleManager.addText(text, wait);

Can I set it up like this?
What do you want to display exactly?
What do you want to display exactly?

When the variable is 0~50, it displays a message of '흉길' and wishes the damage of the skill to be applied.
Similarly, in the case of 51~180, '소길'
In the case of 181~400, '중길' ......
Like this...
You need to put the BattleManager.addText call and the text/wait variables inside the curly braces of each if statement. Right now they're not part of it. Hang on.

Code:
if (randomValue >= 0 && randomValue <= 50) {
  var text = ' TEXT'
  var wait = 60;
  BattleManager.addText(text, wait);
  value = user.luk - target.def * 2;
}

Like that.
You need to put the BattleManager.addText call and the text/wait variables inside the curly braces of each if statement. Right now they're not part of it. Hang on.

Code:
if (randomValue >= 0 && randomValue <= 50) {
  var text = ' TEXT'
  var wait = 60;
  BattleManager.addText(text, wait);
  value = user.luk - target.def * 2;
}

Like that.

Oh, sorry, I said it was a message core because I didn't know exactly what plugin it was.
It seems to be in Battle engine core and Buff&state core.
There was a script that helped me in the past, and I needed these two for that.
It's cool, I found it and figured out what you need to make it work. 🙂

Original thread: https://forums.rpgmakerweb.com/threads/please-help-to-use-yeps-dagme-core.123423/