Status
Not open for further replies.

Goddiga

Veteran
Veteran
Joined
Oct 3, 2015
Messages
61
Reaction score
10
First Language
Thai
Primarily Uses
RMMV
Hello! I was wondering if changing the parameters in the plugins command is possible?
I'll provide an example of "SumRndmDde's Picture Choice" plugin here http://sumrndm.site/picture-choices/

21dmz52.png


I want to know if it is possible to change the value within the red box via script call? Maybe I want to try making a separate picture choice with each having different Max Scale or something.

Thank you very much!
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,147
Reaction score
10,711
First Language
Czech
Primarily Uses
RMMV
Hello! I was wondering if changing the parameters in the plugins command is possible?
Changing plugin parameters would be possible only if it was defined. There is no such thing though, however you can change the values of the variables these things are stored in.
In this particular case it is
_.min
_.max
_.speed
_.confirm
_.close
Set these to whatever you want through script command.
 

Goddiga

Veteran
Veteran
Joined
Oct 3, 2015
Messages
61
Reaction score
10
First Language
Thai
Primarily Uses
RMMV
Changing plugin parameters would be possible only if it was defined. There is no such thing though, however you can change the values of the variables these things are stored in.
In this particular case it is
_.min
_.max
_.speed
_.confirm
_.close
Set these to whatever you want through script command.

Thank you for your help! By the ways, are you suggesting me to rewrite something like...
_.max = parseFloat(params['Max Scale']); to _.max = $gameVariables.setValue(var, value) or whatever

or

_.max = parseFloat(params['Max Scale']); to $gameVariables.setValue(var, value) = parseFloat(params['Max Scale']);

I tried both but it didn't work.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,147
Reaction score
10,711
First Language
Czech
Primarily Uses
RMMV
No wonder it doesn't work.
$gameVariables.setValue is a function that sets a variable x to value y. It has no return command, so saying _min = $gameVariables.setValue (x,y) will throw you nothing at all.
You could do $gameVariables.setValue (x,y) and on a new line _min = $gameVariables.value (x). But assigning setValue a non-returning function to a variable is useless.
Or you can just do
_min = 0.8

Wouldn't be a bad idea to learn some javascript :p
 

Shaz

Global Moderators
Global Mod
Joined
Mar 2, 2012
Messages
43,682
Reaction score
15,293
First Language
English
Primarily Uses
RMMV
Have you thought about the issues with this?

If you change the parameters of a plugin via a script call, that doesn't mean those parameters are going to be used - most plugins read the parameters when the game is loaded and not again. So you'd be modifying them after they've been used.

If the plugin reads the parameters into a variable and you change the variable, save and close the game, then open the game again, they're going to be back to their original values, as the variables don't get saved.

If you change the variables then start a new game, or load a saved game, those variables will remain at what you changed them to - it would be difficult to leave them as the original values for all games up to a certain point, and then change them to new values after that point, so any one game will have them set correctly based on whether that point has been reached or not.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,147
Reaction score
10,711
First Language
Czech
Primarily Uses
RMMV
There are no issues if you do it through changing the variable only. These parameters are used in a function whenever it is called, so you can feel the change.

Of course if you changed the file's params saved in plugins.js, that would mean issues.

EDIT: Ah yes, that is true, if you reload the game, you have to remake the changes. But if you make a change right in front of what you want to call, then no issues.
 

Goddiga

Veteran
Veteran
Joined
Oct 3, 2015
Messages
61
Reaction score
10
First Language
Thai
Primarily Uses
RMMV
Oh! I forgot to mention about how it didn't work. When I used _.min = xxx via script call, I just got the message that said "_ is not defined"
And that applied to the new method you suggested as well.
 

Poryg

Dark Lord of the Castle of Javascreeps
Veteran
Joined
Mar 23, 2017
Messages
4,147
Reaction score
10,711
First Language
Czech
Primarily Uses
RMMV
Oh my bad :D I overlooked something.

It is inside an anonymous function. So these variables aren't defined outside of it. So it looks like without any changes to the code it won't be possible.
However, it shouldn't be too difficult to tinker with it.
You can try to replace
Code:
(function(_) {
   
"use strict";

var params = PluginManager.parameters('SRD_PictureChoices');

//-----------------------------------------------------------------------------
// SRD.PictureChoices
//-----------------------------------------------------------------------------

_.min = parseFloat(params['Min Scale']);
_.max = parseFloat(params['Max Scale']);
_.speed = parseFloat(params['Scaling Speed']);
_.confirm = parseFloat(params['Confirm Speed']);
_.close = parseFloat(params['Close Speed']);

with
Code:
srdPC = 0;
(function(_) {
   
"use strict";

var params = PluginManager.parameters('SRD_PictureChoices');

//-----------------------------------------------------------------------------
// SRD.PictureChoices
//-----------------------------------------------------------------------------

srdPC.min = parseFloat(params['Min Scale']);
srdPC.max = parseFloat(params['Max Scale']);
srdPC.speed = parseFloat(params['Scaling Speed']);
srdPC.confirm = parseFloat(params['Confirm Speed']);
srdPC.close = parseFloat(params['Close Speed']);
and replace the _.min, _.max etc. with srdPC.min, srdPC.max etc.
Use on your own danger, I'm not sure what kinds of bugs will this create. However, since srdPC is defined as a global variable, it should reduce risks of creating bugs that are impossible to deal with to a minimum due to accessibility from anywhere, even the script field.
 

Goddiga

Veteran
Veteran
Joined
Oct 3, 2015
Messages
61
Reaction score
10
First Language
Thai
Primarily Uses
RMMV
Oh my bad :D I overlooked something.

It is inside an anonymous function. So these variables aren't defined outside of it. So it looks like without any changes to the code it won't be possible.
However, it shouldn't be too difficult to tinker with it.
You can try to replace
Code:
(function(_) {
  
"use strict";

var params = PluginManager.parameters('SRD_PictureChoices');

//-----------------------------------------------------------------------------
// SRD.PictureChoices
//-----------------------------------------------------------------------------

_.min = parseFloat(params['Min Scale']);
_.max = parseFloat(params['Max Scale']);
_.speed = parseFloat(params['Scaling Speed']);
_.confirm = parseFloat(params['Confirm Speed']);
_.close = parseFloat(params['Close Speed']);

with
Code:
srdPC = 0;
(function(_) {
  
"use strict";

var params = PluginManager.parameters('SRD_PictureChoices');

//-----------------------------------------------------------------------------
// SRD.PictureChoices
//-----------------------------------------------------------------------------

srdPC.min = parseFloat(params['Min Scale']);
srdPC.max = parseFloat(params['Max Scale']);
srdPC.speed = parseFloat(params['Scaling Speed']);
srdPC.confirm = parseFloat(params['Confirm Speed']);
srdPC.close = parseFloat(params['Close Speed']);
and replace the _.min, _.max etc. with srdPC.min, srdPC.max etc.
Use on your own danger, I'm not sure what kinds of bugs will this create. However, since srdPC is defined as a global variable, it should reduce risks of creating bugs that are impossible to deal with to a minimum due to accessibility from anywhere, even the script field.

Thank you very much for pointing this out! But, srdPC didn't work for some reason. It is still not defined. However, it guided me to blindly try to change the _ and srdPC to something else. And it just accidentally worked with SRD.PictureChoices.xxx (I just guessed it since it is the full name of your srdPC and I just saw the name below var params = PluginManager.parameters('SRD_PictureChoices');)

Thank you again for your help!
 
Status
Not open for further replies.

Latest Threads

Latest Posts

Latest Profile Posts

I typically ask this on my normal social media channels, but figured there may be good replies here. Anyone got any good horror movie recommendations? I've seen a lot, but I always love getting suggestions! Bonus points if you know which service it is streaming on (in the US) - bring on the spOoooOky!
 After a few distractions (and my annual rough second week of October), I’m getting back on track with my OMGC project.
 Am I overcomplicating it? Yes. Am I going to tone it down? Almost certainly not.
 At least the dialogue stuff is almost done. I need to do the map itself, and then all that’s left is combat.
 Getting there!
Creating 3D CGs for Cutscenes. :kaosalute:

I keep wanting to post every song I make for the game and have to hold back on that because at this rate, I'll have spoiled all the really good stuff lol..
DerniBorges wrote on TSR's profile.
Is there any way this plugin works with the big character, and the QSprite plugin? Using RTP chars, everything works fine, but the big ones, with QSprite, it's like that in the image, it doesn't reflect right. And there is, in the settings, an option to fix it. Thanks.
bug2.png

Forum statistics

Threads
115,902
Messages
1,093,829
Members
151,148
Latest member
Anonymateds
Top