Skip to content

Releases: rune-scape/godot

4.2.3.rc.custom_build.a45d9d793

v4.0.1c-r6

07 Jun 16:24
Compare
Choose a tag to compare
  • Includes when and when notified declarations ✨:

# can have multiple `when ready:` definitions in the script and they will all be called in order
# and called from basest class up if extending another script with `when ready:` definitions
# (that applies to all when decls, but importantly it acts like `_ready` did in godot 3.  :3 )
when ready:
	set_physics_process(true)

# v This is almost works like '_physics_process()' in godot 3 (calls up through inheritance chain)
#    but you need to `set_physics_process(true)` in a `when ready:` declaration
when notified NOTIFICATION_PHYSICS_PROCESS:
	print("ourple")

when $Button.pressed:
	print("ourpler")
  • Includes Operator Overloading:

class_name Vec2

var x
var y

func _init(x, y):
	self.x = x
	self.y = y

# Overload the '+' operator to add two Vec2 objects
func _add(other):
	return Vec2.new(self.x + other.x, self.y + other.y)

# Can also overload the '+' operator as the rhs. only used if _add wasn't found on the lhs arg
func _radd(other):
	return Vec2.new(self.x + other.x, self.y + other.y)

# Overload the '-' operator to subtract two Vector2 objects
func _sub(other):
	return Vec2.new(self.x - other.x, self.y - other.y)

# Overload the '*' operator to multiply a Vector2 object by a scalar
func _mul(scalar):
	return Vec2.new(self.x * scalar, self.y * scalar)
  • Editor will also show errors of dependant scripts

image

bugfixes:

  • weird highlighting bug
  • errors could show wrong script path

v4.0.1c-r5

22 Apr 00:02
Compare
Choose a tag to compare
  • Includes when and when notified declarations ✨:

when ready:
	set_physics_process(true)

# v This is almost works like '_physics_process()' in godot 3 (calls up through inheritance chain)
#    but you need to `set_physics_process(true)` in a `when ready:` declaration
when notified NOTIFICATION_PHYSICS_PROCESS:
	print("ourple")
  • Includes Operator Overloading:

class_name Vec2

var x
var y

func _init(x, y):
	self.x = x
	self.y = y

# Overload the '+' operator to add two Vec2 objects
func _add(other):
	return Vec2.new(self.x + other.x, self.y + other.y)

# Can also overload the '+' operator as the rhs. only used if _add wasn't found on the lhs arg
func _radd(other):
	return Vec2.new(self.x + other.x, self.y + other.y)

# Overload the '-' operator to subtract two Vector2 objects
func _sub(other):
	return Vec2.new(self.x - other.x, self.y - other.y)

# Overload the '*' operator to multiply a Vector2 object by a scalar
func _mul(scalar):
	return Vec2.new(self.x * scalar, self.y * scalar)
  • Editor will also show errors of dependant scripts

image