skittles sour Posted November 27, 2021 Share Posted November 27, 2021 (edited) I'm doing a custom item for a custom game mode and I made a prefab like this: local function fn() local inst = SpawnPrefab"waterballoon" inst.prefab = "sfwaterballoon" inst:SetPrefabNameOverride"waterballoon" if not TheWorld.ismastersim then return inst end -- etc, where I remove stackable and weapon components and do a fix for the complexprojectile component and when I tested it on my client it worked out fine, but when I uploaded it onto the server, I've been getting this: when I spawn it with c_give, the server would be fine, and the rest of the people on the server would be fine, but my own client would crash, and in my log I find this: [00:00:43]: Assert failure '!mTransformationHistory' at /jenkins-buildmaster/workspace/DST_BuildGame_OSX/source/game/components/TransformComponent.cpp(446) [00:00:43]: Assert failure 'BREAKPT:' at /jenkins-buildmaster/workspace/DST_BuildGame_OSX/source/game/components/TransformComponent.cpp(446) Does anyone have ideas about what this assertion failure might be about? I'm doubly confused that it came from a file called transform component, since I did nothing with its Transform... Edited November 27, 2021 by Bad Willow Link to comment https://forums.kleientertainment.com/forums/topic/135668-assertion-failure-at-transformcomponentcpp/ Share on other sites More sharing options...
CarlZalph Posted November 27, 2021 Share Posted November 27, 2021 @Bad Willow Are you creating a new prefab that creates another prefab like this: local fn = function() local inst = SpawnPrefab("waterballoon") return inst end return Prefab("magicballoon", fn, assets, prefabs) Or are you doing something like: local GenerateCustomBalloon = function(arg1, arg2, arg3) local inst = SpawnPrefab("waterballoon") if not TheWorld.ismastersim then return end inst.Transform:SetPosition(arg1, arg2, arg3) end If you're trying to make prefabs inside of other prefab's init functions, then that'd start getting into questionable territory with entity initialization procedures. I'd recommend changing the code around to reflect similar to GenerateCustomBalloon's functionality so it's not a prefab-in-prefab nest. 2 Link to comment https://forums.kleientertainment.com/forums/topic/135668-assertion-failure-at-transformcomponentcpp/#findComment-1517373 Share on other sites More sharing options...
skittles sour Posted November 27, 2021 Author Share Posted November 27, 2021 (edited) I remembered that the different world prefabs such as "forest" or "shipwrecked" or "porkland", they all started by spawning a "world" prefab, so I thought that would work. Is this questionable territory specific to DST...? and has to do with juggling an instance between the client and the server? so that the world prefabs, being server exclusive, can actually be created like this and that other prefabs would cause a crash. Edited November 27, 2021 by Bad Willow Link to comment https://forums.kleientertainment.com/forums/topic/135668-assertion-failure-at-transformcomponentcpp/#findComment-1517526 Share on other sites More sharing options...
CarlZalph Posted November 27, 2021 Share Posted November 27, 2021 (edited) 3 hours ago, Bad Willow said: I remembered that the different world prefabs such as "forest" or "shipwrecked" or "porkland", they all started by spawning a "world" prefab, so I thought that would work. Is this questionable territory specific to DST...? and has to do with juggling an instance between the client and the server? so that the world prefabs, being server exclusive, can actually be created like this and that other prefabs would cause a crash. Not sure how it's handled in singleplayer, but in DST the different worlds use "MakeWorld" rather than "Prefab" for their variants, which then call "Prefab" once per world type during creation. (See: scripts/prefabs/world.lua for MakeWorld function) I suspect by having it try to make a prefab in a prefab that there's some entity initialization happening twice when it shouldn't be. Edited November 27, 2021 by CarlZalph 2 Link to comment https://forums.kleientertainment.com/forums/topic/135668-assertion-failure-at-transformcomponentcpp/#findComment-1517556 Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now