Combine strings held in variables into one variable.

Hello there!

Lets say I have a picture I want to show, which is called "Picture_CheeseBurger.png".

The "CheeseBurger" part needs to come from two variables, that are defined at some point in the game.

Right now, I am trying to implement this with this script call:

$game_map.screen.pictures[10].show('Picture_' + $game_variables[1].to_s + $game_variables[2].to_s, 0, 0, 0, 100.0, 100.0, 255, 0)

Wherein Variable 1 = "Cheese", and Variable 2 = "Burger". However, this does not seem to work. It does not throw an error, as it does when the variables are undefined, rather the image just does not seem to appear at all.

I am not sure what I am doing wrong here, and feel I should probably just combine those two variables into a third variable and use that in the script call instead. I'm happy to show how I'm using this in game if it would help.
NVM, I figured it out! For those looking, set your third variable to:

Script:$game_variables[1]+$game_variables[2]

I had made an error with one variable so it wasn't be recognised as a string properly, so double check that too.
You should make the name first then do the command.
The command wants a name not a calculation
Ruby:
name = 'Picture_' + $game_variables[1].to_s + $game_variables[2].to_s
$game_map.screen.pictures[10].show(name, 0, 0, 0, 100, 100, 255, 0)

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/combine-strings-held-in-variables-into-one-variable.141175/