Skip to content
This repository has been archived by the owner on Jul 9, 2023. It is now read-only.

Compile the Game

Theoyeah edited this page Dec 25, 2022 · 29 revisions

You want to compile and test your stuff, but you don't know how ?
Here’s a tutorial of how you can do it without being scared of making something wrong.

This wiki contains:

Installing the Required Programs:

First, you need to install Haxe and HaxeFlixel. You must have haxe 4.2.4 for having less chances to have bugs Haxe (4.2.4), seriously, stop using 4.1.5, it misses some stuff. Install HaxeFlixel after downloading Haxe (here’s a tutorial, and here’s the download page thing).

Then, you have to install a couple things

Download Git SCM. Works for Windows, Mac, and Linux, just select your build. Follow instructions to install the application properly. Run haxelib git polymod https://github.com/larsiusprime/polymod.git to install Polymod. Run haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc to install Discord RPC. You should have everything ready for compiling the game! Follow the guide below to continue!

At the moment, you can optionally fix the transition bug in songs with zoomed-out cameras.

Short code:

Other installations you'd need are the additional libraries, a fully updated list will be in Project.xml in the project root. Currently, these are all of the things you need to install:

  • flixel
  • flixel-addons
  • flixel-ui
  • hscript
  • newgrounds
  • hxCodec

So for each of those type haxelib install [library] so shit like haxelib install flixel So you have to copy and paste this code for the short code:

haxelib install flixel
haxelib install flixel-addons
haxelib install flixel-ui
haxelib install hscript
haxelib install newgrounds
haxelib install hxCodec

After, if you don't need the Long code just scroll down and continue the setup at LuaJIT

Long code:

Now, if you want the long code (best for programmers):

For Linux copy and paste this code:

haxelib setup ~/haxelib
haxelib install hxcpp > /dev/null
haxelib install lime
haxelib install openfl
haxelib --never install flixel
haxelib run lime setup flixel
haxelib run lime setup
haxelib install flixel-tools
haxelib install flixel-ui
haxelib install flixel-addons
haxelib git flixel-addons https://github.com/HaxeFlixel/flixel-addons
haxelib install tjson
haxelib install hxjsonast
haxelib install hscript
haxelib git hscript-ex https://github.com/ianharrigan/hscript-ex
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib install hxcpp-debug-server
haxelib list
haxelib install hxCodec

For Windows copy and paste this code:

haxelib setup C:/haxelib
haxelib install hxcpp > nul
haxelib install lime
haxelib install openfl
haxelib --never install flixel
haxelib run lime setup flixel
haxelib run lime setup
haxelib install hxCodec
haxelib install flixel-tools
haxelib install flixel-ui
haxelib install flixel-addons
haxelib git flixel-addons https://github.com/HaxeFlixel/flixel-addons
haxelib install tjson
haxelib install hxjsonast
haxelib install hscript 
haxelib git hscript-ex https://github.com/ianharrigan/hscript-ex
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib install hxcpp-debug-server
haxelib list

For Mac copy and paste this code:

haxelib setup ~/haxelib
haxelib install hxcpp > /dev/null
haxelib install lime
haxelib install openfl
haxelib --never install flixel
haxelib run lime setup flixel
haxelib run lime setup
haxelib install flixel-tools
haxelib install flixel-ui
haxelib install flixel-addons
haxelib git flixel-addons https://github.com/HaxeFlixel/flixel-addons
haxelib install tjson
haxelib install hxjsonast
haxelib install hscript
haxelib git hscript-ex https://github.com/ianharrigan/hscript-ex
haxelib git discord_rpc https://github.com/Aidan63/linc_discord-rpc
haxelib install hxcpp-debug-server
haxelib install hxCodec
haxelib list

after this you will need to install LuaJIT.

To install LuaJIT do this: haxelib git linc_luajit https://github.com/nebulazorua/linc_luajit on a Command prompt/PowerShell (if you already had LuaJIT and it gives you an error about StatePointer when using Lua, run haxelib remove linc_luajit into Command Prompt/PowerShell, then re-install linc_luajit (haxelib git linc_luajit https://github.com/nebulazorua/linc_luajit)).

...Or if you don't want your mod to be able to run .lua scripts, delete the "LUA_ALLOWED" line on Project.xml.

Now, how to compile

To run it from your desktop (Windows, Mac, Linux) it can be a bit more involved. For Linux, you only need to open a terminal in the project directory and run lime test linux -debug (-debug is optional) and then run the executable file in export/debug/linux/bin if you wrote the debug thing, if not, it will be in export/release/linux/bin. For Windows, you need to install Visual Studio Community 2019. While installing VSC, don't click on any of the options to install workloads. Instead, go to the individual components tab and choose the following:

  • MSVC v142 - VS 2019 C++ x64/x86 build tools
  • Windows SDK (10.0.17763.0)

Once that is done you can open up a command line in the project's directory and run lime test windows -debug (-debug is optional). Once that command finishes (it takes forever even on a higher end PC), you can run FNF from the .exe file inside export\debug\windows\bin if you wrote the debug thing, if not it will be in export\releases\windows\bin, As for Mac, lime test mac -debug (-debug is optional) should work, if not the internet surely has a guide on how to compile Haxe stuff for Mac.

For compiling in 32 bits, just do the same line to compile but add an -32, after the compiling is done, look at export\32bit

How I can know if the compile is correct?

Well, if at 1 minute (unless your pc isn't a gamer one then just wait at least 3-5 mins of compilation the compilation hasn’t break or stopped the compilation, it works! (At least you can run the file)

If not, read the errors and file them the way the error says.

And if you can’t find a solution for your problem, write an help issue.