Open cukiakimani opened 8 years ago
Did you pick Window->HappyFunTimes->Export for HappyFunTimes?
Right now you can only run the games from HappyFunTimes. After you export it will create .zip files. Run happyfuntimes, drag and drop the zip file for your platform into the happyfuntimes window and it should install it. Alternatively you can pick Window->HappyFunTimes->Install into Local Happyfuntimes
I've almost got a version ready that no longer needs the external happyfuntimes program at all. It will just run as a normal unity program and none of the special exporting feature are needed
Hopefully I'll have that ready as the 2.0 version of the plugin in 2 or 3 weeks
-gregg
If you'd like to beta test the new 2.0 version you can get it here
Please BACKUP YOUR WORK. Copy your entire project to a new folder and try this in the new folder
Steps
Assets/Plugins/HFTRunner.cs
, Assets/Plugins/HappyFunTimes.dll
, and Assets/Plugins/Editor/HappyFunTimesEditor.dll
Assets
folder in that zip file to your project EXCEPT files you changed. For example if you have a custom Assets/WebPlayerTemplates/HappyFunTimes/controller.html
don't copy over that.PlayerSpawner
or PlayerConnector
script on one of your objects. (in the samples that's usually on an object called LevelManager
). That script is probably missing now so reconnect it. Click the circle next to "Missing Script" and select PlayerSpawner
or PlayerConnector
, which ever one you were using before.Assets/WebPlayerTemplates/HappyFunTimes
to Assets/WebPlayerTemplates/HappyFunTimes2
. Make sure Unity is the front app. Then rename back to
Assets/WebPlayerTemplates/HappyFunTimes
(this is because the new happyfuntimes has to copy files but it only copies new or modified files. Since your files already exist it can't tell. This rename makes it appear all the files are new).Things to note:
It exported a normal mac .app file in a bin folder. The bin folder being in the main project folder. It did throw the following errors. Even with those errors when I ran the exported .app file with happy fun times running. The game worked with controllers connecting to it just fine.
It only builds the open scene. Is there a way to build multiple scenes with this option?
System.ComponentModel.Win32Exception: ApplicationName='/Applications/HappyFunTimes.app/MacOS/bin/node', CommandLine='"/Applications/HappyFunTimes.app/MacOS/hft/cli/hft.js" "make-release" "/Users/Cukia/OneDrive/Development/Unity/Projects/happyfuntimes/bin" "--platforms=mac" "--json" "--src=/Users/Cukia/OneDrive/Development/Unity/Projects/happyfuntimes"', CurrentDirectory='/Users/Cukia/OneDrive/Development/Unity/Projects/happyfuntimes' at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0 at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0 at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start () at HappyFunTimesEditor.HFTCmdRunner.Run (System.String cmdPath, System.String[] arguments, System.String workingDirectory) [0x00000] in <filename unknown>:0 at HappyFunTimesEditor.HFTCmdRunner.HFTRun (System.String[] arguments, System.String workingDirectory) [0x00000] in <filename unknown>:0 at HappyFunTimesEditor.HFTExport.Export (HappyFunTimesEditor.Options options) [0x00000] in <filename unknown>:0 at HappyFunTimesEditor.HFTExportWindow.ExportHFT () [0x00000] in <filename unknown>:0 at HappyFunTimesEditor.HFTExportWindow.OnGUI () [0x00000] in <filename unknown>:0 UnityEngine.Debug:LogError(Object) HappyFunTimesEditor.HFTExportWindow:OnGUI() UnityEditor.DockArea:OnGUI()
and
NullReferenceException: (null) UnityEditor.SerializedObject..ctor (UnityEngine.Object obj) (at /Users/builduser/buildslave/unity/build/artifacts/generated/common/editor/SerializedPropertyBindings.gen.cs:68) HappyFunTimesEditor.HFTExportWindow.Init () HappyFunTimesEditor.HFTExportWindow.OnGUI () System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono-runtime-and-classlibs/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
System.ComponentModel.Win32Exception: ApplicationName='/Applications/HappyFunTimes.app/MacOS/bin/node', CommandLine='"/Applications/HappyFunTimes.app/MacOS/hft/cli/hft.js" "get-info" "DOgFIghting"', CurrentDirectory='/Users/Cukia/OneDrive/Development/Unity/Projects/happyfuntimes' at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0 at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0 at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0 at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start () at HappyFunTimesEditor.HFTCmdRunner.Run (System.String cmdPath, System.String[] arguments, System.String workingDirectory) [0x00000] in <filename unknown>:0 at HappyFunTimesEditor.HFTCmdRunner.HFTRun (System.String[] arguments, System.String workingDirectory) [0x00000] in <filename unknown>:0 at HappyFunTimesEditor.HFTExportWindow.ExportHFT () [0x00000] in <filename unknown>:0 at HappyFunTimesEditor.HFTExportWindow.OnGUI () [0x00000] in <filename unknown>:0 UnityEngine.Debug:LogError(Object) HappyFunTimesEditor.HFTExportWindow:OnGUI() UnityEditor.DockArea:OnGUI()
As of now what works is fine for now as I playtest the game. I will try the new HFT Unity plugin and let you know. Thanks! Love the plugin!
Try the new plugin. I'll cross my fingers it works
@greggman I tried the new plugin. It works okayish in the Unity Editor throws errors about
Could not load: HappyFunTimesAutoGeneratedDoNotEdit/scripts/bower_components/hft-utils/dist/2d.js
and the like but that's just on start up and then works fine.
I tried the build and that didn't work. It creates the server but connecting a controller throws these errors
GET http://10.0.0.6:18679/games/HFTUnity/scripts/bower_components/hft-utils/dist/audio.js Uncaught Error: Script error for: bower_components/hft-utils/dist/audio http://requirejs.org/docs/errors.html#scripterror
Try this
Assets/WebPlayerTemplates/HappyFunTimes
to Assets/WebPlayerTemplates/HappyFunTimes2
Assets/WebPlayerTemplates/HappyFunTimes2
back to Assets/WebPlayerTemplates/HappyFunTimes
Now try building again.
The new plugin needs to copy all the files but that folder but it only notices them when they are added or changed. Since in your case they already existed it didn't get a chance to copy them. Renaming should make it notice all the files
And please tell me if that fixes it 🙏
I did what you said. It stopped throwing the errors. Although the controllers are still not connecting. Here's what happens
If you touch to reset you just go through the same steps.
This is only in the build though. In the Unity Editor the controller connects and no errors.
Thanks for that info. That's really helpful! I will look into it
I uploaded a new version that seems to be work in builds. At least for me. It's still generating a few errors behind the scenes after you stop and start the game if controllers are waiting to reconnect. I'm trying to decide how best to deal with that and trying to decide how compatible to keep it with the previous system
In any case please give it a try using the steps listed above
I built a game with HappyFunTimes using unity and I don't know how to run a build? Works fine in the Unity editor, though.
I get the following when I point my controller to "happyfuntimes.net"
TypeError: Cannot read property 'originalGameId' of undefined at handleHappyFunTimesPingRequest ...
If I go straight to the ip address nothing happens just stays at "Waiting for game ..."
It's a OSX Build, btw.
Thanks. :)