NTCloudy425

Warper
Member
Joined
Nov 11, 2023
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
I've had some trouble with this, and I've come to ask about how I should go about it.

For context: I am using ICF-Soft's Parameter scripts to add a stat to the standard stat menu, this "stat" is supposed to be a dynamic level cap, since in the game I am creating, the level cap will increase from time to time.

To try to achieve this, I specifically used a simple script that set a level cap to a variable. If needed, here is the script (if you could even call it one):
Game_Actor.prototype.maLevel = function() {
return $gameVariables.value(20);
};

When I use an NPC to externally set my cap to an arbitrary number such as 1, the script seems to work.

The problem here is that no matter what I tried, whenever I set my variable to a number, the level cap stat did not update. I tried everything I know, even the script call sheet.

Here are some images to (hopefully) show what is happening. Thank's in advance, even if this is probably another thread that has been done before.

imgPARAM.png
Image: ICF-Soft's parameter table, it is supposed to check variable 20's value.

imgGUYLV1NOCAP.png
Image: Character, Level Cap stat is set to 0, this is natural because the variable hasn't been set at all.

imgCAPIS1.png
Image: Using an npc, I changed the level cap variable to 1.


imgLVCAPSTATDIDNTUPD.png
Image: same character, cap has been set to level 1. It had worked due to next level XP being crossed out. But the level cap stat hadn't changed one bit,

or this could be really simple, but i have no clue how to code in javascript lol.
 

AquaEcho

Script Kitty
Regular
Joined
Sep 20, 2021
Messages
2,246
Reaction score
1,663
First Language
English
Primarily Uses
RMMV
Unless the plugin author coded the parameter to accept a game variable, it won't. You basically have to modify the plugin code to bypass the parameter setting and use $gameVariables.value(x) instead to the function that the value normally gets passed to.
 

Mac15001900

JavaScript wild sorcerer
Regular
Joined
Aug 7, 2022
Messages
391
Reaction score
522
First Language
English
Primarily Uses
RMMV
Unless the plugin author coded the parameter to accept a game variable
In this case they actually did - this plugin seems to run eval on all of its numerical parameters.

I've had some trouble with this, and I've come to ask about how I should go about it.

For context: I am using ICF-Soft's Parameter scripts to add a stat to the standard stat menu, this "stat" is supposed to be a dynamic level cap, since in the game I am creating, the level cap will increase from time to time.

To try to achieve this, I specifically used a simple script that set a level cap to a variable. If needed, here is the script (if you could even call it one):
Game_Actor.prototype.maLevel = function() {
return $gameVariables.value(20);
};

When I use an NPC to externally set my cap to an arbitrary number such as 1, the script seems to work.

The problem here is that no matter what I tried, whenever I set my variable to a number, the level cap stat did not update. I tried everything I know, even the script call sheet.

Here are some images to (hopefully) show what is happening. Thank's in advance, even if this is probably another thread that has been done before.

View attachment 284586
Image: ICF-Soft's parameter table, it is supposed to check variable 20's value.

View attachment 284587
Image: Character, Level Cap stat is set to 0, this is natural because the variable hasn't been set at all.

View attachment 284588
Image: Using an npc, I changed the level cap variable to 1.


View attachment 284591
Image: same character, cap has been set to level 1. It had worked due to next level XP being crossed out. But the level cap stat hadn't changed one bit,

or this could be really simple, but i have no clue how to code in javascript lol.
You might want to post this in the plugin's thread, where you're more likely to get the creator's attention. From a cursory glance of the plugin it looks like what you're doing probably should work (though you might want to change 0020 to just 20).
 

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,919
Reaction score
11,871
First Language
German
Primarily Uses
RMMV
t is supposed to check variable 20's value.
But it doesn't, you told it to use ID 16, or Octal 20

NEVER use leading zeroes in code, because 00 is the programmer's way to switch to octal numbers
and 0020 or octal 20 is decimal 16.

delete the leading zeroes from the code and it should work
 

ATT_Turan

Forewarner of the Black Wind
Regular
Joined
Jul 2, 2014
Messages
12,589
Reaction score
11,057
First Language
English
Primarily Uses
RMMV
I'm surprised no one else noticed this - your first, simple plugin doesn't work because you've misspelled it.

It's maxLevel, not maLevel.
 

NTCloudy425

Warper
Member
Joined
Nov 11, 2023
Messages
2
Reaction score
0
First Language
English
Primarily Uses
RMMV
I'm surprised no one else noticed this - your first, simple plugin doesn't work because you've misspelled it.

It's maxLevel, not maLevel.
Oh, that's my mistake. I reviewed the code, and the script had no spelling mistake. Stuff like that happens, sorry.

delete the leading zeroes from the code and it should work
I did what you said to do, but no. It did not work, here's some attached images for reference:

imgCHANGEDSCRIPT.png

imgLV5CAP.png

You basically have to modify the plugin code to bypass the parameter setting and use $gameVariables.value(x) instead to the function that the value normally gets passed to.
Quick question, how would I go about bypassing parameter settings in the code? I have no clue what I'm doing, since I have no prior experience with JavaScript.

Thank's for all the help, though!


EDIT:
I have made the desicion to scrap trying to show the level cap via the status menu. I'll just stick with dialogue menus accessed via key item calling common events. thank you for your help.
 
Last edited:

Andar

Regular
Regular
Joined
Mar 5, 2013
Messages
39,919
Reaction score
11,871
First Language
German
Primarily Uses
RMMV
but no. It did not work,
then there were two reasons for it not to work - which would explain why it is difficult to find.

basically you would have to repeat the entire bughunt with all options again after removing the teroes, to find what other fix might have done the trick if that second cause wasn't there.
 

Latest Threads

Latest Posts

Latest Profile Posts

I've been watching videos about the videogame streamer Open Hand charity scandal, and the rabbit hole keeps getting deeper. At first it was just a lot of donated money being grossly neglected for years, and now there's a lot of money unaccounted for, which could turn this into a legitimate IRS crackdown.
Let's have some fun with my advent calendar. What would you like to see for Day 3: land, sea, or air? :rheh:
I've been thinking about doing a jokey submission for the Christmas jam in which, like a cartoon special where all the characters "play" a counterpart in A Christmas Carol, my MagiCats would each play a role from the C.A. Smith story The Coming of the White Worm, with Cyprian as Evagh, Rousalie as Dooni and so forth. But in the end, I figure all my development efforts should go toward the game proper.
In twitter, square phoenix had successfully prompted chatgpt to make the mini game watermelon pangpang.

drew some stuff to see how frontview might look. not entirely sold on or off of it yet. "could" work, but something feels missing.

Forum statistics

Threads
136,699
Messages
1,268,905
Members
180,415
Latest member
Gamerboy1999
Top