I am making a mod. I'm struggling heavily on getting a custom block into the game. The block I'm currently try to add is a simple cube with a single texture placed on it.
I have been through a lot of hoops in the past 24 hours and at this current point it doesn't work at all, no matter what I try - even the original method I used no longer seems to work in any capacity, throwing errors every time.
I've tried using the MultiPlatformEAB script as well as the older ExportAssetBundle script. I have used Unity 5.3.8f2, 5.3.8b2, and 2020.3.34f1.
Currently it is giving me two errors when trying to load blocks.xml:
2022-05-25T18:45:44 35.595 ERR Model '#@modfolder(Steve's Recipes):Resources/willyBoi.unity3d?willyBoiPrefab' not found on block with name WILLIAM
2022-05-25T18:45:44 35.595 ERR XML loader: Loading and parsing 'blocks.xml' failed
2022-05-25T18:45:44 35.601 EXC Model '#@modfolder(Steve's Recipes):Resources/willyBoi.unity3d?willyBoiPrefab' not found on block with name WILLIAM
at BlockShapeModelEntity.PoolLoadCallback () [0x0002f] in <6a01347f98174dbdb41cb4a4eedf5af7>:0
at GameObjectPool.AddPooledObject (System.String name, GameObjectPool+LoadCallback _loadCallback, GameObjectPool+CreateCallback _createOnceToAllCallback, GameObjectPool+CreateCallback _createCallback) [0x00064] in <6a01347f98174dbdb41cb4a4eedf5af7>:0
at BlockShapeModelEntity.Init (Block _block) [0x00180] in <6a01347f98174dbdb41cb4a4eedf5af7>:0
at BlocksFromXml.ParseBlock (System.Boolean _bEditMode, System.Xml.XmlElement elementBlock) [0x00af0] in <6a01347f98174dbdb41cb4a4eedf5af7>:0
at BlocksFromXml+<CreateBlocks>d__0.MoveNext () [0x000fc] in <6a01347f98174dbdb41cb4a4eedf5af7>:0
at ThreadManager+<CoroutineWrapperWithExceptionCallback>d__48.MoveNext () [0x00044] in <6a01347f98174dbdb41cb4a4eedf5af7>:0
UnityEngine.StackTraceUtility:ExtractStringFromException(Object)
Log:Exception(Exception)
<>c__DisplayClass52_0:<loadSingleXml>b__2(Exception)
<CoroutineWrapperWithExceptionCallback>d__48:MoveNext()
UnityEngine.SetupCoroutine:InvokeMoveNext(IEnumerator, IntPtr)
Here is the block itself in blocks.xml:
<block name="WILLIAM">
<property name="CreativeMode" value="Player"/>
<property name="Material" value="Mcloth"/>
<property name="Shape" value="ModelEntity"/>
<property name="MaxDamage" value="1"/>
<property name="Place" value="TowardsPlacerInverted"/>
<property name="StabilitySupport" value="false"/>
<property name="Meshfile" value="#@modfolder:Resources/willyBoi.unity3d?willyBoiPrefab"/>
<property name="Model" value="#@modfolder:Resources/willyBoi.unity3d?willyBoiPrefab"/>
<drop event="Destroy" count="0"/>
<property name="FilterTags" value="MC_building,SC_loot"/>
</block>
As far as I'm aware, everything is correct in Unity as well:
Under Tag and Layer, I have tried (respectively): T_Block, T_Mesh_B. Default, RenderInTexture. The result is the same regardless of which tag or layer I have selected.
My question is simple; What am I doing wrong?
I would greatly appreciate any help here. I am really scratching my head, and while I am not super familiar with Unity, this has me stumped at a fundamental level.
MORE INFO:
When it did work, it only loaded as a semi-transparent pink square with no shader or material. This was done using the original EAB script (found here, on Nexus), using Unity 5.3.8f2. It did have collision, and it could be broken, but that was it. In an effort to fix the pink-ness, I tried to find more info about the process of making/exporting the asset, but could only find tutorials/resources for anything but blocks. When I tried exporting the file in Unity 5.3.8b2, it said 3 of the functions used in the script were deprecated. This led me to finding the newer MultiPlatform script, which when used in 5.3.8b2, exported a unity3d file that the game couldn't use. Then I found Xyth's A20 Tutorial, used Unity 2020, no luck there either.
I entered the tags listed on the A20 Tutorial into 5.3.8f2 to use, though I'm not sure if it was the correct thing to do. Throughout the exports and tests and I have been checking on the contents of the unity3d file with War3zuk's Asset Builder, and noticed that it still has most, if not all, of the assets it did when it just a pink block.
I used this as my main reference point for creating the model, saving it, etc. https://www.youtube.com/watch?v=pxzDvUHAeYs
(Yes it's my dog; just a test block)