TRANSPARENCY: this is a lot of me rambling about how the code works. I will post another post where I THINK i've pinpointed the error to... but this one is POSSIBLY irrelevant to others. however, typing it up helped me try to narrow down teh error. so i'm posting it.
okay so in retrospect i'm probably wrong about get_nodes_in_group being removed, even though I can't find it on docs, maybe i was looking in wrong place
cuz when I use it here:
func compare_door_id_to_key_id():
if get_tree().get_nodes_in_group("doors") != null:
var doors = get_tree().get_nodes_in_group("door")
print ("from inventory manager, doors is ")
print (doors)
print ("inventory is")
print (inventory)
it DOES show me the doors (as encoded objects, if thats relevant) when i mouse over them with the game paused in the debugger.
okay I apologize for not quite understanding the error (possibly still now, definitely earlier)
I am NOT getting an error message related to this (i have several others that I need to work on that don't SEEM to affect the game in debugger. but i'll post them anyway cuz i could be wrong). they don't 'break' the game though, in that they don't cause the code to stop running. they do cause other issues
but the problem taht is happening is my player's 'spawnpoint' is not getting set. so my set up is, i have a few (messy) scripts managing the player changing rooms. one is the 'doorway' script, another is a 'scene manager' script, and the third is the 'inventory manager' script (For when we have keys to doors, and need to check if they key matches the door)
when the player moves around, if they enter the door, the variable 'is_in_door' is set to true, and when they exit, the variable 'is_in_door' is set to false.
if they press the button to change rooms AND are in door, i call the function move rooms. the move rooms function saves the game to an auto save slot, compares the door id and key id (to see if the key can open the door) and if they are the same, unlocks the door (sets the can_open_door var to true . if the door id is 0 (no key) the can_open_door var starts true, in teh ready function)
from the move rooms function, if can_open_door is true, the code will call from scene manager, teh function 'door_goto_scene(scene_door_leads_to, self)'. this is where, I THINK things went wrong, from teh scene manager script.
in scene_manager, door_goto_scene(path, source_door), calls a deferred version of that script. (_deferred_door_goto_scene(path, source_door)
that function (deferred door...) tries to set the spawn point for the door. it takes note of the scene we were in and the door id we came from, and then saves teh game (NOTE: apparently i saved the game twice in this process Oo as i also saved it in move rooms... something for me to look into i guess). then i have some logic to free the room / delete current persistent objects and load the right ones (not getting into this cuz i think it worked fine, but i'll post script).
CANCELED: THAT Is probalby where my logic went wrong, because right after that is wehre the code stopped working. I will start a new post with that code as this one is quite long.
at some point in here, it gets the new scenes doorS with a get_tree().get_nodes_in_group("door") (which... is where i THOUGHT that function might have been removed, cuz it didn't work here... but it IS working in other parts of my code. leading me to believe i made a logic error somewhere else)
BECAUSE it can't get the doors from teh new scene, when I try to loop through them and check them versus teh key id, it doesn't work...