Various classes such as BrokenLines or the *Iterator objects trigger this error. This renders saves where instances of them exist impossible to load.
Obviously one could work around it by declaring variables holding them as "transient", which requires workarounds for re-creating them on savegame load.
ZScript: "attempt to instantiate abstract class"
Moderator: GZDoom Developers
Forum rules
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
Please don't bump threads here if you have a problem - it will often be forgotten about if you do. Instead, make a new thread here.
- Marisa the Magician
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript: "attempt to instantiate abstract class"
These objects cannot be saved. They contain unserializable native data. Especially the iterators become invalid once a tic ends and/or if something alters the thinker list.
You should never use them in any context where they outlive the function's scope in which they get created.
The main problem with more restrictive checks is that it's perfectly valid to place them into other objects, as long as these objects also do not live longer than the function's scope.
You should never use them in any context where they outlive the function's scope in which they get created.
The main problem with more restrictive checks is that it's perfectly valid to place them into other objects, as long as these objects also do not live longer than the function's scope.
- Marisa the Magician
- Posts: 3886
- Joined: Fri Feb 08, 2008 9:15 am
- Preferred Pronouns: She/Her
- Operating System Version (Optional): (btw I use) Arch
- Graphics Processor: nVidia with Vulkan support
- Location: Vigo, Galicia
- Contact:
Re: ZScript: "attempt to instantiate abstract class"
Hmmm... I can understand that, but even for BrokenLines too? I use that class a lot in hud messages.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript: "attempt to instantiate abstract class"
Currently it cannot be saved because it doesn't store its data in a serializable form. It definitely needs some work to change that.
- Graf Zahl
- Lead GZDoom+Raze Developer
- Posts: 49067
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: ZScript: "attempt to instantiate abstract class"
Fixed for BrokenLines. This took a while because the ancient implementation of the data storage needed a complete overhaul first.