Page 1 of 1

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

Posted: Sun Dec 04, 2016 7:51 am
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?

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

Posted: Sun Dec 04, 2016 9:05 am
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.

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

Posted: Sun Dec 04, 2016 10:00 am
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.

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

Posted: Sun Dec 04, 2016 2:51 pm
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.

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

Posted: Sun Dec 04, 2016 3:16 pm
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 ;)

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

Posted: Sun Dec 04, 2016 7:08 pm
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.

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

Posted: Sun Dec 04, 2016 9:31 pm
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. :)