Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Maps that Change Settings!

Here's what i need done ;
When transfering to another map the windowskin changes but this is how i want it setup so its easy to handle...

when in the script edit mode i can see the script i scoll down and what not and then i come across the section to edit...

when (map is) 1,2,3...
@windowskin is ''
when (map is) 4,5,6...
@windowskin is ''

i'm not sure if the maps have to be in 001 format or not but hopefully this will help...
i think this is alot easier then trying to do every event command in the game... please get back to me!
Thanks in advanced!
 
Try this (put it above main, under Game_Map (better nearer main) and under SDK if used):
Code:
class Game_Map
  alias old_setup_game_map_windowskin_for setup
  def setup(map_id)
    old_setup_game_map_windowskin_for(map_id)
    
    case map_id
    when 2,3
      $game_system.windowskin_name = ''
    when 4,7,8,9,22,13
      $game_system.windowskin_name = 'Red_dragon_windowskin'
    #more-> when ...

    else  #default, when not defined above
      $game_system.windowskin_name = '001-Blue01'
    end
    
  end
end
 
Case statements can just be a pain in the ass to go through. Instead, use a hash.

Code:
class Game_Map
  Windowskins = {}
  Windowskins.default = '001-Blue01'
  alias old_setup_game_map_windowskin_for setup
  def setup(map_id)
    old_setup_game_map_windowskin_for(map_id)
    $game_system.windowskin_name = Windowskins[map_id]
  end
end

Here, you can still set multiple maps for the same id, but taking the case out is a little bit easier to work with.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top