So I have been tinkering with variables in RMXP and it hasn't exactly been easy. Most forums that helps with variable-related problems doesn't use RMXP. I have been trying to add the content of one variable to another variable.
I don't mean something like:
Var(3) = Var(1) + Var(2)
But something like:
Var(1) = [1, 2, 3] & Var(2) = [4, 5, 6]
Var(3) = [Var(1), Var(2)] = [1, 2, 3, 4, 5, 6]
When I try this my third variable becomes [123,456] instead. A forum on "Support/JavaScript Boards/Learning JavaScript" posted by Llareian was talking about this problem and came up with an solution. I tried to modify the solution for RMXP, but I don't seem to have the functions they use. Any suggestions are appreciated.
Solution for Llareian:
if ( !$gameVariables.value(15) ) { $gameVariables.setValue(15, []) };
$gameVariables.value(15).push( $gameVariables.value(16) );
I don't mean something like:
Var(3) = Var(1) + Var(2)
But something like:
Var(1) = [1, 2, 3] & Var(2) = [4, 5, 6]
Var(3) = [Var(1), Var(2)] = [1, 2, 3, 4, 5, 6]
When I try this my third variable becomes [123,456] instead. A forum on "Support/JavaScript Boards/Learning JavaScript" posted by Llareian was talking about this problem and came up with an solution. I tried to modify the solution for RMXP, but I don't seem to have the functions they use. Any suggestions are appreciated.
Solution for Llareian:
if ( !$gameVariables.value(15) ) { $gameVariables.setValue(15, []) };
$gameVariables.value(15).push( $gameVariables.value(16) );