ShadowMario / FNF-PsychEngine

Engine originally used on Mind Games mod
Apache License 2.0
1.12k stars 2.19k forks source link

FlxPoint problem with runHaxeCode() #14296

Closed VoidedBattery closed 5 months ago

VoidedBattery commented 6 months ago

Describe your problem here.

Is there a library that I'm missing or what? I even tried to import flixel.math.FlxPoint but this kept throwing an error:

debugPrint(runHaxeCode([[return FlxPoint.get(2.0, 3.0);]]))

Are you modding a build from source or with Lua?

Lua

What is your build target?

Windows x64

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

No

VoidedBattery commented 6 months ago

I know that the main thing is that "you can't return an FlxPoint to LUA" but me using it in general just breaks the script because it looks at it as an "unknown variable"

I'll probably try to tinker around with added Haxe scripts to see if anything happens

VoidedBattery commented 5 months ago

UPDATE: I put in addHaxeLibrary("FlxPoint", "flixel.math") but it the script still registered "FlxPoint" as an unknown variable.

ShadowMario commented 5 months ago

Screenshot_2024-05-06-18-48-00-293_com android chrome-edit FlxPoint is an abstract class, it means it stops existing once the game compiles, if you want to use something similar to points in lua just do this:

local point = {x = 2, y = 3}