wiki.sine.space | sinespace

Modular Vendors

From wiki.sine.space
Revision as of 09:57, 5 December 2018 by HannahT25 (Talk | contribs)

Jump to: navigation, search

We have added some new vendors to our features, and these vendors are called modular vendors. Modular vendors are vendors which can be placed in your region, and act like a clickable shop. Other users can click on the object the modular vendor script is attached to, and browse through the items you have on sale. You can have an individual modular vendor, which will only display and sell one item, or you can use a catalogue modular vendor, which will allow you to display and sell items from a specific collection, range or line.

To make things simpler, in our Editor Pack we have two samples of modular vendors: New Basic Catalog and New Basic Single Item Vendor. You can find these samples in the editor pack under Assets>Sample Art>Vendors>Vendors


Adding the modular vendor to your region

To add the modular vendor to your region, you need to add it into the region scene where you want the vendor to be.

For the vendor script to work, you need to attach it to an object in the scene. Make a new 3D object, such as a cube, by right clicking in the hierarchy, and choose 3D Object>Cube. Place the cube where you want it to be in your region.


Setting up for the modular vendor

Right click in your hierarchy, go to UI>Canvas. This canvas will be used in conjunction with a panel for displaying the information about your item/items.

Drag the canvas in the hierarchy into your cube. Under the Inspector window, make sure the Canvas script Render Mode is set to World Space.

In the hierarchy, right click, go to UI>Panel. The panel should automatically be under the cube in the hierarchy. Next, you need to resize the canvas so it fits the cube. To resize it, you can use the Scale tool in the top toolbar. Scale it down until it looks something like this:


Canvassize.jpg


After the resizing, you can customize the color of the panel. You can do this by clicking on the Panel in the hierarchy, and going to the Image Script under the Inspector Window.


Panel-color.jpg


Now you need to add a few Text scripts and a RawImage script into your heirarchy. Right click in the heirarchy, and choose UI>Text. This will automatically be placed as a child object of the cube. Duplicate this text script by right clicking on it, and duplicate until you have six Text scripts. Rename your Text scripts in the heirarchy by clicking on the Text script, and go to the Object Name box at the top of the Inspector Window.


Object-name.jpg

Rename your texts like this:

  • Item Name
  • Item Description
  • Gold Label
  • Gold Price
  • Silver Label
  • Silver Price

You will also need to add these titles to the actual text script as well by changing the text in the Text Script in the Inspector Window. When you name the Gold Label and Silver Label in the Text Script, name them as Gold Price and Silver Price, as the actual digits of the price need to go under the texts you named as Gold Price and Silver Price in the hierarchy. There will be a screenshot of this later on.


Textscript.jpg


Right click in your heirarchy again and choose UI>RawImage. Drag the RawImage until it is between the Item Description and Gold Label. The RawImage Script will hold the image of the item which is for sale.


Positioning the text

You will need to lay out the text on the panel to make sure it is readable and also has space for the rawimage. You can move the boxes around with the normal move tool, but to scale the text box, you will need to use the rect transform tool.

To resize the text, you will need to change the size in the Text script.


Textsize.jpg

Make sure Best Fit is ticked, and set the min to 9, and max to 96. That is the optimal size for the text as it will be readable.

Here is a screenshot of the best layout:


Vendorlayout.jpg


When you are happy with the placement of the text and image, you can move on to attaching the modular vendor script.

To attach the script, click on the cube, click on 'Add Component' under the Inspector window, and search for Modular Vendor.


Single Item Vendor

Modularscript.jpg

To fill this script up, you first need to pick the Vendor Mode. This can either be single or catalog. For this instance, choose 'Single'.

For the product ID, add the product ID of the item you want to sell which is on [1].

Under the UI Fields, you will need to drag the text scripts into the appropriate boxes. So, for the Name box, you will need to drag the Item Name from the hierarchy into the Name box. This is how it should be:

  • Name - Item Name
  • Description - Item Description
  • Brand Name - (You can make a new text script for this and add it in)
  • Brand Image - (You can make a new RawImage for this and add it in)
  • Item image - The original Raw Image
  • Item Icon - Same as Brand Name

For the Gold heading, make sure you have the Display checked.

For the Gold text field, add the Gold Price text from the hierarchy.

Make sure Display Free is set to 'Use world free'.

Set Display Unavailable as 'Use Dash Character'.

Container Game Object you can leave empty.

For the Silver, do the same as above, but drag the Silver Price from the hierarchy into the Silver text field.

Scroll down, and set the Interaction activation mode to Collider Click.


All of the above information, such as item name, description and price will be automatically taken from the virtual good script of the item on curator.


Catalog Vendor

Catalogvendor2.png

The catalog vendor works a little differently to the single item vendor. The catalog vendor has categories for you to choose from which will sort the Shop.

You can set the Primary Content type to whatever you need to be, for example, if you make clothing, you can set it to 'Clothes' being primary.

You can also set the catalog to filter items. These are the filters:

  • Filter by Brand - This will only show items from a specific brand. If you want to have every item you have created show up in the Shop, this is the one to choose.
  • Filter by Creator - This is pretty much the same as above;It will filter the Shop to only show a certain creators items. Note - if you use another creators ID, these items will not show on the preview viewer and you will need to publish the vendor to live to see the content correctly.
  • Filter by search term - This will filter the items by search term. For example, if you put in 'Skirt', all skirts in the Shop will show.
  • Filter by item IDs - This will filter specific items only using their IDs. You will need to put the number of items you want in the 'Size' box under the checkbox. If you want to add five item IDs, put 5 in the box for example.

Activation mode is how the vendor is activated. This should be set to Collider Click; just make sure the object with the vendor component script on it has a collider.

Now you can upload your region as normal, and these modular vendors will be in your region for users to buy items from.