- Joined
- Jan 26, 2017
- Messages
- 608
- Reaction score
- 1,443
- First Language
- English
- Primarily Uses
- RMMZ
I have variables that are used to store arrays of numbers.
I want to be able to push new values onto those arrays (and splice them out when no longer needed).
Currently I'm using the method below to push the value of variable 16 onto the array variable 15:
var tempArray = $gameVariables.value(15) || [];
tempArray.push($gameVariables.value(16));
$gameVariables.setValue(15, tempArray);
I'm wondering if there's a more direct way to do this (without a temporary variable).
Thanks!
I want to be able to push new values onto those arrays (and splice them out when no longer needed).
Currently I'm using the method below to push the value of variable 16 onto the array variable 15:
var tempArray = $gameVariables.value(15) || [];
tempArray.push($gameVariables.value(16));
$gameVariables.setValue(15, tempArray);
I'm wondering if there's a more direct way to do this (without a temporary variable).
Thanks!
Last edited: