Eli Custom Parameters - Add new parameters to actors and enemies!

Thanks for your work

Can you tell me how I can put a value directly in a actor no HP/MP custom stats using script call ?

i tried this but do not work :

$gameActors.actor(0001).setCustomHpParam(30, 1)

the only thing i can do is

$gameActors.actor(0001).addCParam(30, +1)
$gameActors.actor(0001).addCParam(30, -1)

which adds or subtracts 1 but I want to be able to put a value, something like that :
" $gameActors.actor(0001).cparam(30) = 15 "

Can you help me please ?
Hi @OvErMiNd !

Yeah, you can use this script call:

$gameActors.actor(ACTORID )._ShortParamName = value

ACTORID = Replace with the actor id you want. If the id is 1, don't use "0001". Use only "1".
ShortParamName = Replace with the short param name defined on the plugin parameter.
Value = Replace with the value you want.

Example:
$gameActors.actor(1)._crm = 15

I will implement another script call to do that in the next updates. But the above will also work.
Sorry it doesn't seem to work, this is what i do :

Capture.JPG

Capture2.JPG

Capture3.JPG

result = 0 while there should be written 69
maybe I'm making a mistake somewhere ?
Sorry it doesn't seem to work, this is what i do :

View attachment 199089
View attachment 199090
View attachment 199091
result = 0 while there should be written 69
maybe I'm making a mistake somewhere ?
Ops, that was my bad. It will not work this way.
I believe the best way for you to do this is really using the script below:

$gameActors.actor(ACTORID).addCParam(PARAMID, VALUE)

So if the actor has a parameter Charme = 37
And you want to set it to 50, you can do some math to add a value for this parameter, using the following script call:

JavaScript:
let currentValue = $gameActors.actor(1).char
let targetValue = 50
let finalValue = targetValue - currentValue

$gameActors.actor(ActorId).addCParam(ParamId, finalValue)
It works this way, thank you very much !

hope you will add an easier method in the next update :LZSangel:
Version 2.0.0 - 08/18/2021
  • Add a plugin parameter to be used as a template to set custom parameter values for classes, armors, weapons or enemies, if you want to optionally avoid the use of the note field.
  • Add a script call to set(instead of add or remove) a value to the custom parameters:
    battler.setCustomParam(paramId/shortName, value)
  • Help file changes.
  • Need Eli Book 4.0.0 now.
@OvErMiNd I have added the script call you asked for!

Now you can use:
$gameActors.actor(ActorId).setCustomParam(ParamId, TargetValue)
You are the best ! Thank you :XP1:
Version 5.0.0 is not compatible with my plugins that are below the 5.0.0 versions.

Version 5.0.1 - 02/08/2022

  • Fixed a bug on the name of a plugin parameter.
Version 5.0.0 - 02/05/2022
  • Updated terms of use.
Hey, I tried using your plugin but whenever I start the game I get an error:

TypeError
Cannot read property 'createParameters' of undefined

Do you have any idea how to fix this? I'm using the latest 5.0.1 MZ version.

Edit: Never mind, I am dumb 😛 It requires the base plugin EliMZ_Book! Might be worth adding to the OP, then again maybe most people are already aware of the dependency message in the plugin manager...

Edit2: I just can't seem to get the Hp functions to work at all. Keep getting the error "TypeError: Cannot read property 'isHp' of undefined".

I've created a Stamina property (sp) and can access and modify 'sp' but not 'maxsp'.

Edit3: Okay I figured it out, for some reason the HP parameter is using the wrong ParamID. It appears that it doesn't actually register a new ParamID, but just attaches itself to the parameter above it in the list. Placing my HP parameter at the top of the list resolves the issue, and I can refer to it with ParamID '0' but I'm not sure if this would work if you have multiple custom HP type parameters as they might all just register to 0. Alternatively, you could put in an empty custom parameter above any HP ones you have.
Hey, I tried using your plugin but whenever I start the game I get an error:

TypeError
Cannot read property 'createParameters' of undefined

Do you have any idea how to fix this? I'm using the latest 5.0.1 MZ version.

Edit: Never mind, I am dumb 😛 It requires the base plugin EliMZ_Book! Might be worth adding to the OP, then again maybe most people are already aware of the dependency message in the plugin manager...

Edit2: I just can't seem to get the Hp functions to work at all. Keep getting the error "TypeError: Cannot read property 'isHp' of undefined".

I've created a Stamina property (sp) and can access and modify 'sp' but not 'maxsp'.

Edit3: Okay I figured it out, for some reason the HP parameter is using the wrong ParamID. It appears that it doesn't actually register a new ParamID, but just attaches itself to the parameter above it in the list. Placing my HP parameter at the top of the list resolves the issue, and I can refer to it with ParamID '0' but I'm not sure if this would work if you have multiple custom HP type parameters as they might all just register to 0. Alternatively, you could put in an empty custom parameter above any HP ones you have.
Hi there!
Nice you manage to make it work!
But let's see this HP param type issue. Can you show me a screenshot of your plugin parameters?

[EDIT] I will make some tests, but I'm pretty sure that this works as intended. The first parameter on the list, has ID =0.
The second parameter on the list, has ID = 1. ETC...

I also will take a look about accessing and changing the max sp value you talked about. Unfortunately, I will only be able to see this on Thursday.
Hi there!
Nice you manage to make it work!
But let's see this HP param type issue. Can you show me a screenshot of your plugin parameters?
Sure!

Spoiler: This is it working (HP as paramID 0)
1644702164020.png

1644702625254.png

1644702650974.png

Spoiler: If I move it to anywhere else this the result
1644702310113.png

1644702474503.png

1644702509083.png

1644702533428.png

Hopefully I'm not doing something really stupid 😛
I have other plugins installed, but I've tried disabling them all with the same result.
Sure!

Spoiler: This is it working (HP as paramID 0)

Spoiler: If I move it to anywhere else this the result

Hopefully I'm not doing something really stupid 😛
I have other plugins installed, but I've tried disabling them all with the same result.
Thank you so much for this!
It was really helpful, and I manage to find the problem!

In your second example, you are using the ID 7 for the SP parameter.

But in fact, the right ID number for it is 6.

The error is happening because there is no custom parameter with ID 7.

Their ID always start at zero index.
In your first example, it is working fine because SP is the first on your parameter list. So it's ID is equal to zero (0).

But in your second example you have it at the end of the list.
Now the VIT parameter is the first one on your list, then he got the ID 0.

So, in the second example, if you change the script calls for Custom parameter to start at 0 from 5 and then put the SP parameter with ID 6 everything will work.

JavaScript is trick on that. The counting on indexes always start at zero:

0 = first element
1 = second element
Etc...

Alternatively(if I remember well), you can replace the ID parameter on the script calls(or in the plugin commands) with the custom parameter short name.
So, if you want to add 60 to the vitality.
$gameActors.actor(1).addCParam("vit", 60)
Thank you so much for this!
It was really helpful, and I manage to find the problem!

In your second example, you are using the ID 7 for the SP parameter.

But in fact, the right ID number for it is 6.

The error is happening because there is no custom parameter with ID 7.

Their ID always start at zero index.
In your first example, it is working fine because SP is the first on your parameter list. So it's ID is equal to zero (0).

But in your second example you have it at the end of the list.
Now the VIT parameter is the first one on your list, then he got the ID 0.

So, in the second example, if you change the script calls for Custom parameter to start at 0 from 5 and then put the SP parameter with ID 6 everything will work.

JavaScript is trick on that. The counting on indexes always start at zero:

0 = first element
1 = second element
Etc...

Alternatively(if I remember well), you can replace the ID parameter on the script calls(or in the plugin commands) with the custom parameter short name.
So, if you want to add 60 to the vitality.
$gameActors.actor(1).addCParam("vit", 60)
Hi, thanks for your reply! 🙂

I did consider if it were zero-based but if that's the case shouldn't the results in the second example be:
Vit: 0
End: 1
Str: 2
Dex: 3
Int: 4
Wis: 5
SP: 0
MaxSP: 6

Seeing as Vit would be ParamID 0 and param 0 was never set. I wasn't sure what the ParamIDs for each were, that's why I set them using the ID, then got the values using the short names.

Thank you so much for the tip on using the short name in addCParam(), I was putting the short name in without the quotes - this will make it much more readable!
Hi, thanks for your reply! 🙂

I did consider if it were zero-based but if that's the case shouldn't the results in the second example be:
Vit: 0
End: 1
Str: 2
Dex: 3
Int: 4
Wis: 5
SP: 0
MaxSP: 6

Seeing as Vit would be ParamID 0 and param 0 was never set. I wasn't sure what the ParamIDs for each were, that's why I set them using the ID, then got the values using the short names.

Thank you so much for the tip on using the short name in addCParam(), I was putting the short name in without the quotes - this will make it much more readable!
Hmm, I think I got what you are saying!

All the custom parameters belong to the same list(array) either them are HP-Type or not.
So In that second case, the list should be like that:

Vit: 0
End: 1
Str: 2
Dex: 3
Int: 4
Wis: 5
SP: 6
MaxSP: 6

The thing is SP and MaxSp have the same ID. The difference is that some script calls will use the ID to get/set the current value.
And some other script calls will use to get/set the max value.

But, to avoid being confused by that, you can always use the short name to reference their IDs.

I'm not in home, but when I get there I will write a better explanation for you and also update the help file with it. ^^
Version 5.0.0 is not compatible with my plugins that are below the 5.0.0 versions.

Version 5.0.1 - 02/08/2022

  • Fixed a bug on the name of a plugin parameter.
Version 5.0.0 - 02/05/2022
  • Updated terms of use.

Seems there is an issue with Eli.PluginManager.createParameters()

Code:
EliMZ_CustomParameters.js:391 Uncaught TypeError: Cannot read property 'createParameters' of undefined
    at Object.initParameters (EliMZ_CustomParameters.js:391)
    at Object.initialize (EliMZ_CustomParameters.js:384)
    at EliMZ_CustomParameters.js:616

I would assume it's a dependency issue that is not stated in the use instructions?

Code:
@target MZ
@base EliMZ_Book
@orderBefore EliMZ_ClassCurves
@orderAfter EliMZ_EnemyClass
Does this mean I need EliMZ_Book as a prerequisite?

edit:
Yep... It does.
It may help if you explicitly list that plugin as a required dependency in each plugin that requires it.

But I do tend to speak before I finish thinking, so... Maybe I'm the only idiot that will mention it. 😉
Seems there is an issue with Eli.PluginManager.createParameters()

Code:
EliMZ_CustomParameters.js:391 Uncaught TypeError: Cannot read property 'createParameters' of undefined
    at Object.initParameters (EliMZ_CustomParameters.js:391)
    at Object.initialize (EliMZ_CustomParameters.js:384)
    at EliMZ_CustomParameters.js:616

I would assume it's a dependency issue that is not stated in the use instructions?

Code:
@target MZ
@base EliMZ_Book
@orderBefore EliMZ_ClassCurves
@orderAfter EliMZ_EnemyClass
Does this mean I need EliMZ_Book as a prerequisite?
Hi there!
Yes, you will need EliMZ_Book for MZ.
And, Eli_Book for MV.

At least on RM MZ, if you do not have the EliMZ_Book, the plugin manager should send you a warning:
1647997854043.png


This text on the plugin is responsable for that:
@target MZ
@base EliMZ_Book
@orderBefore EliMZ_ClassCurves
@orderAfter EliMZ_EnemyClass


Each of them(base, before, and after) will throw you a different warning depending on how you set up the plugin manager.
Hi there!
Yes, you will need EliMZ_Book for MZ.
And, Eli_Book for MV.

Thanks for the clarification.

Sorry for the time it took for you to mention it, yet again - I'm sure.

That is not the way I expected to find the dependency. In my experience with other 'makers', plugin authors typically spell it out rather clearly in the 'use instructions' (aka: How to use) section of the plugin.

It's nice to see that there are many new ways to notify users. Even if they go initially unrecognized by the likes of me. I'll be sure to keep an eye out for those in the future.

Thanks again.


Edit:
If I still have your attention. You wouldn't know how to get the new parameters to play nicely with YEP_CoreEngine's Status menu?

If not, no biggie. I'll fumble my way through, or attempt to ask where more appropriate.
Thanks for the clarification.

Sorry for the time it took for you to mention it, yet again - I'm sure.

That is not the way I expected to find the dependency. In my experience with other 'makers', plugin authors typically spell it out rather clearly in the 'use instructions' (aka: How to use) section of the plugin.

It's nice to see that there are many new ways to notify users. Even if they go initially unrecognized by the likes of me. I'll be sure to keep an eye out for those in the future.

Thanks again.


Edit:
If I still have your attention. You wouldn't know how to get the new parameters to play nicely with YEP_CoreEngine's Status menu?

If not, no biggie. I'll fumble my way through, or attempt to ask where more appropriate.
Totally fine 🙂

Yeah, since the MZ implemented this feature, I'm using it for MZ plugins.
But I still want to implement an alert again, since I have to do it for MV versions anyway...

I already did manage to make them work together a long time ago(Not with Yep Core Engine, but with Yep Status Menu Core, something like that). If you tell me exactly what you want, maybe I can help you out.
Sorry...

There I go, not remembering I'm talking about MZ now... Not MV.

I meant to reference VisuMZ_0_CoreEngine's and VisuMZ_1_ElementStatusCore's built in Status Menu.

CoreEngine has a section to define custom Parameters, but it's only for reference, in relation to existing database params.

I thought I once saw a way to make params created outside this plugin, to be referenced by the Status Menu, here:

Spoiler: Length
Eli_CustomParams_AND_CoreEngine_StatusMenu_2.JPG


But they don't appear when added without defining them in Custom Parameters, and they create a recursive loop when defined, as they seem to require. (After creating them in your Plugin)

Eli_CustomParams_AND_CoreEngine_StatusMenu_2b.JPG


Eli_CustomParams_AND_CoreEngine_StatusMenu_2c.JPG


Code:
Drag_Debugger.js:152 RangeError: Maximum call stack size exceeded
    at Game_Actor.get (VisuMZ_0_CoreEngine.js:7758)
    at Game_Actor.eval (eval at VisuMZ.<computed>.<computed> (VisuMZ_0_CoreEngine.js:1), <anonymous>:7:13)
    at Game_Actor.get (VisuMZ_0_CoreEngine.js:7758)
    at Game_Actor.eval (eval at VisuMZ.<computed>.<computed> (VisuMZ_0_CoreEngine.js:1), <anonymous>:7:13)
    at Game_Actor.get (VisuMZ_0_CoreEngine.js:7758)
    at Game_Actor.eval (eval at VisuMZ.<computed>.<computed> (VisuMZ_0_CoreEngine.js:1), <anonymous>:7:13)
    at Game_Actor.get (VisuMZ_0_CoreEngine.js:7758)
    at Game_Actor.eval (eval at VisuMZ.<computed>.<computed> (VisuMZ_0_CoreEngine.js:1), <anonymous>:7:13)
    at Game_Actor.get (VisuMZ_0_CoreEngine.js:7758)
    at Game_Actor.eval (eval at VisuMZ.<computed>.<computed> (VisuMZ_0_CoreEngine.js:1), <anonymous>:7:13)

In MV I'd just troubleshoot it myself, and fix it. But all this Obfuscation on Visustella's plugins, have me a bit screwed there.
Edit:
If I still have your attention. You wouldn't know how to get the new parameters to play nicely with YEP_CoreEngine's Status menu?
I thought you are talking about MV because you said YEP_CoreEngine...
About Visustella, I have no idea.
As you showed to me through your screenshots, I would do exactly as you did. Put the short name of the custom params into their Abbreviation param and cross fingers to work.

Unfortunately, the console error you showed means almost nothing. A Maximum call stack size was exceeded. But why? where?
I guess that somehow, their plugin is checking for the custom parameters(which on my side, is a new property on Game_Actor). Maybe their plugin is overwriting this property and performing a check somehow.
Don't know, have no idea. that was a long shot, but it does mean nothing anyway since I can't take a look at the code and see it. In the end, is just a guess.

I believe if I manage to do it, I'm afraid I can "break" their terms of use:

Maybe you can ask them to take a look since I allow other developers to take a look and make patches on my plugins. But I already have told other users to do that, and these users always come back to me saying that they refused to make a patch. But who knows.

So, unfortunately, there is nothing I can do.
if you did manage to understand something on the Visustella end, like how things work, and want to talk about that with me, is totally fine. I will do what I can.

Original thread: https://forums.rpgmakerweb.com/threads/eli-custom-parameters-add-new-parameters-to-actors-and-enemies.136232/