It makes sense once I sit back and think about it, but it's kind of weird that if you add 1 to both of the array values, and then you can immediately call those same array values and it will display the proper amount. But then if you call something that's supposed to add those together, it's like it doesn't care that you just updated the two values, it still stores the amounts of the older values at zero until you force it to look again. If there was some way to ask it to run that addition based on the newest updates to the code, that'd be great. But in learning that I need another function to do that, I can actually update a whole bunch of different things in that one function and then return or echo whatever it is I need... thus, saving me even more work. It's pretty cool when a mistake that would require a work-around results in something that will actually SAVE time later on rather than require more.
And basically what I'm doing is I'm making something similar to a sports simulation based on a ton of different factors, random number generators and accuracy to real life. While building I'm simply going through ways to optimize the code and make it easier to go back and modify it if need be. It's something I'm really doing as an experiment - I'm not getting paid, nor is it going to be implemented anywhere as far as I can tell. I'm just seeing what kind of situations can come up when you're coding and how to get around them while optimizing it as much as possible.
With the layout that I'm using there's a TON of array values that will need to be updated and called over and over and over by several different methods and classes (in total I'd estimate there's about 20 arrays, each with anywhere from 10 to 30 elements each.. you'd be surprised how many unique stats you have to keep for one silly sports game). The alternative to the way I'm setting it up would be to have one page house all of the code, or classes constantly calling one another and making additional functions to update each classes' variables (since you couldn't update a variable from one class from another class' method), and I assure you it'd be like 3000 lines of code once it's all done. I want to make separate files to each do their specific job while calling back and forth to one another as needed without making one giant file (and updating that giant file would be a pain because I'd have to scan through all of the code a million times and make sure everything was correct).
Anyway - just trying to gain some experience. It's nice that I have something like this forum to fall back on when I get into a state of confusion because of the complexity of the code. No better way to learn than by experience, right?
Thanks.