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.

Checking The Map

Yin

Member

I need to make an event that checks if an event is on a specific map. How would I do this? I'm trying to make a conditional branch that does something different on different maps.
 
Is this for xp or vx? and how would recognize the event, I guess by event name?
I believe it's impossible without a script.
if for XP, try this:
Code:
class Game_Event < Game_Character

  def event_name

    return @event.name

  end

end

 

class Game_Map

  def event_exist?(name)

    for i in @map.events.keys

      return true if @events[i].event_name == name

    end

    return false

  end

end

Use a conditional branch with: $game_map.event_exist?(EVENT_NAME)
 

Yin

Member

Not even with a script? I'm sure there was a way. Also, Silver Wind's way is going by event name, not ID which will probably make things easier. Also, how would I use this to check if the event is on a specific map from another map.
 
Unka Josh":m64doysa said:
Uh, how exactly would this come up? An event only exists on one map at a time, and there is no way to transfer an event to a different map.
Near has just posted a script to transfer an event between maps. I thought Yin was asking about that..
Yin":m64doysa said:
Also, how would I use this to check if the event is on a specific map from another map.
if you use a common event, "$game_map.event_exist?" will check the current map.
What are you trying to do ? :huh:
 

Yin

Member

I'm trying to make an event that tells the player that another event is on another map, but the map is random everytime, so I need to check if it's there. Would this be better served with switches and/or variables? If so, how would I go about doing that? Also, I am using Seph's Save Even Location Script for the NPC transfers. Is that a better one that you are talking about?
 
You can use variables, dunno if it's easier.
Whenever you transfer the event, save the new map number in a variable. Let's say you used variable 001. Use conditional branch to, show the map's name:
if variable 1 = 1, say 'Go to Harmony Town', if 2 say 'Go to the forest', etc.
 

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