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.

When on a certain map...

$game_map.map_id = 3 doesn't seem to work.
I want it so that when i'm on certain maps I can teleport to another map from the menu.
I already implemented this system in my CMS but :
if $game_map.map_id = [MAP] gives me an error.
Can someone help?

Maybe it's a little confusing here...So what I need is some correction for this condition:
if $game_map.map_id = 3, 4, 5

because this does NOT work.
Thx
 
if $game_map.map_id == [MAP] #try 2 = signs with a conditional statement

The second example....

if [3,4,5].include?($game_map.map_id)

should work. Or

case $game_map.map_id
when (3..5)
  • <code here>
end
 

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