Skip to content

Maps_Locations

Jack Brett edited this page Jan 14, 2025 · 9 revisions

A core concept of LoGaCulture is location. Location of heritage sites, people and history is the heart of this project and therefore using locations in LUTE is a key aspect of the tool.

Locations are defined as custom Variables which store a scriptable object that include details of a specific location (most importantly, latitude and longitude).

Locations are used in a myriad of Orders, Nodes and Condition statements. A common use of a location will be to tie it to a specific Node - ensuring that the location provided must match the Node's location before it executes the first Order in the list.

Adding Locations

To first add a location you must open the map up. To do so:

  1. Ensure you have the Flow Engine Window open and a Flow Engine selected in the scene.
  2. Select Show Map in the top left toolbar of the Flow Engine Window.

showMapButton

  1. We suggest docking the map window somewhere for ease of use.

mapDocked

Setting Map Visuals

When opening the map, the Inspector Window will update to show the settings for the Map. Feel free to customise your settings but please play close attention to changing map layers:

  1. Unfold the drop-down IMAGE
  2. Select the drop-down for Data Source

mapSource

  1. Choose your preferred style. Please note that the style chosen will be visible in the editor and will also be used in the final experience (i.e, from the player's perspective)

Navigating the Map

To pan the map (akin to how you would navigate any other map software) you can hold left-click and drag the mouse when inside the bounds of the map window. Alternatively, you can use the keyboard controls WASD. Settings for panning speeds can be adjusted in the Map Inspector Window.

You can zoom in and out of the map using the scroll wheel or find the zoom level under the GENERAL drop-down in the Map Inspector Window.

Under the GENERAL drop-down you can also search for specific locations using key-words. To do so:

  1. Select 'Search'.

mapSearch

  1. Begin typing your location.
  2. Select the desired location from the list if it appears or continue to refine your search until it does.

mapSearchWindow

  1. The map will update with the desired location.

Creating a new Location Variable

Adding a new Location Variable can be done in two ways:

  1. You can create a new LocationInfo scriptable object by right-clicking in your project folder or selecting 'Assets' then Create/LUTE/LocationInfo.
  2. Add a location using the Map Window by right-clicking where you wish your desired location to be and enter the details you wish for the location:

mapLocationWindow

When adding a new location on the map you will be offered to add extra information on this location:

  1. The name of the location.
  2. Whether or not to show the name on the map (or just show the icon).
  3. If showing the name, the colour of the name label.
  4. A custom icon for this location.

In our example, we name our location 'Info Hub' with the colour white and a custom information icon:

mapInfoLocation

Adding custom icons will require you to ensure that the locations are not too big or too small on the map but pleae ping us on Discord/Issue request on GitHub for more information on this.

Creating Custom Location Infos

By following the first step you can create a new scriptable object that will hold information about a specific location. This may include the name of the location, the position, radius size and more! It is important that you place these location scriptable objects within a folder named 'Resources' so our backend can find them without overloading the system.

locationSO

Once you are happy with your Location you can then create a new variable on the Engine and then reference your new location scriptable object.

locationVar

Using Location Variable on Nodes

Now we have a new location, we can use this a multitude of ways. Quite often we will have content that will commence on a given Node and this will require players to be a specific location to be executed. Rather than using a series of complex condition statements for every piece of content, we simplify this by including a property on each Node called Node Location which ensures that the Node will not execute until the player has arrived at the specific location.

To set up a Node with our new variable we will:

  1. Select the desired Node.
  2. Find the Node Location property drop-down.

nodeLocation

  1. Choose the most recent Location Variable we just created.

This will ensure that the Node will never execute even if it has an Game Started Event Handler unless the Location has been met.

Using Locations as Event Handlers

Quite often you may wish to not only play content when a player reaches a location but extend this funtionality. For example, you may wish for the player to press the location pin rather than it automatically be triggerd or you may wish to update the location pin visuals depending on the state of a Node. To do so change the Event Handler on a Node to 'Location/OnLocation'.

You can then update the Location field to your desired location variable and customise the properties of this event handling to suit your needs.

locationEventHandler

Using Locations in Condition Statements

Another common use case for Location Variables is to use them in Condition Statements. For example, perhaps some Orders on a Node will want to fire whereas some will require a Location to be met. To do so:

  1. Select your desired Node.
  2. Add a Logic>If Order to this Node.

ifOrderChosen

  1. Select the Order and observe the Order Inpsector.
  2. From the Variable drop-down select the newly created Location Variable.

locationVariable

  1. You can either choose 'Equals' or 'Does Not Equal' for the Compare field which will either evaluate and return true if the player is or is not at the location, respectively. In our case, we state is as 'Equal' ensuring that the Orders will not execute until the player has reached this location.
  2. If you wish for this behaviour to only be called once after the prior Orders have been completed then we are done. However, if you wish for statement to constantly be checking and execute when player reaches a location then please ensure that the Node is Activated By Update (ensuring that the condition statement is being evaulated every frame or so).

updateEvent

Demo Map Mode

Oftentimes, we are not at the location to test our experiences in full. As such, we provide a way to test locations remotely using 'Demo Map Mode'. When this mode is active, a central target image will be displayed when using the map in Play Mode and this will act as the dummy player location; if this image gets in range of a given location then it will satisfy the location check.

To toggle this mode, select your Flow Engine object in the scene and toggle the 'Demo Map Mode' boolean check:

demoMapMode

When unchecked, the physical location of a given device will be used (a permission check will have to be accepted when the experience requires the location of the device and it is the first time the application has been launched on a specific device).

Clone this wiki locally