Cloud spawning: Difference between revisions

From Resonite Wiki
Tone
explain copy and paste better, rewrite first paragraph
Line 2: Line 2:
{{Note|Cloud Spawning is part of the [[Things to Avoid]] list. It may break in the future without warning.|warning}}
{{Note|Cloud Spawning is part of the [[Things to Avoid]] list. It may break in the future without warning.|warning}}


'''Cloud Spawning''' is the unofficial term used to describe the action of spawning an item from a [[User|user's]] [[Inventory]] using a [[Resonite_database_link|resdb link]]. Doing this currently and easily requires a mod ([https://github.com/art0007i/ShowDelegates Show Delegates] from [[User:Arti|Arti]]) that can get the resdb link and adding it to several components to make spawning that item possible. It is also one of the [[Things to Avoid#Using_Keyboard_Components.2FNodes_to_spawn_items|things to avoid]].
'''Cloud Spawning''' is the unofficial term used to describe the action of spawning an item from a [[User|user's]] [[Inventory]] programmatically. It is not officially supported but the community has found a few ways to achieve this using the methods described below.


== Methods ==
== Methods ==
Line 8: Line 8:
=== Copy & Paste ===
=== Copy & Paste ===


<!-- TODO: What does this mean? -->
This method allows you to spawn an item by pressing a button with a [[Component:ButtonClipboardCopyText]] and [[Component:VirtualMultiKey|VirtualMultiKey]] components. To set this up simply attach both components to a slot which has a button, setup the [[Component:ButtonClipboardCopyText]] component to copy the link to the asset you want to cloud spawn and set the [[Component:VirtualMultiKey|VirtualMultiKey]] to "LeftControl" and "V". Clicking the button will then spawn the asset. The benefit of this method is that it supports all links you can normally paste into resonite, such as resrec, resdb and http. A disadvantage is that it can only be triggered by pressing a button, there is no way to use this method without user interaction. [[RedX]] uses something similar to this method to spawn out items.
 
There is a certain way of just using components to copy and then paste in the item from an inventory. [[RedX]] uses something similar to this to spawn out items.


=== Components and Method Proxies ===
=== Components and Method Proxies ===

Revision as of 20:03, 9 August 2025

This method is not supported by the developers of Resonite and may break at any time!
Cloud Spawning is part of the Things to Avoid list. It may break in the future without warning.

Cloud Spawning is the unofficial term used to describe the action of spawning an item from a user's Inventory programmatically. It is not officially supported but the community has found a few ways to achieve this using the methods described below.

Methods

Copy & Paste

This method allows you to spawn an item by pressing a button with a Component:ButtonClipboardCopyText and VirtualMultiKey components. To set this up simply attach both components to a slot which has a button, setup the Component:ButtonClipboardCopyText component to copy the link to the asset you want to cloud spawn and set the VirtualMultiKey to "LeftControl" and "V". Clicking the button will then spawn the asset. The benefit of this method is that it supports all links you can normally paste into resonite, such as resrec, resdb and http. A disadvantage is that it can only be triggered by pressing a button, there is no way to use this method without user interaction. RedX uses something similar to this method to spawn out items.

Components and Method Proxies

This method allows for full control of how an item is spawned out from an inventory. This requires a mod to show sync delegates and to get the Method Proxy nodes which, once called, will spawn the item.

What You Need

Item Setup

The get item link buttons.
The get item link buttons (with the cheese button being active).
  1. Open the Inventory tab on the Dash.
  2. Navigate to the item you wish to cloud spawn.
  3. Press the "cheese" button from the Get Item Link mod to get the resdb link.

Slot Setup

An inspector showing the components needed to make cloud spawning work.
An inspector showing the components needed to make cloud spawning work.
  1. Create an empty slot using the Dev Tool.
  2. Attach the StaticBinary component.
    1. For the URL, place your item's resdb link here.
  3. Attach the FileMetadata component.
    1. For the Filename, you can use any name here, but it must have the .brson, .7zbson, or .lz4bson file extension at the end of the name. (Filling in MIME is not required.)
  4. Add a button component onto the slot or parent slot, and trigger it to spawn the item.
  5. (Alternatively) Open the FileMetadata Sync Methods using the Show Delegates mod, and with the ProtoFlux Tool, grab and hold the OnImportFile method. Then open the context menu while still holding it, select Proxy.

ProtoFlux Setup

An example of how to use ProtoFlux to cloud spawn.
An example of how to use ProtoFlux to cloud spawn.
  1. With the method proxy, connect it to anything that can send a pulse to it (the example shows a Call node doing this).

Official Support

You can track the work on an official version of Cloud Spawning in this GitHub Issue.