Receiving an item in ZScript and what virtuals to override

Sprites, textures, sounds, code, and other resources belong here. Share and share-alike!
Forum rules
Before posting your Resource, please make sure you can answer YES to any of the following questions:
  • Is the resource ENTIRELY my own work?
  • If no to the previous one, do I have permission from the original author?
  • If no to the previous one, did I put a reasonable amount of work into the resource myself, such that the changes are noticeably different from the source that I could take credit for them?
If you answered no to all three, maybe you should consider taking your stuff somewhere other than the Resources forum.

Consult the Resource/Request Posting Guidelines for more information.

Please don't put requests here! They have their own forum --> here. Thank you!
Post Reply
User avatar
Jekyll Grim Payne
 
 
Posts: 1069
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Receiving an item in ZScript and what virtuals to override

Post by Jekyll Grim Payne »

This flowchart details the contents of Touch(), CallTryPickup(), TryPickup(), GoAwayAndDie(), GoAway() and ShouldStay() functions that are all involved in the process of receiving an item in ZScript.

Image

Since this flowchart is humongous and unwieldy, I've prepared a new and better one that details how to pick the right virtual to override:

Image
ZzZombo
Posts: 315
Joined: Mon Jul 16, 2012 2:02 am

Re: Receiving an item in ZScript: Flowchart

Post by ZzZombo »

I didn't examine the whole chart fully, but there is a slight inaccuracy in that certain kind of items never get past the `TryPickup()` call, namely all `Health` items, `AllMap`, and many others. They do their magic in that function and skip all the regular processing.
User avatar
Jekyll Grim Payne
 
 
Posts: 1069
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Re: Receiving an item in ZScript: Flowchart

Post by Jekyll Grim Payne »

ZzZombo wrote: Thu May 25, 2023 8:44 am I didn't examine the whole chart fully, but there is a slight inaccuracy in that certain kind of items never get past the `TryPickup()` call, namely all `Health` items, `AllMap`, and many others. They do their magic in that function and skip all the regular processing.
Jekyll Grim Payne wrote: Thu May 25, 2023 5:12 am This flowchart details the contents of the TryPickup() function as defined in the Inventory class.
It doesn't cover the subclasses.
User avatar
Jekyll Grim Payne
 
 
Posts: 1069
Joined: Mon Jul 21, 2008 4:08 am
Preferred Pronouns: He/Him
Graphics Processor: nVidia (Modern GZDoom)
Contact:

Re: Receiving an item in ZScript and what virtuals to override

Post by Jekyll Grim Payne »

Updated the original flowchart and added a new guide flowchart to be more useful.
Post Reply

Return to “Resources”