-
Notifications
You must be signed in to change notification settings - Fork 7
Maps_Locations
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 use a string to store coordinates (latitude and longitude); this string is converte into a vector 2 of type double (for precision) for the purposes of converting physical locations to game space positions.
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.
To first add a location you must open the map up. To do so:
- Ensure you have the Flow Engine Window open and a Flow Engine selected in the scene.
- Select
Show Mapin the top left toolbar of the Flow Engine Window.

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

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:
- Unfold the drop-down
IMAGE - Select the drop-down for
Data Source

- 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)
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:
- Select 'Search'.

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

- The map will update with the desired location.
Adding a new Location Variable can be done in two ways:
- You can find coordinates of a specific location, create a variable in the Flow Engine Inspector and copy the coordinates into the value
- 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:

When adding a new location on the map you will be offered to add extra information on this location:
- The name of the location.
- Whether or not to show the name on the map (or just show the icon).
- If showing the name, the colour of the name label.
- A custom icon for this location.
In our example, we name our location 'Info Hub' with the colour white and a custom information icon:

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.
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:
- Select the desired Node.
- Find the
Node Locationproperty drop-down.

- 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.
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:
- Select your desired Node.
- Add a
Logic>IfOrder to this Node.

- Select the Order and observe the Order Inpsector.
- From the
Variabledrop-down select the newly created Location Variable.

- You can either choose 'Equals' or 'Does Not Equal' for the
Comparefield 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. - 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).

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:

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).