Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
Tags

Multiple Menu Backgrounds

A topic by thegesticulator created May 30, 2023 Views: 92 Replies: 4
Viewing posts 1 to 2

I understand this editor has been out for a while now. It works amazingly.

Is there was a way to have multiple menu backgrounds? I've been trying to call an event that randomly chooses from several backgrounds to load when bringing up the menu for the sake of variety. I've tried several solutions, but to no avail.

Thank you for your time, regardless.

Developer (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).


Developer(+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 279 days ago