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,052
Reaction score
2,313
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,052
Reaction score
2,313
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
938
Reaction score
494
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,052
Reaction score
2,313
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,052
Reaction score
2,313
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,052
Reaction score
2,313
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,052
Reaction score
2,313
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

Finished with the semester; finally have some time to play around with MV :kaopride:
Started work on the fishing Mini-Game
The Dark Toon art style is now available as Steam branches. (Both for the main game and the demo)
Battle.jpgCaptain.jpgCutsene.jpg
There are 2 versions. One only affects combat, cutscene, and portraits. The other one changes more.
So, technically, the game now has 7 versions on steam.
Arcade-Style RPGM Games? RM2k3 Game Jam & Synth-Retro Music by Azakaela | RPG Maker News #39

Forum statistics

Threads
111,353
Messages
1,060,429
Members
144,682
Latest member
sleepykat
Top