any way I could script call show a picture based on a variable? IE Show Picture 1 \V?
Note, this does not allow dynamic updating of the picture (every time you update the game variable's value, you will need to do the picture script call)
$game_screen.pictures[NUMBER].show($game_variables, ORIGIN, X, Y, ZOOM_X, ZOOM_Y, OPACITY, BLEND_TYPE)
replacing the constants above with actual values...
NUMBER = which picture ID to show (generally 1~100)
ORIGIN = upper-left (0) or center (1)
X/Y = screen coordinates
ZOOM_X/_Y = percentage to zoom in/out picture, default is 100
OPACITY = transparency, default 255
BLEND_TYPE = normal (0), add (1), sub (2)
...and the game variable ID accordingly.
Alternatively, you can change Game_Picture's name attribute to accessor:
attr_reader :name # file name
attr_accessor :name # file name
And use the script call:
$game_screen.pictures[NUMBER].name = $game_variables
Assuming all you want to do is change the graphic it uses and nothing else.
I tried to use this:
$game_screen.pictures.show(Wraith, , 120, 120, 0, 0, 255, )
and got an error. So I messed up. I have a bunch of pictures, numbered 1-100, that correspond to the actor IDs in my database. Each picture is called 'Face" followed by a number face1, face2
, etc. How would I get it to show these pictures with a variable?
I'm Looking to do something similar to this. A combination of SHOW Choice and Pictures:
A lot of things wrong with that script call of yours.
- Wraith needs to be a string, which is surrounded by quotes. So either 'Wraith' or "Wraith".
- ORIGIN and BLEND_TYPE are not arrays. Drop the square brackets around them. What I meant in my explanation
Quoteupper-left (0) or center (1)
normal (0), add (1), sub (2)
is "use one of the following integers". Otherwise I would have indicated that you should put the number in an array.
- ZOOM_X and ZOOM_Y should be set to 100, not 0, if you don't want to apply any zooming. A zoom value of 0 means your picture is zoomed out so far that it is infinitesimally small, i.e. invisible.
Assuming $game_variables holds some integer value,
name = 'face' + $game_variables.to_s
$game_screen.pictures.show(name, 0, 120, 120, 100, 100, 255, 0)
I got an error using that scriptlet:
name = 'face' + $game_variables
0, 120, 120, 100, 100, 255, 0)
Quote"TypeError occurred while running script. cannot convert Game_Variables into string"
It's because the lines are broken up incorrectly. The .to_s needs to be on the same line as $game_variables. So put the line break after the plus sign.
name = 'face' +
Thanks for the headsup. I'll post the results later on.