ICF-Soft Params Core

Bertrand

Villager
Member
Joined
Feb 22, 2017
Messages
11
Reaction score
1
First Language
Francais
Primarily Uses
Other
Thank you for your response and update.

I'm sorry to take your time because of my lack of experience but I still have a few questions.

If I use 'Plus Eval' parameter in the plugin it's a global setting on all my classes that will apply.

I would like to have specific parameters for each of my classes.

In the help file, if I understood correctly I have to use <NPARAM: NParam Base Grow HGrow Cap> in the class notetag.

However I'm a bit lost for the calculation I have to do.

With the Yanfly plugin my calculations look like this:

<Custom Class Parameters>
maxhp = 79 + Math.pow(level, 1.92)
maxmp = 30 + Math.pow(level, 1) * 3
atk = 29 + Math.pow(level, 1.45)
def = 39 + Math.pow(level, 1.17)
int = 2 + Math.pow(level, 1.12) / 1.5
res = 25 + Math.pow(level, 1.1)
agi = 20 + Math.pow(level, 1)
luk = 3 + Math.pow(level, 1.05) / 1.5
</Custom Class Parameters>

With your plugin I don't know what and how to put to have the same result.

I'm trying this:

<PARAM: mhp 79>

But after 79 I'm lost :/

Maybe I'm wrong.
 

Destra47

Veteran
Veteran
Joined
Jul 14, 2020
Messages
35
Reaction score
15
First Language
English
Primarily Uses
RMMV
It's a bit weird. There is a bug that I have to find.

EDIT: Found it and reuploaded plugin.
It works now! Thank you so much!
If an attack affects multiple cparams is it possible to make all affected numbers appear? At the moment it seems to only show the first affected cparam.
 

ICF-Soft

Veteran
Veteran
Joined
Aug 15, 2015
Messages
254
Reaction score
123
First Language
Spanish
Primarily Uses
RMMV
@Bertrand
You can use something like:
<CUSTOM PARAM BASE mhp>
value = 79 + Math.pow(level, 1.92);
<CUSTOM PARAM BASE mmp>
value = 30 + Math.pow(level, 1) * 3;
</CUSTOM PARAM BASE>

@Destra47
Currently not. MV by default only shows one thing but shows all in battle log.
 

Bertrand

Villager
Member
Joined
Feb 22, 2017
Messages
11
Reaction score
1
First Language
Francais
Primarily Uses
Other
Thank you very much
 

Bertrand

Villager
Member
Joined
Feb 22, 2017
Messages
11
Reaction score
1
First Language
Francais
Primarily Uses
Other
Finally it doesn't work, I don't know what I'm doing wrong.

Class.PNG

Ordre.PNG

mhp.PNG
 

Attachments

Destra47

Veteran
Veteran
Joined
Jul 14, 2020
Messages
35
Reaction score
15
First Language
English
Primarily Uses
RMMV
@Destra47
Currently not. MV by default only shows one thing but shows all in battle log.
Is it possible to call the actual code that the RECOVER CPARAM notetag triggers?
Yanfly's action sequences seems to allow an "eval" command. So in theory if I use that to call each cparam recovery then wait a few frames it should display them all.
 

Matrien

Villager
Member
Joined
Aug 23, 2020
Messages
7
Reaction score
1
First Language
English
Primarily Uses
RMMV
I saw the bug but the solution is a bit different. This bug only affects obj.customNParam and obj.customCParam because I forget a step that allow the use of higher indexes.
I'll prepare version 1.09c
I installed version 1.09c and I still have the same problem with it ignoring the custom nparam base notetags for any beyond the first 30, unless I manually add additional '' to the obj.customNParam array. Just to be sure, I also created a fresh project with only this and your main utility plugin (v1.05b) and got the same result.
 

ICF-Soft

Veteran
Veteran
Joined
Aug 15, 2015
Messages
254
Reaction score
123
First Language
Spanish
Primarily Uses
RMMV
@Bertrand
It must be:
value = 79 + Math.pow(this.level, 1.92);
I forgot to add "this.level" to it. Sorry.

@Destra47
Yes. It should.
If as example you made a cparam called stm you can use gainStm(value) to do it.

@Matrien
Then is better to use that provisional solution.
I personally preffer to avoid these type of solutions because if for some reason I want to change max number of NParams to 1000 it wouldn't be a clean solution.
I'll find a way to use array vertatility correctly.
 

Matrien

Villager
Member
Joined
Aug 23, 2020
Messages
7
Reaction score
1
First Language
English
Primarily Uses
RMMV
Then is better to use that provisional solution.
I personally preffer to avoid these type of solutions because if for some reason I want to change max number of NParams to 1000 it wouldn't be a clean solution.
I'll find a way to use array vertatility correctly.
I went ahead and tried some more troubleshooting because I am trying to learn javascript and thought working this out might help.

I am still not certain how to fix the problem, but I think I found the location of the current bug, or at least am headed in the right direction. Playing around with the code, I found that a line you added to 1.09c (obj.customNParam[nIndex] = ''; ) seemed to fix the issue with correctly building the obj.customNParam array, which led me to wonder if there is a second problem where the data in the array is being utilized.

Under your Game_Actor.prototype.NParamBase function, there are two if statements (the first one for $dataActors and the second for $dataClasses), with try statements to return the values from obj.customNParam for each nparam if they are valid. I found that for whichever of these two if statements runs first, all values from that section are added properly, while for whichever of the if statements runs second, only values in that section for the first 30 nparams are added properly.
So, in my project I have the custom nparam base notetags in the classes section, and with v1.09, they still only work for my first 30 nparams, but if I move the notetags to the actors section, they all work. When I change your code so that the if statement for $dataClasses runs first, and the one for $dataActors runs second, the opposite is true, with notetags only working for the first 30 nparams if they are in the actors section, but all of them working if they are in the classes section.

I hope this is helpful and fairly clear. I am getting pretty tired so I am not sure if I explained things very well...
 

ICF-Soft

Veteran
Veteran
Joined
Aug 15, 2015
Messages
254
Reaction score
123
First Language
Spanish
Primarily Uses
RMMV
@Matrien
I'm not sure where is the problem but it works with an order.

First it chechs for actor's custom value. If found it it ends returning a value.
If not it chechs for actor's class custom value. If found it it ends returning a value.
Then tries with actor's base value, actor's class base value and finally default value.

If you use both actor's custom value and actor's class custom value it will use first one and ignore second.
 

Matrien

Villager
Member
Joined
Aug 23, 2020
Messages
7
Reaction score
1
First Language
English
Primarily Uses
RMMV
@ICF-Soft

Yeah, between being new to javascript/coding and pretty tired by the time I got to that point last night, I forgot that functions stop running code after a return statement, which made things seem pretty confusing... After sleeping and thinking on it a bit at work I came up with a pretty good idea of what was happening, and eventually made it home and confirmed. The problem seems to be resolved by adding a null check to the if statements in your prototype functions for nparams and cparams.

For example:
Line 4706 under Game_Actor.prototype.NParamBase would be updated to:
if ($dataActors[this._actorId].customNParam[paramId] != '' && $dataActors[this._actorId].customNParam[paramId] != null) {

In v1.09c, the Game_Actor.prototype.NParamBase function is run for each nparam id, checking if a value exists in the relevant obj.customNParam array at the corresponding index. The if statements for $dataActors and $dataclasses (and similar for enemies) filter out cases where the array element = '', but they allow cases where the array element = null, which includes all cases where the nparam id > 30 and no custom base notetag exists. The try statement does not catch these cases either, because the first line declares var value = 0 before trying to get the value from the array, which makes return value; a valid line even when the array element's value is null. Because of this, Game_Actor.prototype.NParamBase runs the code under the if statement for $dataActors for all nparams with an id > 30 (those that have null values in the obj.customNParam array), and is only capable of running the code under the if statement for $dataClasses for nparams with an id of <= 30.

By adding a null check, the if statements filter out cases where the corresponding obj.customNParam element equals '' or null, allowing the function to properly move past the if statement for $dataActors if there is no relevant notetag in the actor section, and check the if statement for $dataClasses as intended. I also doubt this addition is likely to create any new bugs.

Removing the line var value = 0; from the try statements also seems to resolve the issue, since that makes the line return value; invalid when the array element is null, but I believe this may result in value becoming a global variable, which is generally undesirable, so adding the null check to the if statement seems like a safer fix to me.
 

Andyest

Villager
Member
Joined
Jul 7, 2020
Messages
12
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMV
Hi.
How can I use set'Param'Base(n) for an specific character? For example: I have an warrior, and every time he changes to mage, he gains the params of the mage, lets say, <NPARAM: row 75 4 2 1000>.
BUT if the mage has the skill "magic plus" (idk), it calls setMagBase(100). I tryed put it in a skill, with a common event, to use in him, but didin't work.
Thanks in advance. :)


EDIT: I know EXACTLY how to do that. I was just tired. Ignore it and thanks. xD

EDIT2: Ok, I have a new question:

I put this in a class:


<CUSTOM NPARAM BASE mak>
if ($gameActors.actor(1).isLearnedSkill(29)) {
value = base;
value += 25;
};
</CUSTOM NPARAM BASE>

But it don't recognize "base" nor "mak" as a value/variable.

What I want is to gain a bonus in a stat if a have a skill. The base changes with the class, but the bonus persists, so a mage have mak=100+(2*level) and a warrior mak=25+(1*level). But if the character have the skill 29, then it becomes mak=100+(2*level)+25 if he is a mage OR mak=25+(2*level)+25 in case being a warrior. The thing is that I want that each character have a bonus byself. So If Harold is a mage with the skill 29 he have: mak=100+(2*level)+25+5. But If Lucy is a mage with the skill 29 he have: mak=100+(2*level)+25+15.
(mak=base+grow+skill+charbonus)

EDIT 3:
Ok, só a created a NParam called vit for the character and another called res for the class. And the res Base eval is this.vit*8. But it give me a Nan result for res. What could it be?

EDIT4: I did It! Thank you! HAHAHA
 
Last edited:

Andyest

Villager
Member
Joined
Jul 7, 2020
Messages
12
Reaction score
0
First Language
Portuguese
Primarily Uses
RMMV
I will double post because my previous post was becomming stupid. lol

So, I created a NParam (vtt) whose value will be given by the character. Then I created another NParam (res), wich uses "this.vtt * 8" as eval formula. Then, in the class I put:
<NPARAMPLUS: res 100>
It worked once. But when I tried again, It gave me an error.

I created another project and tried again, and it happened again.
Maybe its a bug? Or am I doing something wrong?

EDIT: the error persists even if I delete all the notetags and even deleting the nparams on the pluggin.
 

Attachments

Last edited:

RK DracoRoy

Fire Emblem RPG Gamer
Veteran
Joined
Jun 29, 2017
Messages
258
Reaction score
73
First Language
English
Primarily Uses
RMMV
@ICF-Soft Besides the suggestion about supporting XParams in the weapons / states notetags, I have a problem.

I'm using your Params Core and it plays nice with Hime's enemy class and enemy equips. Enemies can access custom stats through a class no problem.

Enemy Class: Enemy Classes MV – 姫HimeWorks

Enemies can read this in their class:

Code:
<Custom NParam Base x>
value = 75;
</Custom Param Base>
But if it's a base parameter, enemies can't read it in their class:

Code:
<Custom Param Base atk>
value = 75;
</Custom Param Base>
There's no crash or conflict. They can't read this notetag if it's a base param in their class.
------------
Edit
------------
Actually, I'll disregard the problem. Placing Hime's plugin over your plugin solved the problem. Sorry about that!
 
Last edited:

Users Who Are Viewing This Thread (Users: 1, Guests: 1)

Latest Threads

Latest Posts

Latest Profile Posts

SF_Monster3,4 added!


My only regret is the portal mirror effect is too subtle to show up in these GIFs. It probably just needs more sparkles. :LZSwink:
Microsoft: Hey, let's waste money advertising the Xbox Series X when nobody has any in stock, we don't seem to be making more, we aren't taking preorders and you can't get on a waiting list. BEST. IDEA. EVER.
So I'm practicing ITC with a spirit box, and decide to try to contact my deceased soulmate. It actually gave me multiple identifiers. Me, still a bit skeptical, asked aloud "Fine but does he still love me?" and the box spoke and printed the word "Forever" at the same time. Been a mess of tears since. :kaocry:
Been scratching away at my game and making progress, but just had a revelation. I'm working in full screen and adjusting all my pictures accordingly, but will they resize if someone's screen is smaller?? I hope this doesn't turn out to be a problem later.

Forum statistics

Threads
105,641
Messages
1,015,218
Members
137,312
Latest member
Summer_L7
Top