Change a value in a script while playing (RMVXAce)

Hi people! I have a question, but I really doubt it can be done...


For my explanation, here's a small portion of code from the CSCA Achievements script for RMVXAce.


NUMBERED = false # If true, numbers achieve list. If false, uses icons.
CENTER = true # Center the description text ? True/false
STOP_TRACK = true # Stop tracking achievement progress after earned?

COLOR1 = 20 # Color1 of the progress gauge.
COLOR2 = 21 # Color2 of the progress gauge.

SOUND = "Applause1" # SE Played when an achievement is earned. Set to nil to disable.


Is there a way, for example, I could with a script call change the "NUMBERED" value to true if I wish to in a save file? And it dosen't affect the other save files?


I'm asking this since scripts look like being the roots of the games, filled with static values that are the same no matter what file you're playing on.


Thanks for answers and have a good day! As always...
Not without rewriting the script.


If a value is defined as a public variable, then (and only then) there is a script command that can change the value.


If a value is defined as a CONSTANT, then nothing short of a rewrite can change the value.


And I capitalized not to shout, but because by common convention all constants use capital letters in scripts to make them visible as such.


That said, it is a simple copy&replace for any halfway-competent scripter to change a constant into a variable (or better into a game_variable reference number) as long as he is familiar with the script. But changing other scripter's work is usually done only if that other scripter gives licence to change his scripts - not all do, and I don't know if that is the case for CSCA - especially as CSCA requires a paid licence for commercial work when I last checked.
Maybe try writing in a script call, in an event


CSCA::ACHIEVEMENTS::SOUND = "other sound"


To change something? I'm not sure if this will work, though.


To my knowledge, "constants" CAN be changed without modifying the script (they are technically variables, after all), you just have to reference the class/module/etc then the variable name.


edit: yeah, the method should work.

Spoiler
image.jpeg
That said, it is a simple copy&replace for any halfway-competent scripter to change a constant into a variable (or better into a game_variable reference number) as long as he is familiar with the script. But changing other scripter's work is usually done only if that other scripter gives licence to change his scripts - not all do, and I don't know if that is the case for CSCA - especially as CSCA requires a paid licence for commercial work when I last checked.



I was actually taking a random script for the example. ^^

If a value is defined as a public variable, then (and only then) there is a script command that can change the value.


If a value is defined as a CONSTANT, then nothing short of a rewrite can change the value.



And this... I don't really see the difference between public variable and CONSTANT, since I'm bad at scripting. 
"Public variable" is a thing that is accessible by any script, outside of the script. For example, many scripters have the public variable "imported" to tell other scripters that this person has a certain script installed.


"CONSTANT" is something used within a script to allow user modification. They cannot be accessed outside of the script they're in (most of the time). They can be modified externally if they're in a module, though, in which case you would write


Module_Name::CONSTANT = some value


to change it externally. If the variable is inside multiple modules, just do this:

Code:
Outermost_Module::Next_Module::The_Module_After_That(etc)::CONSTANT = somevalue
GREAT STUFF! Now I get it. Thanks!


Topic can be closed now.

Original thread: https://forums.rpgmakerweb.com/threads/change-a-value-in-a-script-while-playing-rmvxace.58573/