Editable of the same class of which it is a member

I have a map with multiple rooms (think Havoc Hotel), each room has room_device controlling it and I want it to have a pointer to the next room.

room_device := class(creative_device):

    @editable NextRoom:room_device = room_device{}

However this causes the following error:

Constructing an instance of a class while initializing its defaults is not implemented

My question is if this is just not allowed or if there’s a syntax that I’m not using to allow it.

I can get around it by duplicating the code and and creating room_1_device, room_2_device…etc but that seems much harder to maintain when the code would be the same in each file.

Also Can create a room manager device that has the list of rooms but was hoping to avoid that.

Is having an editable of the same class possible, or should I cut my losses and just find a work around?

try replacing it with : creative_device =creative_device{} or :?room_device=false . There’s probably a reason those restrictions were placed so keep that in mind for any instabilities you might encounter

Thanks, replacing with :?room_device=false seems to work. Hope I’m not shooting myself in the foot later. Appreciate the fast answer

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.