ZScript: "attempt to instantiate abstract class"

Bugs that have been investigated and resolved somehow.

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.
Post Reply
User avatar
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:

ZScript: "attempt to instantiate abstract class"

Post by Marisa the Magician »

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.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript: "attempt to instantiate abstract class"

Post by Graf Zahl »

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.
User avatar
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"

Post by Marisa the Magician »

Hmmm... I can understand that, but even for BrokenLines too? I use that class a lot in hud messages.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript: "attempt to instantiate abstract class"

Post by Graf Zahl »

Currently it cannot be saved because it doesn't store its data in a serializable form. It definitely needs some work to change that.
User avatar
Graf Zahl
Lead GZDoom+Raze Developer
Lead GZDoom+Raze Developer
Posts: 49067
Joined: Sat Jul 19, 2003 10:19 am
Location: Germany

Re: ZScript: "attempt to instantiate abstract class"

Post by Graf Zahl »

Fixed for BrokenLines. This took a while because the ancient implementation of the data storage needed a complete overhaul first.
Post Reply

Return to “Closed Bugs [GZDoom]”