Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue Compiling Psych Engine 1.0.1 on Linux #16195

Closed
InfinityAX opened this issue Jan 25, 2025 · 4 comments
Closed

Issue Compiling Psych Engine 1.0.1 on Linux #16195

InfinityAX opened this issue Jan 25, 2025 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@InfinityAX
Copy link

Describe your problem here.

I am having an issue trying to compile the source code for the Psych Engine. I managed to trace down this line that is causing the /home/ax/haxelib/flxanimate/git/flxanimate/animate/FlxElement.hx:146: characters 39-40 : Unexpected ? error.
Image
I am not sure if it is a bug or I have done something wrong. I followed all the instructions in the BUILD.md file and ran the UNIX.sh setup file. I am using Debian 12.9 as my Linux distro.

Are you modding a build from source or with Lua?

Source

What is your build target?

Linux

Did you edit anything in this build? If so, mention or summarize your changes.

No

@InfinityAX InfinityAX added the help wanted Extra attention is needed label Jan 25, 2025
@NotHyper-474
Copy link

NotHyper-474 commented Jan 26, 2025

Debian 12 is still at Haxe 4.2.5 when Psych 1.0.1 requires at least Haxe 4.3.4. You'll have to manually install Haxe through a binary. You can get one here https://haxe.org/download/file/4.3.4/haxe-4.3.4-linux64.tar.gz/

@InfinityAX
Copy link
Author

InfinityAX commented Jan 27, 2025

Thanks for the suggestion. I tried installing the binaries for Haxe and Neko. Unfortunately, I am now tuning into this error.

Image

The library path is set to /home/ax/haxelib.

Image

@InfinityAX
Copy link
Author

After some trial and error. I was unable to get the the binaries to work. However, I found a work around to get the engine to compile on Haxe 4.2.5. I will reply with the instructions for anyone else who wants compile with the older version.

@InfinityAX
Copy link
Author

InfinityAX commented Jan 27, 2025

Workaround (Tested with Haxe 4.2.5):

Step 1: Modify the flxanimate library by changing line 156 in /flxanimate/git/flxanimate/animate/FlxElement.hx from params.firstFrame = element.SI.FF ?? 0; to params.firstFrame = element.SI.FF;. Removing the check for null is the best solution I can find since changing it to params.firstFrame = (element.SI.FF == null) ? 0 : element.SI.FF; outputs /flxanimate/git/flxanimate/animate/FlxElement.hx:156: characters 42-46 : On static platforms, null can't be used as basic type Int.

Step 2: Change line 224 in /source/backend/ui/PsychUIInputText.hx from static final ignored:Array<FlxKey> = [SHIFT, CONTROL, ESCAPE]; to final ignored:Array<FlxKey> = [SHIFT, CONTROL, ESCAPE];. To be honest, I do not know why this works or what cascading consequences removing static will have.

Step 3: Change line 57 in /source/backend/ui/PsychUICheckBox.hx from function set_checked(v:Bool) to function set_checked(v:Null<Bool>). This allows the function to accept null.

Notes:

  1. If you have a better solution for any of these issues, please let me know.
  2. These changes may result in instability and unexpected behavior in the engine. Use at your own risk.
  3. I will not create a pull request for these changes due to the previous note and the fact that anything older than Haxe 4.3.4 is explicitly unsupported.
  4. Debian 12.9 Compiled Engine

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants