Really the easiest way to transfer over is to read the introduction in the docs: https://godot.readthedocs.io/en/stable/learning/step_by_step/scenes_and_nodes.html
I've played around with GameMaker in the past but its been a while so forgive me if I'm missing something.
In Godot, rooms and objects are the same thing, both are represented as scenes. A scene could be the room, it could be the player, it could be a projectile, it could be an enemy, it could be the UI. A scene can have scenes to make some super-scene. To make a particular kind of object, you compose a scene made up of nodes; your player, for example, might have a KinematicBody to give it some movement functionality, a ShapeCollider to give it a hitbox.
You can add a script to any node in a node hierarchy, but you'll probably want to add this script to the base node, since it most represents the object you've made. Both GML and GDScript are typeless, you just declare 'var' then whatever variable name you want. You'll want to read up on GDScript, but it's basically a lot like python. To get variables, you usually have to type something like get_variable(), do your magic, then set_variable(variable) to apply it; you can't just modify variables like you can in GML, they're all protected with getters and setters.
You should program your game with the idea that there might not be a room for your objects to be in; each scene should depend only on itself. This makes it easy to test each of your objects in isolation, but also because of how Godot works, there's just not going to be any sort of level to test for by default (I'm sure you could program something that works this way if you wanted.) You should have some sort of base room which exists outside of any of your actual levels, which can hold game-wide variables--alternatively (even preferably) you can use Godot's Autoload feature for game-wide variables: https://godot.readthedocs.io/en/stable/learning/step_by_step/singletons_autoload.html
Godot comes with a built-in tilemapper but it's not on by default; you'll need to define a tileset and also add a TileMap node to the scene you want a tilemap in: https://godot.readthedocs.io/en/stable/learning/features/2d/using_tilemaps.html?highlight=tilemap
Each node type comes with their own signals, which is basically how you would call events. You can hook up a signal to a node and add a function which is called once that signal is fired. Signal = event. You can also define your own signals if you want. https://godot.readthedocs.io/en/stable/learning/step_by_step/scripting.html#handling-a-signal
Rather than scripting for each event, a single script can hold several events (signals.)
You'll notice that not every event available in GameMaker will be available from a node; for example, what if you want the step event? This is handled in Godot similarly to like it's handled in Unity3D:
func _ready():
set_process(true)
func _process(delta):
pass
As you can see, _process(delta)
is where you would define your step logic. Initialization happens in func _ready()
; remember there you need to set_process(true)
, or else your step event won't fire.
Collision handling occurs on objects which have some sort of body node attached to them, such as RigidBody2D; that has signals which can handle collision, such as body_enter( Object body )
You can inherit from scenes, which gives you all the nodes from the base scene, and updates them in the child scene if the base scene changes. I don't recall if GameMaker had this functionality, but there it is. Inheriting from scripts is also possible: you would extends "path_to_script.gd"
A node can also have a built-in script, when you don't want a named script in your file system; this saves the script to the scene itself, mostly useful for one-off logic. The downside is that you cannot apply this script to anything else and also cannot inherit from it.