Picture number determined with a variable

Due to the many pictures I'm going to be showing, they are going to be in either position 1, or position 2. Now I could create a conditional branch that checks if it's position 1, or position 2, and show all of the correct pictures. But that's a tedious task (copying everything and changing only the picture number, for like a 100 pictures).


So basically I'm asking if it's possible to show a picture with a number that's based on a variable?


If variable 1 is 1, then Picture Number is X. If variable 1 is 2, then Picture Number is Y etc.
Oh my god that is a nice question, i never thought on that, at least this could be done via plugins, is not possible with events, the solution is precious, this is going to be cool if someone go with the answer,
Sure, you could use the script call for showing a picture in conjunction with variables.


// (pictureId, name, origin, x, y, scaleX, scaleY, opacity, blendMode)
$gameScreen.showPicture($gameVariables.value(25), 'file-name', 0, 0, 0, 100, 100, 255, 0);




At least, I think that is what you are after. I'm not quite sure how everything is lined up in the event/events.
You can replace the "Show Picture" command with a single script call:


$gameScreen.showPicture(pictureId, name, origin, x, y, scaleX, scaleY, opacity, blendMode)


You can use it like this:


$gameScreen.showPicture($gameVariables.value(1), 'picture_name', 0, x, y, 100, 100, 255, 0);


Edit: Ninja'ed
Thanks guys!


When typing in the picture name, does it end with the file extension? So "picturename.png" or just "picturename"?
Thanks guys!


When typing in the picture name, does it end with the file extension? So "picturename.png" or just "picturename"?



file string no need extention,, rpg maker take only png picture file.


Dont forget rpgmaker take 200 Max picture


If need to increase change this to ex: 500


Game_Screen.prototype.maxPictures = function() {
return 200;
};



inside rpg_objects.js


Line: 738
Is there anyway to show different pictures based on the variable with this script call? or do I have to setup a conditional branch?


For instance, if the variable is =1 could it show an image named "picture1" automatically on the script call, or if the variable is =2, it would show "picture2".


Basically, have it read the variable and show a picture based on the number in that variable?
@soɐɥʞpǝɹǝʇlıɥd Sure, you could use the following.

Code:
// Using the plus operator (+) concatenates 'file-name' with whatever is stored in game variable 25
$gameScreen.showPicture(1, 'file-name' + $gameVariables.value(25), 0, 0, 0, 100, 100, 255, 0);
Should this script call work with Ace as well?


I have


$gameScreen.showPicture(1, 'Santa Life 1' + $gameVariables.value(12), 0, 0, 0, 100, 100, 255, 0);


set into a  script call, but it keeps giving me the error
error.png



Santa Life is the name of my images, numerically ordered from 1-10.
No, that command is for RPG Maker MV. Here is the RPG Maker VXA code :

Code:
#                  pictureId      pictureName                     origin, x, y, scale_x, scale_y, opacity, blend_mode
$game_map.screen.pictures[1].show('Santa Life ' + $game_variables[12], 0, 0, 0, 100.0, 100.0, 255, 0)
dang it. Thanks. quick question: do I copy everything in that box? even the words "picture Id" and "picture name"?
Nope, that's just a reference.

Original thread: https://forums.rpgmakerweb.com/threads/picture-number-determined-with-a-variable.68630/