Everything Altspace

Attachment MRE Script (Demo)

4.2
(6)

To create a basic hat MRE all you need to do is upload the kit objects and refer to the artifact ID in the example script below. Feel free to edit and make changes as you see fit.

Modifying & Creating A Content Pack

The easiest way to get started on MREs is to create a simple attachable MRE that can attach to an object to a hand, finger, head or around the user. In terms of sophistication and options to make said attachment be locked to certain users only you are out of luck, as the basic attachment MRE is really just that… basic.

On the bright side, working with these content pack based MREs are simple and can be implemented in minutes once you are comfortable in making them.

Create a new content pack

Visit: https://account.altvr.com/content_packs

Create a new content pack and copy the sample code below. You can swap the artifactID’s for other prefabs from kits you own or have access to.

You will then need to make sure those kit objects don’t have collision on the objects enabled and make sure it spawns in at the correct scale which can be overridden inside the sample script and setting the position of the attachment.

JSON stands for JavaScript Object Notation

What is the scripting language used for content packs?

  • JSON is a lightweight format for storing and transporting data
  • JSON is often used when data is sent from a server to a web page or app. An example would be the event JSON file that contains the info of the location of world templates, description and the name of the host. Your headset downloads a JSON file for each event listed to populate in your feed the correct information such as timestamps for you.

If you want to learn about how JSON is formatted and the general rules that apply to creating content packs.

https://www.w3schools.com/whatis/whatis_json.asp

Basic configurable options for attachment MREs. Which can be toggled by changing the URI of the MRE URL.

Sample Script

{
  "logo2": {
    "scale": {
      "x": 0.1,
      "y": 0.1,
      "z": 0.1
    },
    "position": {
      "x": 0,
      "y": 0.13,
      "z": 0
    },
    "rotation": {
      "x": 0,
      "y": 180,
      "z": 0
    },
    "resourceId": "artifact:1712630440231175141",
    "attachPoint": "left-hand"
  },
  "tiara": {
    "scale": {
      "x": 0.3,
      "y": 0.3,
      "z": 0.3
    },
    "position": {
      "x": 0,
      "y": 0.15,
      "z": 0
    },
    "rotation": {
      "x": 0,
      "y": 0,
      "z": 0
    },
    "resourceId": "artifact:1707647645641605996"
  },
  "crown2": {
    "scale": {
      "x": 0.2,
      "y": 0.2,
      "z": 0.2
    },
    "position": {
      "x": 0,
      "y": 0.15,
      "z": 0
    },
    "resourceId": "artifact:1707647634107269988"
  },
  "options": {
    "previewMargin": 5
  },
  "goldcrown": {
    "scale": {
      "x": 0.3,
      "y": 0.3,
      "z": 0.3
    },
    "position": {
      "x": 0,
      "y": 0.15,
      "z": 0
    },
    "rotation": {
      "x": 0,
      "y": 0,
      "z": 0
    },
    "resourceId": "artifact:1707647669633024902"
  },
  "leaftiara": {
    "scale": {
      "x": 0.2,
      "y": 0.2,
      "z": 0.2
    },
    "position": {
      "x": 0,
      "y": 0.15,
      "z": 0
    },
    "rotation": {
      "x": 0,
      "y": 180,
      "z": 0
    },
    "resourceId": "artifact:1707647681687454606"
  },
  "bluepartyhat": {
    "scale": {
      "x": 0.2,
      "y": 0.2,
      "z": 0.2
    },
    "position": {
      "x": 0,
      "y": 0.15,
      "z": 0
    },
    "rotation": {
      "x": 0,
      "y": 0,
      "z": 0
    },
    "resourceId": "artifact:1707647657964471167"
  }
}

Building self-hosted custom MREs

How useful was this post?

Click on a star to rate it!

Average rating 4.2 / 5. Vote count: 6

No votes so far! Be the first to rate this post.

As you found this post useful...

Follow us on social media!

We are sorry that this post was not useful for you!

Let us improve this post!

Tell us how we can improve this post?