GoldenGemGames

Veteran
Veteran
Joined
Aug 28, 2018
Messages
84
Reaction score
9
First Language
English
Primarily Uses
RMMV
So the Console from CoreEngine printed the error below. Can you tell me the mistake I made?
This was what I put into "Escape Ratio"
($gameParty.luck() * 5 + $gameParty.agility()) / $gameTroop.agility()
 

Attachments

  • Developer Tools - chrome-extension___odlameecjipmbmbejkplpemijjgpljce_index.html 5_4_2021 4_20...png
    Developer Tools - chrome-extension___odlameecjipmbmbejkplpemijjgpljce_index.html 5_4_2021 4_20...png
    40 KB · Views: 7

GoldenGemGames

Veteran
Veteran
Joined
Aug 28, 2018
Messages
84
Reaction score
9
First Language
English
Primarily Uses
RMMV
So the Console from CoreEngine printed the error below. Can you tell me the mistake I made?
This was what I put into "Escape Ratio"
($gameParty.luck() * 5 + $gameParty.agility()) / $gameTroop.agility()
Also, the "console" doesn't really seem to be a console at all. There is a strange glitch I somehow caused recently that constantly sets my params to 1. Is there a way to see the code run as I play, so I can maybe pinpoint what is causing it? Changed the formula but get the same problem:
0.7 * $gameParty.agility() + $gameParty.luck() / $gameTroop.agility() How come Luck is invalid here?
 
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,036
Reaction score
2,288
First Language
English
Primarily Uses
RMMV
It tells you exactly what your mistake is in the screenshot you posted. $gameParty.luck isn't a function. If you want to use the party's average luck, you'll have to code the calculation yourself.
 

GoldenGemGames

Veteran
Veteran
Joined
Aug 28, 2018
Messages
84
Reaction score
9
First Language
English
Primarily Uses
RMMV
It tells you exactly what your mistake is in the screenshot you posted. $gameParty.luck isn't a function. If you want to use the party's average luck, you'll have to code the calculation yourself.
So I can't calculate Luck here? What do I do?
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,036
Reaction score
2,288
First Language
English
Primarily Uses
RMMV
(($gameParty.members().reduce((accumulator, currentValue) => { return accumulator + currentValue.agi }, 0) / $gameParty.members().length) * 5 + $gameParty.agility()) / $gameTroop.agility()
 
Last edited:

ATT_Turan

Forewarner of the Black Wind
Veteran
Joined
Jul 2, 2014
Messages
929
Reaction score
491
First Language
English
Primarily Uses
RMMV
Have you done tutorials for MV, that walk you through how to configure actors and classes? You seem to be jumping ahead to advanced JavaScript usage without understanding the basics of the software - there is no such thing as "the party's luck," only "the luck of this specific actor."

If you want to reference a specific actor's Luck value, you can do it by referencing that actor's ID in the database: $gameActors.actor(ID).param(7)

Trihan's suggestion is helpful if you are trying to reference the average agility of all the party members, and you can do something similar for luck, but still - I would suggest you complete some more tutorials to build a sample game, then play it to get a better idea of how the mechanics work.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,036
Reaction score
2,288
First Language
English
Primarily Uses
RMMV
Have you done tutorials for MV, that walk you through how to configure actors and classes? You seem to be jumping ahead to advanced JavaScript usage without understanding the basics of the software - there is no such thing as "the party's luck," only "the luck of this specific actor."

If you want to reference a specific actor's Luck value, you can do it by referencing that actor's ID in the database: $gameActors.actor(ID).param(7)

Trihan's suggestion is helpful if you are trying to reference the average agility of all the party members, but I am not convinced that's what you're actually trying to do - I would suggest you complete some more tutorials to build a sample game, then play it to get a better idea of how the mechanics work.
I assumed it was meant to be the party's average luck since that's what $gameParty.agility() returns.
 

GoldenGemGames

Veteran
Veteran
Joined
Aug 28, 2018
Messages
84
Reaction score
9
First Language
English
Primarily Uses
RMMV
(($gameParty.members().reduce((accumulator, currentValue) => { return accumulator + currentValue.agi }, 0) / $gameParty.members().length * 5) + $gameParty.agility()) / $gameTroop.agility()
So that allows Luck to be calculated? Sweet! Another thing, is it possible to view the runtime while playing? There's a glitch I am trying to figure out.
 

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,036
Reaction score
2,288
First Language
English
Primarily Uses
RMMV
So that allows Luck to be calculated? Sweet! Another thing, is it possible to view the runtime while playing? There's a glitch I am trying to figure out.
If you want something to output its current value when executing the code, you can add a "console.log" to the part of the code you're debugging. You can also go to the "source" tab and set breakpoints.

$gameParty.members().reduce((accumulator, currentValue) => { return accumulator + currentValue.agi }, 0) / $gameParty.members().length)

will get the average luck of your current battle party: basically the reduce function runs through each member and adds that member's luck to a running total, then after it calculates the total luck, divides it by the number of party members.
 

GoldenGemGames

Veteran
Veteran
Joined
Aug 28, 2018
Messages
84
Reaction score
9
First Language
English
Primarily Uses
RMMV
If you want something to output its current value when executing the code, you can add a "console.log" to the part of the code you're debugging. You can also go to the "source" tab and set breakpoints.
Where can I find the values for Base Parameters? A glitch is forcing these values to thier minimum possible value for some strange reason. So can I have it so whenever the HP param is set it will show me the value when typing console.log? Ehere do I do that? Also I want to find what causes it to become 1.
 
Last edited:

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,036
Reaction score
2,288
First Language
English
Primarily Uses
RMMV
There are a number of places in the code that affect HP value and more which access the property's value, so you can't just set a breakpoint for that. If you caused the problem recently, I would recommend turning plugins off one by one until you no longer get the issue, at which point you know which one caused it.
 

GoldenGemGames

Veteran
Veteran
Joined
Aug 28, 2018
Messages
84
Reaction score
9
First Language
English
Primarily Uses
RMMV
There are a number of places in the code that affect HP value and more which access the property's value, so you can't just set a breakpoint for that. If you caused the problem recently, I would recommend turning plugins off one by one until you no longer get the issue, at which point you know which one caused it.
Not sure which plugin it is, but I turnedoff all the best candidates and the params are normal again! I hope I can pinpoint the issue soon.
 

GoldenGemGames

Veteran
Veteran
Joined
Aug 28, 2018
Messages
84
Reaction score
9
First Language
English
Primarily Uses
RMMV
Not sure which plugin it is, but I turnedoff all the best candidates and the params are normal again! I hope I can pinpoint the issue soon.

It was the BuffsStatesCore. That means this MUST be the issue. I apparently need the + 1 at the end. Let me see if adding it back fixes it.
 

Attachments

  • Metalite Wars - RPG Maker MV 5_4_2021 6_28_18 AM.png
    Metalite Wars - RPG Maker MV 5_4_2021 6_28_18 AM.png
    20.4 KB · Views: 3

Trihan

Speedy Scripter
Veteran
Joined
Apr 12, 2012
Messages
3,036
Reaction score
2,288
First Language
English
Primarily Uses
RMMV
Ah, yeah. With the formula you have there, when a stat is unbuffed, it becomes its value * 0 * 0.2, and multiplying something by 0 always returns 0. Stats can't be 0, so they go to their minimum of 1.
 

GoldenGemGames

Veteran
Veteran
Joined
Aug 28, 2018
Messages
84
Reaction score
9
First Language
English
Primarily Uses
RMMV
Ah, yeah. With the formula you have there, when a stat is unbuffed, it becomes its value * 0 * 0.2, and multiplying something by 0 always returns 0. Stats can't be 0, so they go to their minimum of 1.
Ah, so THAT's why! BTW the params are fixed now, thanks for the help man!
 

Latest Threads

Latest Posts

Latest Profile Posts

2dfloor.png
What a fun tileset I've got here so far!
Minecraft Tiles, Maid Day, Custom Menu, Retry at GameOver, Save in Appdata | RPG Maker News #36

side view special bust.png
Reworking the art for the 'special busts' in important game dialogue. Potentially replacing the more 'dead-on' look of the original:
original.png
Me: Imma work on my game! Let's get some progress done
Me, five minutes later smoking a cigarette: *screams into the void*
Just got back from work... I got to recommend a dish I liked to a group of senior ladies, and they said they'd order it for dessert! What was it? CHURROS! It's one of my favorite desserts at my workplace.
What's your favorite dessert? I'll eat any pastry with cinnamon and sugar, but especially churros. And then there's chocolate... omg, so good!

Forum statistics

Threads
111,255
Messages
1,059,618
Members
144,537
Latest member
mlgdumb
Top