ChronoDK / GodotBigNumberClass

Use very BIG numbers in Godot Engine games.
MIT License
113 stars 27 forks source link

Does not work in Godot 4. #20

Open Swingbiter opened 1 year ago

Swingbiter commented 1 year ago

Big.gd extends Reference which is no longer in Godot 4.0

TYPE_REAL is now TYPE_FLOAT

stepify() is no longer a function. The linter recommends snapped().

const other is trying to be written to in various functions.

ChronoDK commented 1 year ago

Yes, I have this on my todo list for the near future. I need this updated for Godot 4 for my own projects too.

Hamzalopode commented 1 year ago

Hi, Is there any alternative for Big Number until this issue is fixed? Thanks

Edit: Nevermind, made it work by changing / adding few stuff. Thank you.

BrastenXBL commented 1 year ago

Forked off some Godot 4 changes. The API changes themselves aren't difficult. Reference to RefCounted. Some @warning_ignore() parser flags. I have not verified everything is working as intended.

The problem is Godot 4 constants are now deep, so you can't use const as a pseudo static variable. The 4.0.x documentation is not correct, as it still refers to Arrays and Dictionaries as being 'flat'.

https://github.com/godotengine/godot/issues/71413 https://github.com/godotengine/godot/pull/71051

ChronoDK commented 1 year ago

My current plan is to port to Godot 4.1 instead, as we have static variables in that.

Hamzalopode commented 1 year ago

I adapted this for Godot 4, and work really well, I will try to fork and PR if I have time.

ChronoDK commented 1 year ago

I have submitted a working 4.1 version now. The file is named Big.gd4 for now. This will replace the regular version once 4.1 is released.

Hamzalopode commented 1 year ago

Thanks for your work.

Drachenbauer commented 11 months ago

It gives this error: res://Big.gd:276 - Parse Error: Cannot call non-static function "_typeCheck()" from static function "minValue()". res://Big.gd:284 - Parse Error: Cannot call non-static function "_typeCheck()" from static function "maxValue()". res://Big.gd:276 - Parse Error: Cannot call non-static function "_typeCheck()" from static function "minValue()". res://Big.gd:284 - Parse Error: Cannot call non-static function "_typeCheck()" from static function "maxValue()".

ChronoDK commented 11 months ago

Are you using the GD3 version in GD4 perhaps? Get the file named Big.gd4 instead, and rename it to Big.gd of course.

Drachenbauer commented 11 months ago

it is that gd4 one the gd3 one showed lot´s of other errors.

I now duplicated the typecheck function to have one static and one non-static, now all errors are gone. And i can work with it now.