Vendor System | Sansar Store
Vendor System

Vendor System

 999

You need to own this item to leave a rating.

0 ratings

The Vendor Library consists of 4 scripts to create all sorts of vendors and product displays, completely customizable to your needs.
__________________________________________________________________________________________
https://gyazo.com/ae25c8161dbe9e1ac6a8ae23f85d57f2
https://gyazo.com/2f6be3a812d68fb9ba86aae846e472df

You can go and try out some of the example setups here:
https://atlas.sansar.com/experiences/tron-sansar/vendor-system-examples

You can grab a free vendor example to inspect the scripts usage in the editor here:
https://store.sansar.com/listings/d0d90f30-b13b-4de3-9c88-95abed430483/snows-avatar-vendor

* Instructions *

? Creating a product display ?
- Add a Vendor script to the object you want as the vendor base.
- Add a VendorProductContainer script to the object.
- Make sure the Vendor Name Link setting in the VendorProductContainer matches the Vendor Name setting in the Vendor script so they get linked.
- Add some products from inventory to the VendorProductContainer.
- Turn on 'Automated Scrolling' in the Vendor script settings and set the 'Automated Scrolling Delay' to 0 seconds.
After you build, the vendor should now immediately start displaying all the products in sequence with the default 1O seconds interval.

NOTE: In case something is not working as intended, press Ctrl-D to open the console in your experience and check the logs for any warnings or error messages. If the problem persists or you need help setting things up, don't hesitate to contact @Tronn.

? Adding interactive behaviour to the products ?
- Rez the object that represents the product in your scene and add a VendorProduct script
- Set the unique identifier of the store listing. This alphanumeric value can be found in the store listing url and is 32 characters long.
- Optional: set the interaction prompt, this text will appear when hovering the product.
- Optional: set the interaction sound by selecting a sound from your inventory.
- Save the object back to inventory.
- Select the scripted object as a product in a VendorProductContainer.
When the product is spawned, you can now click it to open the corresponding store listing.
Additionally, you can add other scripts to your products to create a more dynamic and interesting display, for example a spinning motion that shows the product from all angles over time. (https://store.sansar.com/listings/7446e1a9-de41-4a66-acaf-bdd5f32607ab/object-spinner)

? Adding button controls to the vendor ?
Linking buttons to your vendor will enable remote control of the Vendor at runtime. By sending commands to the Vendor, you can instruct it to do certain actions like navigating products, open a store listing or changing the display mode.
- Create an object in your scene that you want to use as a button and add the VendorButton script to it.
- Set the Vendor Name Link property to the vendor name you want to connect.
- Set the Interaction Command value to 'nextproduct' (without the single quotes). This can be any one of the 18 different available commands, more info about each of these can be found below in the Script Settings info section.
- Optional: set the interaction prompt, this text will appear when hovering the button.
- Optional: set the interaction sound by selecting a sound from your inventory.
- Optional: restrict the usage of the button by setting the accessibility properties.
When you click the button in your experience, the vendor should navigate to the next product.

? Adding a transition indicator ?
The transition indicator is displayed when navigating between products, it can go from a simple loading indicator to a complex animated particle effect.
- Select the transition indicator object from your inventory via the dropdown menu in the Vendor script properties.
- Set the position & rotation offset values so the indicator appears where you want.
- Set the pre- and post-transition time values (milliseconds) to determine how long the transition will be seen.
The transition time settings are ideal when you want to show a transition that takes longer than the actual product rezzing. Pre-transition time determines how long the transition should show before the actual product starts rezzing, and post-transition time determines how long the transition is shown after the product has rezzed. If you set these both to 0 ms. the transition will be seen only for the amount of time it takes to rez the product.

? Using multiple productcontainers ?
- Linking multiple VendorProductContainers to the same Vendor script allows you to have more than 16 products in one Vendor.
- This can also be usefull if you want to have multiple products with different variations, so you can group all the variations of a product in one container and have seperate buttons to navigate over the variations by using the containerproduct commands.
- Navigating between different container can be done with the container commands.
You can visualize this setup like a two dimensional grid that you can navigate, where the containers are the rows and the products in are the columns.

? Script Settings ?
* Vendor *
Display and distribute products.
- Vendor Name: the identifying name of the vendor that is used to link buttons and product containers.
- Product Position Offset: the relative position offset from the vendor, determines where products will spawn.
- Product Rotation Offset: the initial rotation offset in degrees for products.
- Align Product Rotation: the Product Rotation Offset is applied relative to the vendor rotation when on or will be absolute in world space when off.
- Automated Scrolling: the vendor will start to automatically scroll the products when on.
- Automated Scrolling Delay: the amount of time in seconds the vendor has to be idle before starting automated scrolling.
- Automated Scrolling Interval: the amount of time in seconds a product is shown during automated scrolling.
- Randomize Automated Scrolling: the vendor will show a random product during automated scrolling.
- Product Change Sound: optional sound to play when a new product is rezzed.
- Product Change Loudness: the loudness in decibels of the sound that plays when a new product is rezzed.
- Vendor Busy Sound: optional sound to play when an invalid interaction occurs and when the vendor is busy.
- Vendor Busy Loudness: the loudness in decibels of the sound that plays when an invalid interaction occurs and when the vendor is busy.
- Transition Indicator: Optional effect between consecutive products.
- Transition Position Offset: the relative position offset from the vendor, determines where the transition indicator will appear.
- Transition Rotation Offset: the initial rotation offset in degrees to apply to the transition.
- Pre-Transition time: the amount of time in milliseconds to show the transition before rezzing the product.
- Post-Transition time: the amount of time in milliseconds to show the transition after rezzing the product.
- Active: toggles the script on or off.

* VendorProductContainer *
A container of products, multiple containers can be linked to the same Vendor.
- Vendor Name Link: the name of the Vendor this container connects to.
- Container Order: the sorting order number when mutliple VendorProductContainers are linked to the same Vendor
- Product X: the product reference object.
- Active: toggles the script on or off.

* VendorProduct *
Adds interactive behaviours to the product.
- Product Identifier: unique identifier of the store listing. This alphanumeric value can be found in the store listing url and is 32 characters long.
- Interaction Prompt: text to display when hovering the product.
- Interaction Sound: optional sound to play when the product is clicked.
- Interaction Loudness: the loudness in decibels of the sound that plays when the product is clicked.
- Active: toggles the script on or off.

* VendorButton *
Enables remote control of vendors.
- Vendor Name Link(s): the name(s) of the vendor(s) this button connects to, comma separated when multiple.
- Interaction Command: the command to send to the linked vendor(s) on the click of this object. Valid values are:

showstore
startautoscroll
stopautoscroll
defaultproduct
nextproduct
previousproduct
randomproduct
defaultcontainerproduct
nextcontainerproduct
previouscontainerproduct
randomcontainerproduct
defaultcontainer
nextcontainer
previouscontainer
randomcontainer
setproduct Y
setcontainer X
showproduct X-Y
showcontainer X
(X = containernumber Y = productnumber)

- Interaction Prompt: text to display when hovering the button.
- Interaction Sound: optional sound to play when the button is clicked.
- Interaction Loudness: the loudness in decibels of the sound that plays when the button is clicked.
- Owner Access Only: only the experience owner can interact with the object when toggled on, this will override the avatar access whitelist.
- Avatar Access Whitelist: list of avatar handles (@name) that can interact with the object, leave empty to allow everyone.
- Active: toggles the script on or off.

* Updates *
v1.4.0.110
- Added ability to control multiple vendors from the same button(s)
- Added optional sounds when product changes and when vendor is busy
- Added settings to align and offset the product rotation
- Added throttle on vendor buttons when vendor is busy
- Improved the product spawning flow
v2.3.1.513
- Fixed interrupting automated scrolling
- Added sound settings to VendorProduct
- Added sound & permission settings to VendorButton
- Added new Vendor commands for navigating products
- Optimized code & added tooltips to all script settings
v2.5.0.518
- Updated direct navigation commands
- Updated VendorButton Avatar Access List with new editable script property
- Added VendorButton switch to toggle between whitelist and blacklist

* Questions, issues or suggestions? *
Contact @Tron-Sansar

Item name
Vendor Library v2.5.0.518
Min. resale price
999