GodotBigNumberClass icon indicating copy to clipboard operation
GodotBigNumberClass copied to clipboard

Does not work in Godot 4.

Open Swingbiter opened this issue 3 years ago • 10 comments

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.

Swingbiter avatar Apr 29 '23 00:04 Swingbiter

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

ChronoDK avatar Apr 29 '23 06:04 ChronoDK

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.

Hamzalopode avatar May 03 '23 20:05 Hamzalopode

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

BrastenXBL avatar May 23 '23 00:05 BrastenXBL

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

ChronoDK avatar May 23 '23 05:05 ChronoDK

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

Hamzalopode avatar May 23 '23 10:05 Hamzalopode

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.

ChronoDK avatar May 23 '23 10:05 ChronoDK

Thanks for your work.

Hamzalopode avatar May 23 '23 10:05 Hamzalopode

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()".

Drachenbauer avatar Oct 07 '23 19:10 Drachenbauer

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

ChronoDK avatar Oct 07 '23 19:10 ChronoDK

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.

Drachenbauer avatar Oct 07 '23 20:10 Drachenbauer