- Joined
- Oct 3, 2015
- Messages
- 31
- Reaction score
- 10
- First Language
- English
- Primarily Uses
- RMMZ
I'm working on making a custom battle system that uses character friendship points to determine various mechanics. I'm currently having trouble efficiently tracking these friendship stats between characters. The game I'm working on is planned to have tons of playable characters, much like Chrono Cross or Suikoden, so right now I'm at ~55 playable characters.
My initial plan was to create a variable for each character's relation to each other (i.e. Character 1 & Character 2's relation, Character 2 & Character 3, Character 2 & Character 3, etc.). However, I realized that to do this with such a large cast of characters, that would require over 1,000 different variables to track this data. I know RPG Maker limits to 5,000 variables, so while it's doable, it still would require a ton of variables to keep track of for this one mechanic.
I've been looking into using arrays, as that seems like it could be the best solution, but I'm stumped on how to go this route, since I'm still a beginner when it comes to JavaScript and programming in general.
Here's what I'm thinking so far:
This array variable will track the playable character names (5 names in there currently):
Then, this is where I'm stumped. I was thinking I could make a single variable for each character, and store multiple values within that variable (according to the original order of the characters), and track their friendship levels in there. But I honestly am not too sure if that's possible.
This is where I'm at with this part, in printing the name of that value (the second name in this case) within an array, but not sure where to move next:
So if anyone has any ideas on this, that would be super helpful. Thanks!
My initial plan was to create a variable for each character's relation to each other (i.e. Character 1 & Character 2's relation, Character 2 & Character 3, Character 2 & Character 3, etc.). However, I realized that to do this with such a large cast of characters, that would require over 1,000 different variables to track this data. I know RPG Maker limits to 5,000 variables, so while it's doable, it still would require a ton of variables to keep track of for this one mechanic.
I've been looking into using arrays, as that seems like it could be the best solution, but I'm stumped on how to go this route, since I'm still a beginner when it comes to JavaScript and programming in general.
Here's what I'm thinking so far:
This array variable will track the playable character names (5 names in there currently):
JavaScript:
$gameVariables.setValue(61, ["Gair", "Pubby", "Ralphie", "Zandra", "Scott"]);
Then, this is where I'm stumped. I was thinking I could make a single variable for each character, and store multiple values within that variable (according to the original order of the characters), and track their friendship levels in there. But I honestly am not too sure if that's possible.
This is where I'm at with this part, in printing the name of that value (the second name in this case) within an array, but not sure where to move next:
JavaScript:
$gameVariables.setValue(62, $gameVariables.value(61)[1]);
So if anyone has any ideas on this, that would be super helpful. Thanks!