Difference between revisions of "Allow Changing Texture and Mesh on a Structure"

From ARK Modding Wiki
Jump to navigation Jump to search
Line 9: Line 9:
 
In order to properly save any changes users make over server restarts you will need one variable per property that will change.
 
In order to properly save any changes users make over server restarts you will need one variable per property that will change.
 
In our case we will need one variable to identify the mesh, and one to identify the texture. A few different types could be used, but in order to keep the save game small and allow for efficient replication we will use one integer variable per property. ''Side Note: You could definitely use a byte variable in order to save even more space, but I am quite sure that UE4 will pad this to 4 bytes anyway. If you do happen to know how this is treated internally, make sure to update this article!''
 
In our case we will need one variable to identify the mesh, and one to identify the texture. A few different types could be used, but in order to keep the save game small and allow for efficient replication we will use one integer variable per property. ''Side Note: You could definitely use a byte variable in order to save even more space, but I am quite sure that UE4 will pad this to 4 bytes anyway. If you do happen to know how this is treated internally, make sure to update this article!''
 +
 +
To finish this step create two integer variables on your structure. Let's call them '''TextureId''' and '''MeshId'''.
 +
Set both variables to RepNotify and check the "save game" checkbox as seen in the image below.
 +
 +
== Step 2: Preparing GetMultiUseEntries ==
 +
If you have never worked with the MultiUse Menu in ARK make sure to get familiar with the basics before proceeding, so you can actually understand each step.
 +
In this part we will prepare the menu entries that allow users to select their preferred mesh or texture. To show this off we will create two texture entries and two mesh entries.
 +
Make sure your graph for '''GetMultiUseEntries''' looks similar to the image below.

Revision as of 13:55, 12 September 2017

In this guide we will go through the necessary steps to allow changing a structure's mesh and/or texture using a multi-use menu. The resulting structure will also save these changes to persist over server restarts and properly replicate them to all users.

Before starting this guide make sure you have a structure set up and ready. Make sure you have a way to spawn and place it in order to test if it works.

Step 1: Setting up variables

In order to properly save any changes users make over server restarts you will need one variable per property that will change. In our case we will need one variable to identify the mesh, and one to identify the texture. A few different types could be used, but in order to keep the save game small and allow for efficient replication we will use one integer variable per property. Side Note: You could definitely use a byte variable in order to save even more space, but I am quite sure that UE4 will pad this to 4 bytes anyway. If you do happen to know how this is treated internally, make sure to update this article!

To finish this step create two integer variables on your structure. Let's call them TextureId and MeshId. Set both variables to RepNotify and check the "save game" checkbox as seen in the image below.

Step 2: Preparing GetMultiUseEntries

If you have never worked with the MultiUse Menu in ARK make sure to get familiar with the basics before proceeding, so you can actually understand each step. In this part we will prepare the menu entries that allow users to select their preferred mesh or texture. To show this off we will create two texture entries and two mesh entries. Make sure your graph for GetMultiUseEntries looks similar to the image below.