Gang Beasts
109 valoraciones
[BROKEN] Importing Custom Hat Models
Por HEX: Bleeding Heart
Modelers! Interested in adding your own unique spin to your play sessions?
Learn how to import your own custom content into Gang Beasts!
   
Premio
Favoritos
Favorito
Quitar
What you will need to download
None of this works any more. Period. No I will not fix it.




Here are the tools you will need to get started modding Gang Beasts:

1. Blender[www.blender.org]

2. Unity Assets Bundle Extractor[7daystodie.com]

3. Unity3D[www.unity3d.com]
Getting Started
Before we begin any modding, it's important to back up the files we're going to be using so that we can easily revert back to a fresh start if we need to.

Go into your common/Gang Beasts folder and rename your "sharedassets1.assets" to "original_sharedassets1.assets"

While we're in here, it's good practice to stay organized, so make a new folder in the root Gang Beasts directory named "Injections" so that we can easily access all our custom files.

Next, go ahead and open up Blender and delete the default cube, camera, and light.

Then open up Unity 3D and create a new project. Name it "Gang Beasts Injections" or something like that.

Finally, open up the Unity Assets Bundle Extractor. At the time of this writing the latest version is 1.8c, which we'll be using in this tutorial since it's the most stable build.
1. Extracting the hat we want to replace
To more easily see what we're doing, it's generally a good idea to import the hat that you're trying to replace into Blender. To do this, we'll need to start with the Unity Assets Bundle extractor.

Go ahead and open up "original_sharedassets1.assets" that we set up in the Getting Started section and arrange it by name.

Scroll down to the lower case "c" section where all the costume meshes are stored. For this tutorial we will be replacing "costume_luchadorMask01". To extract the mesh into a format that Blender can use, click the mesh once and then click on plugins. There you will find "export to .obj". Go ahead and extract it to your Injections folder.

2. Importing the hat into Blender for reference
After deleting everything in the scene, go up to file > import > Wavefront OBJ and before you double click your chosen mesh in your injections folder, change the settings in the bottom left.

In the bottom left, change the import settings to "Z Up". Forward will automatically change to "-X Forward", however this is not correct. Change it to "Y Forward" and click OK.

We now have our reference mesh in Blender.

Next we're going to go to the create panel and scroll down to the "Other:" section and click "Armature".

As long as you didn't move the 3D cursor, this should create a single bone at (0,0,0). If you accidentally moved the 3D cursor and the bone is not in the center of the model, press Spacebar and type "Clear location" and hit enter. The bone will jump to (0,0,0).

You should now have the following:

3. Modeling your custom hat
If you haven't already, you can now use this reference to model your hat knowing exactly what location it will appear at in-game.

I've gone ahead and modeled a wizard hat.


This tutorial will not be covering custom textures and materials, so there is no need to UV map your mesh, as we will be using the default player color as the material.

I will be covering custom textures and materials in a different tutorial or as an update to this one since it's a bit more advanced.

We can now delete our reference mesh.

Next, go ahead and click on your custom mesh and name it something fitting such as "wizard_hat". Then press Spacebar and type "Apply Object Transform". Hit enter and check all 3 boxes in the bottom left.

You should now have something like this:


Next we will parent the custom hat to the single bone. Select your mesh, then "Ctrl + Right Click" on the bone and hit "Ctrl + P". If you did it correctly, your mesh will be outline in red, the bone in orange, and there will be an option that says "Armature Deform -> with Automatic Weights". Click that one.

(This is necessary because most hats use "skinned mesh renderers" in Unity. If your hat does not have a bone, it will be counted as a static mesh and the game will crash when you try to replace any of the models. I originally couldn't figure out the reason this was happening, so I painstakingly replaced each vertex in the already skinned mesh by hand in the model.txt file. It worked, but I would not recommend it to friends.)

Now that the mesh is skinned to the bone, we can export it to Unity for compilation!

Go up to file > export > FBX (.fbx)

The default settings should be fine. Make sure it's set to "-Z Forward" and "Y Up".

Now let's move on to Unity.
4. Importing and compiling in Unity
In your empty Unity project, drag and drop your custom model "wizard_hat.fbx" into the root "Assets" folder. Once it's imported, go ahead and drag and drop it anywhere into the scene and save the scene.

Next, go to File > Build Settings

Choose PC, Mac, & Linux Standalone and click build.


In the Data folder of your compiled game, copy "SharedAssets0.assets" to your Injection folder.

Important: DO NOT accidentally replace Gang Beasts' "SharedAssets0.assets" otherwise you'll have to re-install the game. You might want to back up that one too just in case you do this.

Next we will be going back to the Unity Assets Bundle Extractor.
5. Extracting your mesh from your Unity game
In the Unity Assets Bundle Extractor, open up your SharedAssets0.assets.

Near the top, you will see the name of your mesh followed by the type "Mesh".

Click on this one and click "Export Dump" at the right and name it "wizard_hat.txt" or something similar.


Click OK at the bottom and open "original_SharedAssets1.assets" from earlier.

Arrange it by name and scroll down to "costume_luchadorMask01" once more. Next, click "costume_luchadorMask01" once and click "Import Dump" and browse to your custom "mesh.txt". After you hit OK, it will seem like nothing has changed. This is because the program does not update until after you save it and re-open it, so rest assured that the model was replaced.

Next go to File > Save and it will prompt you to save a new file. Go ahead and delete the "Original_" so that the file name is now "SharedAssets1.assets".

Now you can start the game!





Note: If your mesh is not the correct rotation or otherwise needs to be edited, please proceed to the next section to see how to fix it.
My hat's not right
Occasionally the rotation will be messed up due to how the transforms are handled once they're in game. Simply make note of what needs to be changed, such as rotation 90 forward or backwards or increase of scale, and go back to Blender.

You do not have to unparent your mesh or anything to edit it, however there is one thing to note: You must NOT edit it in object mode. Click on your mesh and go into Edit mode before making any changes or things will get even more messed up in-game.

IMPORTANT: The Unity Assets Bundle Extractor is still a bit unstable. Because of this, it will crash if you attempt to overwrite files. Make sure you delete both "SharedAssets1.assets" and "Mesh.txt" before attempting to export/save either.

"My Hat isn't using the correct material!"

If you overwrote a hairpiece, the mesh will be using the black material for your model. As you can see by the cowboy hat I made for the suit, I was able to redirect the hairpiece's material to the standard player color rather than black. To do this, I had to edit the model's skinned mesh renderer. It's a bit complicated to find for each costume, so I will be making a list of them at a later date. If you need it changed, feel free to leave a message on my profile stating which skinned mesh renderer you're looking for and I will look it up for you.
How to access unimplemented hats
As you scroll through the costume meshes, you will probably notice a lot of awesome hats the developers are going to be implementing in the next version (at the time of this writing it is 0.3.0).

If you want to access these hats, open up your "Original_SharedAsssets1.assets" and arrange it by name as usual.

This time scroll down to the capital "G" section where the game objects are kept. Scroll down to "GameObject costume_noveltyBurgerHat" for example. Notice how there are 2 of them. You only need to export one of these.

Click "View Data" on one of them. Double click "GameObject Base" then click the plus next to "vector_component", then click the plus next to "Array". If you see any other numbers besides "0", it's the other one. It should be the one with less "vector_components".

Click "Export Dump" on the smaller of the 2, and open it up in notepad. Change "string m_Name" to the name of the game object you're going to replace. In my case, I replaced "costume_noveltyBurgerHat" with "costume_luchadorMask01".

Next, scroll down to "GameObject costume_luchadorMask01" and press "Import Dump" on the top one. Replace it with your edited noveltyburgerhat text file. Do the same for the second "GameObject costume_luchadorMask01".

Save the file as "sharedassets1.assets" and start the game.


There are some great hats hidden in there!
67 comentarios
Roasty My Toasty 11 FEB 2024 a las 10:19 a. m. 
can you please update this link:https://dl.dropboxusercontent.com/u/73643078/examples/awards/New%20folder/sharedassets1.assets pls iave the old version but everytime i do this it just crashes:steamfacepalm:
proklik 18 DIC 2023 a las 10:14 p. m. 
will they ban me fo this?
KnifeTradeMethodeF1Zik 16 JUL 2023 a las 9:02 a. m. 
pls fix
Byka Clyat 2 MAR 2023 a las 1:34 p. m. 
Yeah you better fokin fix it now if Ninguem says so
**Ninguém** 2 MAR 2023 a las 1:21 p. m. 
fix it now
Fark Boongus 23 JUL 2022 a las 3:15 p. m. 
the guy made a new unity asset bundle extractor? is it possible to do now or nah?
Hazel 7 MAY 2022 a las 10:03 a. m. 
Guys, it doesn't work anymore. Stop trying to do it.
Gaming. 11 FEB 2022 a las 1:57 p. m. 
This is possible, you could get older versions using this guide
Eisenmangal 1 MAR 2021 a las 1:21 p. m. 
why is a thing that doesnt evan work any more in the top 3 guides XD
EthanJamesBarron 14 NOV 2019 a las 2:18 p. m. 
Ok I got blender 2.74 like in here but I cant find import settings