7days2mod/MedievalA14

Add Medieval Prefabs from a13

StompyNZ opened this issue · 17 comments

Need to convert all the alpha13 prefabs to a14 versions and add to the mixer

Might be worth waiting for A15 as its possible the IDs will need to be changed again. That being said, I imagine it would be easier to work with real prefab files rather than having to deal with a game save. So maybe it wouldn't be that big of a deal in A15 - I suspect the bigger hassle is that you have to actually go save the prefabs from the gamesaves in the first place - no?

The ones in the region files will be a bit trickier. I will have to load the game up with the right version and blocks file, then export them to tts files, after that ill have to run them through a bunch of id changes in hals editor. Thankfully I can run the id changes on all prefabs in the folder so I only have to do it once for all of them.

As such exporting the region files into tts files will be my first step :)

Added a bunch of prefabs into https://github.com/StompyNZ/7-Days-To-Die-Medieval/tree/master/Mods/a13prefabstoconvert as a first step in updating them to a14

Round one of trim and split complete.

Next up is the regions loki sent for extraction.

Hey guys, if it helps I made a version of the prefab converter I do for Mag and combopack with the block map you made in the repo. You can grab it here. Just choose the "Medieval A13-A14" option

I'm not running the medieval mod atm so not sure if it's right but if it needs tweaking just let me know

Thanks Danny (Hal I assume?)

I will have a look at it later today if I get a chance (got a big job tonight to prep for), or on the weekend and let you know if I have any problems :)

All region files have been converted to prefabs, some still need some work to tidy up but will convert to a14 before doing any work on them

Having issues with cobblestones.

I get errors after doing a conversion on my castle so might need to try converting all cobblestone to flagstone for the conversion. I know other prefabs use cobble too so I hope its only the ramps causing the problems.

Hi Stompy,

Yeah it's Hal from the forums ^^ what's the error you're getting? If it's something like rotations I can try auto-correcting in the converter if I know which is throwing problems.

I can't remember the exact error but I can get the log for it later. I suspect rotations, though, and something about division by 0. When it happens the chunks stop loading. I had 6 cobble ramps, which I took out, but still getting the error. There was also two vanilla block changes that the converter didn't catch but that was easy enough to fix manually.

This is the prefab I'm working on atm if you wanted a test file to work with ;)
https://github.com/7days2mod/Medieval/blob/master/Mods/a13prefabstoconvert/medieval_castle_01(StompyNZ).tts

2016-08-12T00:35:50 51.212 ERR Exception in thread thread_Regenerating:
2016-08-12T00:35:50 51.212 EXC Division by zero
DivideByZeroException: Division by zero
at BlockShapeNew.PM (Single , Int32 ) [0x00000] in :0
at BlockShapeNew.renderFace (BlockValue _blockValue, Vector3 _drawPos, BlockFace _face, UnityEngine.Vector3[] _vertices, UnityEngine.Color[] _colors, .VoxelMesh[] _meshes) [0x00000] in :0
at MeshGenerator.createMesh (Vector3i _worldPos, Vector3 _drawPosOffset, Vector3i _start, Vector3i _end, .VoxelMesh[] _meshes, Boolean _bCalcAmbientLight, Boolean _bOnlyDistortVertices) [0x00000] in :0
at MeshGeneratorMC2.createMesh (Vector3i _worldPos, Vector3 _drawPosOffset, Vector3i _start, Vector3i _end, .VoxelMesh[] _meshes, Boolean _bCalcAmbientLight, Boolean _bOnlyDistortVertices) [0x00000] in :0
at MeshGenerator.GenerateMesh (Vector3i _chunkPos, Int32 _layerIdx, .VoxelMesh[] _meshes) [0x00000] in :0
at ChunkCluster.RegenerateChunk (.Chunk _chunk, .Chunk[] _neighbours, .Logger _debugLog) [0x00000] in :0
at ChunkManager.GM (System.Collections.Generic.List`1 , Boolean , .Logger ) [0x00000] in :0
at ChunkManager.thread_Regenerating (.ThreadInfo _threadInfo) [0x00000] in :0
at ThreadManager.F (System.Object ) [0x00000] in :0
UnityEngine.DebugLogHandler:Internal_LogException(Exception, Object)
UnityEngine.DebugLogHandler:LogException(Exception, Object)
UnityEngine.Logger:LogException(Exception, Object)
UnityEngine.Debug:LogException(Exception)
Logger:masterLogException(Exception)
Logger:Exception(Exception)
Log:Exception(Exception)
ThreadManager:F(Object)

(Filename: Line: -1)

https://github.com/7days2mod/Medieval/blob/castle_convert/Data/Prefabs/medieval_castle_01(StompyNZ)x.tts

Here's my a14 updated prefab that is giving the errors and the rwg to spawn it at 0,0 (in the castle_convert branch)

From a quick look at the code it seems to be a problem with UV mapping for the texture on a block. Thanks for the links, I'll try and spin up a Medieval mod install and see if I can find the problem. Might be the weekend before I get chance but I'll let you know if I find anything.

ok thanks, I'll have a look at some of the other prefabs and see if I get any issues there as well :)

Hey guys,

Sorry for the delay getting back to you. I spun up the mod and tested the prefab. It's a problem with the XML for block 534 (Brazier). The texture location specified must not exist anymore in A14. Changing it to something I knew work work (e.g. "Texture" value="74") sorted it out and allowed the prefab to load.

I've run a test on the rest of the blocks and it looks like that's the only issue for textures.

Thanks Hal,

I assume it was texture 433 then that got removed, I'm guessing that was the damaged cobblestone texture.

If that's the case then 1647 "Fireplace Block" will have the same problem as it uses texture 433 as well.

Yeah I wrote a script that loaded all the blocks to check for errors and 534 was the only one that borked but just tried it manually and the Fireplace Block is invisible when you try and place it so I think you're right with the texture being removed