This article explains how to place virtual items at real-world locations to be collected by the player.
The Motive platform makes it easy to place virtual items in the real-world that your players can collect. As a content creator you define: which items are to be collected, where these items should be placed on the map, what radius they can be collected from, and if they are visible on the map.
Motive offers a few ways of accomplishing this objective. The simplest way to place items on the map is to use a [permalink id=2463 text=’Location Valuables’] resource; you select any number of [permalink id=2030 text=’Locations’] and define a probability that the items will appear there. A Location Task can be used to accomplish the same goal but with more optional parameters. Finally, a Location Proximity Condition can be used to trigger a [permalink id=1846 text=’Frame’] with custom content.
This tutorial assumes the developer is using the Ghost Hunter Unity template. Other Unity projects may not implement all the features described here.
Items and Locations
To place items at a Location, you will first have to define those items. There are two types of items that can be collected: Currency items and [permalink id=2194 text=’Collectible’] items. You can set any number of either of these items when creating pick-up Locations.
If you want to place items at a specific Location, you will have to ensure that your project space contains a Location [permalink id=1847 text=’Catalog’] with at least one Location defined. To create a Location Catalog, navigate to your project’s dashboard, select Assets then select Create New. Choose ‘Location’ from the Catalog Type dropdown and give your Catalog an appropriate name. Now you can add Locations to this Catalog by clicking on the map in the Catalog’s editor page.
Place Items at a Location
Using Location Valuables
The [permalink id=2463 text=’Location Valuables’] Resource can be used to place items at a set of Locations. First drag the Location Valuables resource into the Frame editor column. Next, choose a set of static Locations from your Location Catalog by clicking “Add from catalog” beside the “Locations” parameter. Next, choose the items you would like to drop at these Locations by clicking the “+” symbol beside “Currency” or “Collectible”. You can select multiple Locations and items.
Once you have selected your Location and items, you will have to set a value for the probability parameter. This needs to be a number between 0 and 1. This value is the probability that the selected items will appear at an individual location. For each selected Location, a random number is generated between 0 and 1. If this random number is greater-than-or-equal-to the probability value set here, than the items will appear at that Location. For example, if the probability is set to “0.5”, approximately half of the selected Locations will receive the selected items. Set this value to “1” to guarantee that the selected items will appear at all selected Locations.
Using Location Task
The Location Task resource can be used to create a mission to collect item(s) at a Location. This mission will be included in the ‘Tasks’ panel. Location Task provides more optional parameters than Location Valuables. These optional parameters allow you to create a more customized experience.
Let’s create a simple Location Task to collect an single item at a static Location. First drag the Location Task resource from into the Frame editor column. Next, choose a static Location by clicking “Add from catalog” beside “Locations” and choose a Location. If you do select multiple Locations, then the Task can be completed at any one of those Locations.
Next we are going to choose the image that will display on the map. Beside “Marker” click the “+” button. Then click “Add from catalog” beside Media. Now select an image [permalink id=2126 text=’Media Item’]. This image will display on the map at the Location selected.
Now we are going to fill in some details about this Task. Give this Location Task a “Title” and a “Description”. The “Title” will be viewed when the Location is selected by the user, and the “Description” will be displayed on the Tasks panel. We also would like this Task to have an image displayed in the Task panel. To do this choose any image from your catalogs beside the “Image” property. Alternatively you can select a “Character” instead and this Character’s image will be displayed next to the Task.
The “Action Range” property specifies at what ranges the player is able to interact with the Location. There are default values for “Min” and “Max” if you do not set them here.
Now we are going to specify which action the player will perform at the selected Location. Beside “Action” select “take”. This will cause the player to “take” items from this Location. Beside “Action Items” we are going to specify which items the player will receive. You can choose any number of Collectible or Currency items.
That’s all it takes to create collectible items at a Location using Location Task. There are more parameters available for Location Task that can be used to alter the Task and experience for the player. Check the docs for Location Task to learn more.
Using Location Proximity Condition
The final way to place items at a Location is to use a Location Proximity Condition. Using this condition, one can activate a Frame with any number of resources inside. This method is for developers who want to create a very customized experience that cannot be accomplished with the Location Valuables or Location Task resources.
The Location Proximity Conditon is attached to a Frame as a Precondition. When the [permalink id=1843 text=’Script’] is first processed, this Frame will not be activated until its Precondition is satisfied. In this case, the Precondition is satisfied when the player is in range of the selected Location.
To create a Location Proximity Condition, first create a new Frame and select it. For this new Frame, create a new Precondition by selecting “Add Condition” at the top of the middle column of the Script editor. From this dropdown menu select “Location Proximity Condition”. Next, select the Location(s) you would like to trigger this Frame, and choose a Min and Max range (0 and 25 respectively are common values), or use the default values. Now, this Frame will be activated when the player is in range.
We want the player to receive some items when this Frame is activated. From the Resource column on the right, drag and drop the [permalink id=2304 text=’Add to Inventory’] Resource into the Frame editor column. Select the items you would like the player to receive, and the amount for each item.
That’s it! Now when the player reaches the selected Location they will receive the items specified by Add to Inventory. You can also trigger other Resources in this Frame to personalize the experience. For example, you may want to include a [permalink id=2328 text=’Screen Message’] telling the player that they have received some items.