@ShadowDragon Thanks for the info. I didn't realize you could nest any generic variable into the script like that, but it makes sense, and I see now how one can use variables to do that.
That gives me another question, though:
Would there be a way to use Javascript to make the event calculate a percentage of the player's current size? Instead of "shrinking the player by 0.1," I'd rather implement something like "shrinking the player by 10% of their current size," which I think would require some Javascript evaluations.
Basically, the logic would be:
1. set a variable where 100 = normal size, since RPGMV likes to work with integers and I need some wiggle room for multiplication (so probably $gameVariables.value(x)/100, right? so that 100/100 = 1?)
2. some event happens in the game world (such as a timer), triggering the shrink event (these I know how to do)
3. the shrink event takes that variable and multiplies it by 0.9 and rounds to an integer (this is the part I don't know how to do -- I'm not sure what the syntax is to have the system evaluate this)
4. the shrink event then evaluates ($gameVariables.value(x)/100) again and sets the SpriteZoom level to that (this is what I just learned how to do, thanks to you!)
Is that about correct?
If you know of any resource to look at that teaches all the JavaScript syntax relevant to RPGMV, also, that would be a great help.
That gives me another question, though:
Would there be a way to use Javascript to make the event calculate a percentage of the player's current size? Instead of "shrinking the player by 0.1," I'd rather implement something like "shrinking the player by 10% of their current size," which I think would require some Javascript evaluations.
Basically, the logic would be:
1. set a variable where 100 = normal size, since RPGMV likes to work with integers and I need some wiggle room for multiplication (so probably $gameVariables.value(x)/100, right? so that 100/100 = 1?)
2. some event happens in the game world (such as a timer), triggering the shrink event (these I know how to do)
3. the shrink event takes that variable and multiplies it by 0.9 and rounds to an integer (this is the part I don't know how to do -- I'm not sure what the syntax is to have the system evaluate this)
4. the shrink event then evaluates ($gameVariables.value(x)/100) again and sets the SpriteZoom level to that (this is what I just learned how to do, thanks to you!)
Is that about correct?
If you know of any resource to look at that teaches all the JavaScript syntax relevant to RPGMV, also, that would be a great help.