-
Notifications
You must be signed in to change notification settings - Fork 2.4k
[BACKEND] New scripting backend using cppia
#5087
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
base: develop
Are you sure you want to change the base?
Conversation
"ref": "d914cac17779efad8b3aa6f4a12dff566518d1b9", | ||
"url": "https://github.com/lemz1/hscript" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporary compilation fix
will be removed when we remove hscript entirely
@@ -503,7 +503,7 @@ class Project extends HXProject { | |||
FEATURE_POLYMOD_MODS.apply(this, true); | |||
FEATURE_FUNKVIS.apply(this, true); | |||
FEATURE_PARTIAL_SOUNDS.apply(this, true); | |||
FEATURE_VIDEO_PLAYBACK.apply(this, true); | |||
FEATURE_VIDEO_PLAYBACK.apply(this, false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporary change to fix compilation issues
@@ -525,7 +525,7 @@ class Project extends HXProject { | |||
|
|||
// Should be true on desktop, release, non-tester builds. | |||
// We don't want testers to accidentally leak songs to their Discord friends! | |||
FEATURE_DISCORD_RPC.apply(this, isDesktop() && !FEATURE_DEBUG_FUNCTIONS.isEnabled(this)); | |||
FEATURE_DISCORD_RPC.apply(this, isDesktop() && !FEATURE_DEBUG_FUNCTIONS.isEnabled(this) && false); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
temporary change to fix compilation issues
Promoted to |
maybe need to include definition for abstracts
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would it be possible to just use the haxe installation the user already has? Copying the entire haxe repository seems a bit much, especially considering it'll be extremely difficult to maintain.
No, since this would require people to install haxe when they want to play friday night funkin. Also every user, should have the same haxe version, and by shipping the game with the compiler this requirement is satisfied.
We aren't copying the entire haxe repository, later on i will implement fetching the binaries from the releases in the haxe repository. |
{ | ||
trace('Initializing Haxe compiler...'); | ||
|
||
var haxeCompilerSrc:String = Path.normalize(Sys.getEnv("HAXEPATH")); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure whether it's better to use the installed haxe compiler,
or to fetch a specific version using git
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
using git would be nicer, because we have a consistent haxe version and not some useless files like lime.exe
, hmm.cmd
, etc.
however, we'd need a constant internet connection, and it might be a bit slower than directly copying files
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you could always fetch from git on first compile, save it somewhere for other compiles, and update it only if the commit has been changed
i will have to revert to using the previous technique (generating extern classes myself)
not finished though, yet
This is impressive, ngl ! |
Linked Issues
Closes #5077
Description
This pr changes the scripting backend from
hscript
tocppia
.cppia
is more performant, more type-safe thanhscript
, and has much better haxe language support.Problem
It seems as if functions arguments are not passed correctly to the cppia scripts. I noticed some bizarre problems, for example
TankmanBloodyCharacter.hx
:event
inonUpdate
isnull
, which does not make sense.OtisSpeakerCharacter.hx
:scriptEvent
inonSongEvent
is of typeInt
with the value1
.The above seems to rather be an issue with hxcpp, when i tried debugging it, it mentioned that it was trying to access instance fields as static. I dont know why this happens, since i do not see a pattern which leads to this happening. I'm gonna see if i can figure why this happens.
Note
A few scripts had some changes that i deemed necessary to mention, so just look in the scripts for
// CPPIA:
.Todo