Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags
(2 edits) (+1)

Perhaps if you override it like this, it will randomly select the name of the array when calling the background image.

class Scene_Menu < Scene_Base

  def create_menu_background

    menu_bg_list = ['menu_bg_A', 'menu_bg_B', 'menu_bg_C']

    @menu_background = Sprite.new

    @menu_background.bitmap = Cache.system(menu_bg_list[Random.rand(menu_bg_list.length)])

  end

end

Thank you very much for the reply, especially when it's been a while since the script's release. I've tried formatting things a few times, but kept running into this issue. Sample of the error and script changes below (in case I erred).


(+1)

I hadn't known that there would be such a problem since I hadn't used RPG Maker or the Ruby language for a long time.

It would have been nice if I could provide the perfect logic as the first comment, but at the time, it was not an environment where RPG Maker could be run, so I couldn't verify it, so this problem arose.

In the code in the previous comment, the part that used Math.rand() * n was modified to use Random.rand(n). I checked whether the logic works normally in RPG Maker VX Ace, so there should be no problem now.

I hope this has been helpful in creating your work.

It works perfectly. Here are my results! Thank you very much for your replies and patience.

Deleted 1 year ago