RPG Maker Forums

Hi guys. This will be my first post to Learning Javascript. I think this goes here and not in Maker Specific/RM MV because I'm asking about things dealing with the underlying code and using script calls. Please let me know if I have it in the wrong place!

My question(s) deal with attempting to use a meta value as a variable. I've been watching SoulPour777's awesome JS tutorials and I'm excited to see how easy adding a meta value is. I'd like to be able to use meta values to create variables for actors.

I realize it is easier to implement using $gameVariables, but this has several drawbacks, the most important to me being that if I'm not sure how many actors I'll have when starting out the project or I change my mind on the number, I will wind up either with a bunch of wasted spaces in unused variables, have to reorder my variables (which could be a major pain), or have the variables out of order. I also realize there are plugins that effectively solve the overarching goal, but I'm trying to learn more about JS and how the game code works, and I find it informative to try to find alternate solutions by using the script.

So question #1 is, is it possible to vary the value of a meta key during the game?

I've attempted to solve this myself by calling up "Number($dataActors[n].meta.keyName)" in an event>script and modifying the value. It works great!...right up until you save the game and load it, at which point the meta value reverts to the default in the database.

Question #2 stems from this. I think that I've come to understand that the JSON files are just there to give templates for the game objects, and the actual in-game values are stored elsewhere. For example, the actors' active stats are actually stored in $gameActors and it's only their initialize templates that are stored in $dataActors. I'd like to verify if I have this right, because I'd hate to proceed with false information on something this basic.

Going back to Q#1, I've tried to call up the meta value using $gameActors, $gameActor, and $gameParty...at best(?) I can get to a TypeError "Cannot read property 'keyName' of undefined" (when using "alert($gameParty._actors[1].meta.keyName);") and at worst I run into "undefined is not a function" errors because apparently I'm not clear on how to call actors. Is it just Not Possible to change the value of meta without first storing it as a gameVariable or creating a plugin? Or do I just need to learn more about how to call up an actor's current information?

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,476
Members
137,824
Latest member
dobratemporal
Top