Forum rules - please read before posting.

Creating Maps

How would I create a map item whereby when the player clicked on the item in their inventory, a map image would appear over the screen? I looked around in the inspector, but couldn't find anything (tho I'm sure I missed it). Then they player can click off whenever.

Comments

  • edited April 2018
    For a map to appear on top of the existing scene, there are three ways you could do it.  In order of complexity (recommended method first):

    1) Create your map in a Menu using the Menu Manager, and make a Button each clickable location.  Clicking a Button would then run an ActionList asset that opens the next scene.

    2) Create your map as a series of Hotspot objects that stem from a single shared root object, and make it a prefab that gets spawned in at runtime via the Object: Add or remove Action.  So that your Hotspot Interactions can be run from any scene, you would need to set each Hotspot component's Actions source field to Asset File so that they run ActionList assets instead of scene-based Interaction objects.

    3) Create your map as a new scene, and load it in on top of the main scene via the Scene: Add or remove Action.
  • The first option seems like it'd be best. Similar issue, since its on the same topic, how might one create a safe puzzle? Whereby a certain set of numbers has to be inputed to complete the task?
  • Thanks so much!
  • Is there any way to have certain menu buttons only appear if a variable is true or not? I want only certain locations on the map to appear at certain points in the game.
  • Never mind, found the option!
  • Hi Chris! Regarding your map options...

    For option 1, How long do you think that would take for an average skilled programmer?

    Thank you!

  • You're referring to this?

    1) Create your map in a Menu using the Menu Manager, and make a Button each clickable location. Clicking a Button would then run an ActionList asset that opens the next scene.

    That wouldn't require programming - just use of AC's Menu and Action systems.

    The final "map" menu would be best done in Unity UI, because it'd be much easier to arrange the Buttons and images together. Your map image would basically cover the whole UI area, and invisible Buttons would then be laid on top over each location. However, you could use the "Adventure Creator" Source option for rapid-prototyping, and then switch to Unity UI for the final design.

    For each Button that represents a map location, set the Click type to Run Action List, and assign a new ActionList asset that features a Scene: Switch Action to take you to the correct scene.

    For an overview on creating Menus (both AC and Unity UI), see the Manual's "Menus" chapter. A series of Menu-based tutorials can be found here.

  • Hello everyone. I'm trying to do the exact same thing op wrote - "Is there any way to have certain menu buttons only appear if a variable is true or not? I want only certain locations on the map to appear at certain points in the game.", but I'm having difficulties in making this work, I just can't seem to find anything related to this.

  • A menu element can be hidden/shown with the Menu: Change state Action.

    To initialise element(s) based on variable values, assign an ActionList asset in the Menu's ActionList when turn on property, and use a series of Variable: Check and Menu: Change state Actions to hide/show elements based on the state of the variable(s) in question.

  • Yes, I've found it now! Thank you very much Chris.

  • Hi, this seems like a popular topic for obvious reasons, I would love to see a video covering this sort of thing. Does anyone have one?
    Regarding maps, I'm trying to decide if it is better for my game to set the map as a scene or as a menu. What are the advantages/disadvantages or either?
    In my 2D game the player navigates around town via a 2D aerial map, so if the map is it's own scene, will it function without a player avatar being visible on screen? (I guess the map would just be further forward in the layers than the player sprite?)

  • edited February 2022

    The three techniques I describe at the top are still valid, but which exactly you go with will depend on your game's specific requirements.

    The main considerations aren't so much about having a series of clickable locations, but the finer details. Are any location "Hotspots" non-box shaped? Is the map animated? Should the Player character be visible, moving to each location? Are locations unlocked over time?

    The menu approach is arguably easiest, but if you answer "yes" to any of the above, the scene or prefab methods would be the way to go. Of these two, the scene method is the easiest. You're then just using AC's regular workflow of placing down Hotspots, using variables to show/hide them as necessary, and optionally adding a NavMesh.

    The main other thing to consider is what happens if the Player chooses to (and can) exit the map without making a choice - in which case, they should appear where they were before without any kind of "scene entering" animation.

    For something like this, you can rely on AC's Player-switching feature as described here - and create a dedicated "map Player" that's only used for the map scene.

    This "map Player" can be invisible if you don't want the Player to actually be represented on the map itself.

    Then, instead of using the Scene: Switch Action to switch to the map scene, you can instead use the Player: Switch Action to switch to the "map Player", who is already in the map scene.

    To back out of the map, you then just need to use another Player: Switch Action to switch back to the regular Player.

    To visit a location on the map, you're probably going to want to first bring the regular Player into the map scene using the Player: Teleport inactive Action, then switch to them, then switch scene. This'll ensure that the new scene's OnStart cutscene is properly run as normal.

    Some tutorial(s) on this topic is a good suggestion - though I think being text-based would be the best fit.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.