Trying to build the latest version of DFU in Unity 5.3.0f4. Getting compiling errors.

Post here if you need help getting started with Daggerfall Unity or just want to clarify a potential bug. Questions about playing or modding classic Daggerfall should be posted to Community.
Post Reply
R3V01t!
Posts: 8
Joined: Sat Oct 03, 2015 4:34 am

Trying to build the latest version of DFU in Unity 5.3.0f4. Getting compiling errors.

Post by R3V01t! »

I'm trying to build the latest version of Daggefall Unity with Unity 5.3.0f4, but I seem to get compiling errors all of a sudden. It worked previously, and I was play-testing it for a few hours, but it seems now I can even play it in the editor window, or build it no less. I checked the Getting Started manual, but everything seems to be in order.

I tried deleting the project files as well, and started over, but no dice. In the inspector, there's a warning saying that "the associated script cannot be loaded. Please fix any compile errors and assign a valid script". Can anyone tell me how to solve this?

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Trying to build the latest version of DFU in Unity 5.3.0f4. Getting compiling errors.

Post by R.D. »

Did you edit the code some? If you didn't mean to or don't have any changes you want to save, you could try resetting your DFU repository. If you are using Git Bash, cd to your repository, type "git checkout master" (only necessary if you are on a branch other than master) and then "git reset --hard." This should get rid of any changes you made to the files. Then open it in Unity again and it should be fine.

The other option of course is to try to fix the compile errors, assuming that is in fact the problem.

BTW resetting the repository should also undo any automatic changes made by Unity when you open the project. I've sometimes found Unity unresponsive and not letting me start the game in the editor. I don't know what the cause is but resetting the repository always seems to fix it.

R3V01t!
Posts: 8
Joined: Sat Oct 03, 2015 4:34 am

Re: Trying to build the latest version of DFU in Unity 5.3.0f4. Getting compiling errors.

Post by R3V01t! »

R.D. wrote:Did you edit the code some? If you didn't mean to or don't have any changes you want to save, you could try resetting your DFU repository. If you are using Git Bash, cd to your repository, type "git checkout master" (only necessary if you are on a branch other than master) and then "git reset --hard." This should get rid of any changes you made to the files. Then open it in Unity again and it should be fine.

The other option of course is to try to fix the compile errors, assuming that is in fact the problem.

BTW resetting the repository should also undo any automatic changes made by Unity when you open the project. I've sometimes found Unity unresponsive and not letting me start the game in the editor. I don't know what the cause is but resetting the repository always seems to fix it.
I downloaded the repository myself. I did not clone it.

I'm pretty sure I did not mess with the code either. I made sure that I deleted everything first and extracted the files from the archive to project folder and opened the project again. It still does the same thing.

R.D.
Posts: 379
Joined: Fri Oct 07, 2016 10:41 am

Re: Trying to build the latest version of DFU in Unity 5.3.0f4. Getting compiling errors.

Post by R.D. »

I don't know then. Here's a forum thread talking about the same issue.
https://forum.unity3d.com/threads/gener ... ed.185994/

The solutions they talk about seem to generally be deleting things, which it sounds like you've tried, but maybe a solution in there will work, or maybe someone else here can offer an idea.

User avatar
Nystul
Posts: 1501
Joined: Mon Mar 23, 2015 8:31 am

Re: Trying to build the latest version of DFU in Unity 5.3.0f4. Getting compiling errors.

Post by Nystul »

check if API-Compatibility Level under Edit->Project Settings->Player->Optimization is set to ".NET 2.0" and not ".NET 2.0 Subset".
this once caused problems for me ;)

R3V01t!
Posts: 8
Joined: Sat Oct 03, 2015 4:34 am

Re: Trying to build the latest version of DFU in Unity 5.3.0f4. Getting compiling errors.

Post by R3V01t! »

Alright I seemed to figure out what was wrong. Mesh.Optimize(), as of Unity 5.5.05b, is obsolete and is no longer viable. Removing the functions completely from MeshReader.cs seems to work, and I can play the game again.

User avatar
Interkarma
Posts: 7236
Joined: Sun Mar 22, 2015 1:51 am

Re: Trying to build the latest version of DFU in Unity 5.3.0f4. Getting compiling errors.

Post by Interkarma »

Daggerfall Unity requires minimum 5.4.0f3 (not 5.3.x), which should explain the initial problems. You can download a specific version from here.

Unity 5.5 just came out of beta and I haven't checked for compatibility yet. Thanks for your feedback on Mesh.Optimize. It was considered a best practice for procedural meshes back in the 4.x days, but not sure it actually accomplished anything. I'll simply remove later when I add 5.5. support.

Cheers. :)

Post Reply