Skip to content
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

Godot 4 converter adding Callable and bindings where methods, signals, etc have 'start' anywhere in their name, even comments! #71134

Closed
Tracked by #73960
chucklepie opened this issue Jan 9, 2023 · 3 comments

Comments

@chucklepie
Copy link

chucklepie commented Jan 9, 2023

Godot version

4.0 beta 10

System information

Linux

Issue description

Godot 4 on finding the word 'start' in any part of a function, signal, even in commented out code, is completely breaking all code by trying to wrap a callable and then switching parameters to bindings. It doesn't even have to be the function 'start()', literally anything with a sub-string of 'start'. The problem is some (but most are) are not generating errors, so you have to comb through code looking for 'callable' and replacing everything.

I have this function:

func start(start_text,colour, scale_index,speed:=1.0,_end_y:=96):
	pass

Godot 4 Changed:

score.start(str(shot_count*SCORE_ACCUMULATOR),GlobalMethods.get_as_colour(score_colours[i]),i)

to:

score.start(Callable(str(shot_count*SCORE_ACCUMULATOR),GlobalMethods.get_as_colour(score_colours[i])).bind(i))

In another example:
_set_death_start(weapon,on_floor)

Is changed to:
_set_death_start(Callable(weapon,on_floor))


It has even gone to lengths to convert comments!
#shake.start(Callable(main_camera,priority).bind(total_shake_time),shakes_per_second,shake_half_height)


It even does signals :)

signal scroll_start(Callable(tl,br))

For a fuller example, I have the following declared at the top of my function:

var release_pattern_ships=[
	[0,			UFO,	PATTERN_G,		0,LEFTRIGHT],
	[0,			SHIP,	PATTERN_D,		0,LEFTRIGHT],
]

I have the following Godot 3 function:

func _start(release_patterns, killscreen:=false):
    pass #code commented out as irrelevant

It is called like this:


	_start(release_pattern_ships,true)
	_start(release_pattern_bouncy,true)

On migrating to Godot 4 it has left everything as is except it has done this to all calls, causing compile errors:

_start(Callable(release_pattern_bouncy,true))


Steps to reproduce

As description

Minimal reproduction project

As description

@chucklepie chucklepie changed the title Godot 4 converter adding Callable and bindings where methods (appear to) have 'start' in their title Godot 4 converter adding Callable and bindings where methods have 'start' anywhere in their name Jan 9, 2023
@chucklepie chucklepie changed the title Godot 4 converter adding Callable and bindings where methods have 'start' anywhere in their name Godot 4 converter adding Callable and bindings where methods have 'start' anywhere in their name, even comments! Jan 9, 2023
@chucklepie chucklepie changed the title Godot 4 converter adding Callable and bindings where methods have 'start' anywhere in their name, even comments! Godot 4 converter adding Callable and bindings where methods, signals, etc have 'start' anywhere in their name, even comments! Jan 9, 2023
@KoBeWi
Copy link
Member

KoBeWi commented Jan 9, 2023

Likely this comes from Thread.start() taking callable now, but the converter does not know the type.

@KoBeWi KoBeWi added this to the 4.0 milestone Jan 9, 2023
@KoBeWi KoBeWi moved this from To Assess to Todo in 4.x Priority Issues Jan 9, 2023
@KoBeWi KoBeWi moved this from Todo to To Assess in 4.x Priority Issues Jan 9, 2023
@chucklepie
Copy link
Author

chucklepie commented Jan 10, 2023 via email

@Maran23
Copy link
Contributor

Maran23 commented Jul 6, 2023

This should be much better now with #75002 and #74193 merged.
Inline comments may still be converted (e.g. func _process(delta) # start). Otherwise this should not happen.

@github-project-automation github-project-automation bot moved this from To Assess to Done in 4.x Priority Issues Jul 7, 2023
@akien-mga akien-mga modified the milestones: 4.2, 4.1 Jul 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

5 participants