Pretty much exactly what it says on the tin. I’m needing to concatenate two variables, specifically a string and a number (in that order).
Concatenate two variables…
RPG Maker MV SupportAs in Javascript variablees or game variables?
Game variables, in this case.
Just use + then. Say variable 51 contains "string" and variable 57 contains the number 10
$gameVariables.value(51) + $gameVariables.value(57)
// string10
$gameVariables.value(51) + $gameVariables.value(57)
// string10
Didn’t expect it to be that simple and straightforward, honestly. Much appreciated. ^.^
Javascript is very much not picky when it comes to what's on either side of its arithmetic operators. It's basically like "Oh okay you want to add a class to an array? Sure, why not"
This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.
Original thread: https://forums.rpgmakerweb.com/threads/concatenate-two-variables.154861/