Error prevents dungeons from loading

Discuss coding questions, pull requests, and implementation details.
Post Reply
User avatar
MeteoricDragon
Posts: 141
Joined: Mon Feb 12, 2018 8:23 pm

Error prevents dungeons from loading

Post by MeteoricDragon »

I'm using the latest updated master branch and I'm getting the following error when trying to enter Daggerfall castle
NullReferenceException: Object reference not set to an instance of an object
DaggerfallWorkshop.Utility.GameObjectHelper.InstantiatePrefab (UnityEngine.GameObject prefab, System.String name, UnityEngine.Transform parent, Vector3 position) (at Assets/Scripts/Utility/GameObjectHelper.cs:313)
DaggerfallWorkshop.Utility.RDBLayout.AddEnemy (RdbObject obj, MobileTypes type, UnityEngine.Transform parent, UInt64 loadID, Byte classicSpawnDistanceType, Boolean useGenderFlag) (at Assets/Scripts/Utility/RDBLayout.cs:1502)
DaggerfallWorkshop.Utility.RDBLayout.AddFixedRDBEnemy (RdbObject obj, UnityEngine.Transform parent, DaggerfallConnect.DFBlock& blockData, Boolean serialize) (at Assets/Scripts/Utility/RDBLayout.cs:1474)
DaggerfallWorkshop.Utility.RDBLayout.AddFixedEnemies (UnityEngine.GameObject go, .RdbObject[] editorObjects, DaggerfallConnect.DFBlock& blockData, Boolean serialize) (at Assets/Scripts/Utility/RDBLayout.cs:472)
DaggerfallWorkshop.Utility.GameObjectHelper.CreateRDBBlockGameObject (System.String blockName, System.Int32[] textureTable, Boolean allowExitDoors, DungeonTypes dungeonType, Single monsterPower, Int32 monsterVariance, Int32 seed, DaggerfallWorkshop.DaggerfallRDBBlock cloneFrom, Boolean importEnemies) (at Assets/Scripts/Utility/GameObjectHelper.cs:506)
DaggerfallWorkshop.DaggerfallDungeon.LayoutDungeon (DaggerfallConnect.DFLocation& location, Boolean importEnemies) (at Assets/Scripts/Internal/DaggerfallDungeon.cs:259)
DaggerfallWorkshop.DaggerfallDungeon.SetDungeon (DFLocation location, Boolean importEnemies) (at Assets/Scripts/Internal/DaggerfallDungeon.cs:116)
DaggerfallWorkshop.Utility.GameObjectHelper.CreateDaggerfallDungeonGameObject (DFLocation location, UnityEngine.Transform parent, Boolean importEnemies) (at Assets/Scripts/Utility/GameObjectHelper.cs:1266)
DaggerfallWorkshop.Game.PlayerEnterExit.TransitionDungeonInterior (UnityEngine.Transform doorOwner, StaticDoor door, DFLocation location, Boolean doFade) (at Assets/Scripts/Game/PlayerEnterExit.cs:788)
DaggerfallWorkshop.Game.PlayerActivate.Update () (at Assets/Scripts/Game/PlayerActivate.cs:312)
Followed by many Duplicate LoadID's.
DFTFU 1.7.7: Duplicate LoadID 29338429 detected for ActionObject object. This object will not be serialized.
UnityEngine.Debug:Log(Object)
DaggerfallWorkshop.DaggerfallUnity:LogMessage(String, Boolean) (at Assets/Scripts/DaggerfallUnity.cs:414)
DaggerfallWorkshop.Game.Serialization.SerializableStateManager:RegisterStatefulGameObject(ISerializableGameObject) (at Assets/Scripts/Game/Serialization/SerializableStateManager.cs:234)
DaggerfallWorkshop.Game.Serialization.SaveLoadManager:RegisterSerializableGameObject(ISerializableGameObject) (at Assets/Scripts/Game/Serialization/SaveLoadManager.cs:452)
DaggerfallWorkshop.Game.Serialization.SerializableActionObject:Start() (at Assets/Scripts/Game/Serialization/SerializableActionObject.cs:40)
I started getting this error after I updated to the latest master about 18 hours ago. (last night) and I get the error above even when I checkout a different branch I started 2 weeks ago (and haven't synced with latest content)

To try and fix this, I did a "git checkout master" then "git reset --hard upstream/master" and it said "HEAD is now at 6c3542d8 Remove certain invalid items on load" but the same error happens. I also get an error when trying to load a game where i'm already in a dungeon.
Attachments
Untitled-1.jpg
Untitled-1.jpg (214.89 KiB) Viewed 2223 times

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Error prevents dungeons from loading

Post by Hazelnut »

I've been getting the same, but only on my Linux laptop which I have not yet upgraded to Unity 2018.2.11f1 so I had attributed the error to that.

Do you use Linux?

Have you updated to Unity 2018.2.11f1? (actually not sure what the closest Linux release is)

What happens with the last live build?
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
MeteoricDragon
Posts: 141
Joined: Mon Feb 12, 2018 8:23 pm

Re: Error prevents dungeons from loading

Post by MeteoricDragon »

Hazelnut wrote: Tue Oct 23, 2018 10:42 pm I've been getting the same, but only on my Linux laptop which I have not yet upgraded to Unity 2018.2.11f1 so I had attributed the error to that.

Do you use Linux?

Have you updated to Unity 2018.2.11f1? (actually not sure what the closest Linux release is)

What happens with the last live build?
I use Unity 2018.1.5 and Windows 10. Sometimes when I start Unity I get a warning that the project was created with an older version and I just click continue. I've been doing that ever since Daggerfall Unity got upgraded to the latest Unity. I've never used one of the live builds available for the community. I just went straight to GitHub and used that version.

Sometimes when I go to commit changes to a branch one of the modifications wants me to change the projects version of unity to 2018.1.5. So I discard that change before committing.

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Error prevents dungeons from loading

Post by Hazelnut »

I could be wrong, but I strongly suspect this is an issue with a prefab created in Unity 2018.2 which doesn't work in 2018.1 - try upgrading to the new DFU version of unity which is 2018.2.11.f1
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
MeteoricDragon
Posts: 141
Joined: Mon Feb 12, 2018 8:23 pm

Re: Error prevents dungeons from loading

Post by MeteoricDragon »

Hazelnut wrote: Tue Oct 23, 2018 11:08 pm I could be wrong, but I strongly suspect this is an issue with a prefab created in Unity 2018.2 which doesn't work in 2018.1 - try upgrading to the new DFU version of unity which is 2018.2.11.f1
The only version i can find is 2018.2.13f1 Is that ok?

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Error prevents dungeons from loading

Post by Hazelnut »

Probably, but if you go to this page you'll find third one down is .2.11 https://unity3d.com/get-unity/download/archive
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

User avatar
MeteoricDragon
Posts: 141
Joined: Mon Feb 12, 2018 8:23 pm

Re: Error prevents dungeons from loading

Post by MeteoricDragon »

Success! Thanks much. That's what the problem was.

User avatar
Hazelnut
Posts: 3016
Joined: Sat Aug 26, 2017 2:46 pm
Contact:

Re: Error prevents dungeons from loading

Post by Hazelnut »

Hooray! Glad to help.
See my mod code for examples of how to change various aspects of DFU: https://github.com/ajrb/dfunity-mods

Post Reply