When a room attempts to spawn a GridObject, it'll check if its method name is equal to "createBed". If so, it will stash the world position in the Floor instance for later. If not, it will spawn as usual.
When all prefab entities are spawned, only dynamic entities are left. This includes the player, other NPCs and now the bed (because its functionality is now only known at runtime). spawnBeds( ) handles bed spawning.
When called, a random stored bed position is chosen to be the player's bed position. A player bed is spawned there. All other stored bed positions will spawn a normal bed. The ObjectFactory methods responsible for these beds are createPlayerBed( ) and createNormalBed( ). If you want to do anything to the beds individually, do them here.
Nothing is changed in the prefabs.
When a room attempts to spawn a GridObject, it'll check if its method name is equal to "createBed". If so, it will stash the world position in the Floor instance for later. If not, it will spawn as usual.
When all prefab entities are spawned, only dynamic entities are left. This includes the player, other NPCs and now the bed (because its functionality is now only known at runtime). spawnBeds( ) handles bed spawning.
When called, a random stored bed position is chosen to be the player's bed position. A player bed is spawned there. All other stored bed positions will spawn a normal bed. The ObjectFactory methods responsible for these beds are createPlayerBed( ) and createNormalBed( ). If you want to do anything to the beds individually, do them here.