Question about scripted dynamic pointer arrays

Ask about ACS, DECORATE, ZScript, or any other scripting questions here!

Moderator: GZDoom Developers

Forum rules
Before asking on how to use a ZDoom feature, read the ZDoom wiki first. If you still don't understand how to use a feature, then ask here.

Please bear in mind that the people helping you do not automatically know how much you know. You may be asked to upload your project file to look at. Don't be afraid to ask questions about what things mean, but also please be patient with the people trying to help you. (And helpers, please be patient with the person you're trying to help!)
Post Reply
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Question about scripted dynamic pointer arrays

Post by Major Cooke »

Now, I think I know the answer to this one already but I'm asking just in case. If a thing becomes null in an array, it doesn't automatically delete from that array in particular, right? As in, say I have 3 monsters and one of them stops existing. The size wouldn't just shrink down to 2 magically, correct? It just has 2 monsters and a null (a size of 3)?
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: Question about scripted dynamic pointer arrays

Post by Graf Zahl »

No. Garbage collection does not work like that. It just nulls the pointer.
User avatar
Major Cooke
Posts: 8175
Joined: Sun Jan 28, 2007 3:55 pm
Preferred Pronouns: He/Him
Location: QZDoom Maintenance Team

Re: Question about scripted dynamic pointer arrays

Post by Major Cooke »

Thought so as well, just had to check.
Post Reply

Return to “Scripting”