You didn’t instance the node. preload gives you a Resource, in this case it’s a PackedScene resource. You must use .instance() to create an instance of that scene, and only then you can add it to the tree:
func _on_ButtonIntro_pressed():
var res = preload("res://test.tscn")
var nodeToLoad = res.instance()
get_parent().add_child(nodeToLoad)
FYI, it says the p_child parameter is null because the engine fails to cast your resource to a node, because nodes aren’t resources.
The error message is misleading :/, it could also say that the parameter (type) is “illegal”… or something.
bruteforce | 2017-09-13 14:09
Well that was embarrassing.
Thanks so much. I can’t believe I didn’t see that. I got wrapped up in the error.