This works perfectly:
# Signal
signal blanksAdded (blanks, influences);
# Emit
func Add_Blanks (blanks:Array[Vector2i], influences:Array[Biome]):
blanksAdded.emit (blanks, influences);
# Connect
func _ready():
GlobalData.blanksAdded.connect (SpawnInBlanks);
# Callable
func SpawnInBlanks (posArray:Array[Vector2i], influences:Array[GlobalData.Biome]): # function body
This runs, but with errors:
# Signal
signal timePassed (timeSteps);
# Emit
func PassTime (timeSteps:int):
timePassed.emit (timeSteps);
# Connect
func _ready():
GlobalData.timePassed.connect (RoamCheck);
# Callable
func RoamCheck (timeSteps:int): # function body
Error:
E 0:00:02:0384 GlobalData.gd:189 @ PassTime(): Error calling from signal 'timePassed' to callable: 'Node2D(BirdHandler.gd)::MoveUp': Method expected 0 arguments, but called with 1.
<C++ Source> core/object/object.cpp:1140 @ emit_signalp()
<Stack Trace> GlobalData.gd:189 @ PassTime()
DirectionalKeyControl.gd:23 @ Move()
DirectionalKeyControl.gd:12 @ CheckMove()
DirectionalKeyControl.gd:8 @ _process()
This is the error when I change the last # Connect code to:
func _ready():
GlobalData.timePassed.connect (RoamCheck.bind (timeSteps));
Error:
Parser Error: Identifier "timeSteps" not declared in the current scope.
Any help would be appreciated. 🍀