Cloud spawning

From Resonite Wiki
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.

Cloud Spawning is the unofficial term used to describe the action of spawning an item from a user's inventory programmatically. It is currently unsupported officially.

Methods

Although cloud spawning is not officially supported, several methods have been developed by the community to achieve it.

Copy & Paste

This method allows you to spawn an item by pressing a button, which will:

  1. Copy the resdb link to the clipboard with a ButtonClipboardCopyText component.
  2. Simulate keyboard inputs to paste it with the VirtualMultiKey component, spawning the item.

The benefit of this method is that it supports all links which may normally be spawned into Resonite (such as resrec, resdb and http).

This is at the disadvantage of only being triggerable by pressing a button. This means there is no way to use this method without user interaction.

RedX uses a similar method to spawn out items.

Setup

  1. Attach both components to a slot which has a button component.
  2. Attach the ButtonClipboardCopyText component.
  3. Set the ButtonCliboardCopyTest component to copy the link to the asset you want to cloud spawn.
  4. Attach the VirtualMultiKey component.
  5. Set the VirtualMultiKey component to the LeftControl and V keys.
  6. Activate the button to spawn the asset.

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 copy the resdb link to the clipboard.

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.
  3. Place your item's resdb in the the URL field.
  4. Attach the FileMetadata component.
  5. Within the Filename field, fill in any name ending with one of the following file extensions. Filling in MIME is not required.
    • .brson
    • .7zbson
    • .lz4bson
  6. Attach a button component to the slot or the parent slot, then trigger it to spawn the item.

    Alternatively, open the FileMetadata Sync Methods using the Show Delegates mod, and with the ProtoFlux Tool, grab and hold the OnImportFile method. Open the context menu while still holding it and select Proxy.

ProtoFlux Setup

An example of how to use ProtoFlux to cloud spawn.
An example of how to use ProtoFlux to cloud spawn.

With the Method Proxy node, connect the OnImportFile method to anything that can send an impulse. The example shows a Call node doing this.

Official Support

You can track the current status on the official version of Cloud Spawning in this GitHub issue.