RPG Maker Forums

Howdy,
I'm recently getting into scripting (yeah I know, better late than ever...), I don't know much about it and I'm mostly editing pre-existing stuff that I plan to use in a project. A couple of days ago a friend (who also is a low level scripter, he knows just a little bit more than me) thaught me how to load a specific image as a background for one of my menus, by putting this into the script in which I want the image.

Code:
    $sfondo = Sprite.new
    $sfondo.bitmap = Cache.picture("Storage")
   
    $sfondo.x = 0
    $sfondo.y = 0

    $sfondo.opacity = 255
I know that more experience scripter will probably know a better way to do it, but this works as intended and I'm perfectly fine with it, the issue is, what if I want to load a different picture, according to a certain game's varialble?

My first instinct was to edit one of the lines like this:
Code:
$sfondo.bitmap = Cache.picture("Storage_"+$game_variables[9])
in my head, the game was supposed to search for for an image name Storage_1 (if the variable is 1, and so on...) but it didn't work. Was I close or did I do it completely wrong? Is there a way to do it at all?

Latest Threads

Latest Profile Posts

Day 9 of giveaways! 8 prizes today :D
He mad, but he cute :kaopride:

Our latest feature is an interview with... me?!

People4_2 (Capelet off and on) added!

Just beat the last of us 2 last night and starting jedi: fallen order right now, both use unreal engine & when I say i knew 80% of jedi's buttons right away because they were the same buttons as TLOU2 its ridiculous, even the same narrow hallway crawl and barely-made-it jump they do. Unreal Engine is just big budget RPG Maker the way they make games nearly identical at its core lol.

Forum statistics

Threads
106,040
Messages
1,018,479
Members
137,824
Latest member
dobratemporal
Top