I am experimenting with cloning rooms using the Dynamic Objects extension by Jesse McGrew.
It’s nearly working but I’ve got some really weird problems with the connections between cloned rooms.
Before we go any further… Yes, I know, dynamic objects, do I really need them? Probably not. I was just messing about and then this potential bug started bugging me and I’m curious to know what is happening!
I’ve assumed that with Dynamic Objects you can create as many clones of the same ‘empty’ room as you like and then link all the clones into the overall map. But the resulting links between the rooms don’t work as expected and you end up going round in circles!
I’ve also tried pre-defined rooms (similar to Aaron Reed in Dynamic Rooms) and those rooms are all linked into the map as I expect.
Is there something I have to do after cloning a room object? Is the room a fully-functional room after cloning? Maybe something specific only for cloned room objects is also needed?
At the moment I really do suspect there is a tricky bug somewhere in the Dynamic Objects extension and specifically the cloning of rooms isn’t as clean as it should be. I don’t think the clones are really independent objects, something tells me they are still internally linked to the original room object and then after cloning maybe to each other?
Here is a relatively small ‘hard-coded’ example of correct and incorrect behaviour with changing links to some pre-defined room objects and then with clones. Just compare going south three times and then returning north to the first room with trying to go north from the first room three times…
Can anyone see anything worng with the cloned rooms and linking of the exits? At the moment I’m stumped!
[spoiler]Include Dynamic Objects by Jesse Mcgrew.
Use slow route-finding.
[Slow route-finding should always be used with Dynamic Objects and cloned rooms]
The first room is a room.
[A room to act as a starting point for building]
The clone room is a room.
[A room to be cloned during building]
The second room, the third room and the fourth room are rooms.
[Three normal, initially un-linked empty rooms to be used during building]
When play begins:
[First place a set of 3 pre-defined rooms running south from the first room. These are not clones, they are simply linked into the correct positions by changing their exits. The resulting chain of rooms works as expected, after building you can go south 3 times and return north through the rooms to the first room.]
change the south exit of the first room to the second room;
change the north exit of the second room to the first room;
change the south exit of the second room to the third room;
change the north exit of the third room to the second room;
change the south exit of the third room to the fourth room;
change the north exit of the fourth room to the third room;
[Now place a set of 3 rooms all cloned from the clone room, running north. You can go north once, but then north again goes straight to the fourth clone room and then going north always goes to the fourth room. Going south goes to the third room and repeat south also goes to the third room!?! You cannot get back to the second clone room or the first room. For some reason the second, third and fourth clones seem to be linked incorrectly, why???]
let the second clone room be a new object cloned from the clone room;
now the printed name of the second clone room is “second clone room”;
change the north exit of the first room to the second clone room;
change the south exit of the second clone room to the first room;
let the third clone room be a new object cloned from the clone room;
now the printed name of the third clone room is “third clone room”;
change the north exit of the second clone room to the third clone room;
change the south exit of the third clone room to the second clone room;
let the fourth clone room be a new object cloned from the clone room;
now the printed name of the fourth clone room is “fourth clone room”;
change the north exit of the third clone room to the fourth clone room;
change the south exit of the fourth clone room to the third clone room.[/spoiler]