It appears OverlayID() only works properly when, if called on a weapon, it's only ever done inside the states themselves. Players on the other hand can return the OverlayID() perfectly, provided the function is 'action' prepended.
Right now, OverlayID() is the ONLY way to clear ambiguity if using multiple overlays, where each could use the same one at once, at any given time. Example: An akimbo system where you can wield two different guns at once and switch to any other, and naturally, things like offsets and projectile spawning will rely upon the ID of the psprite.
Here's a test case. When starting a new game, wait for the weapon to raise, then check the console.
OverlayID() fails on weapon functions
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.
- Major Cooke
- Posts: 8215
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
OverlayID() fails on weapon functions
- Attachments
-
test.pk3- Simply start a new game.
- (735 Bytes) Downloaded 20 times
- Major Cooke
- Posts: 8215
- Joined: Sun Jan 28, 2007 3:55 pm
- Preferred Pronouns: He/Him
- Operating System Version (Optional): Windows 10
- Graphics Processor: nVidia with Vulkan support
- Location: GZBoomer Town
- Contact:
Re: OverlayID() fails on weapon functions
A little digging revealed the stateinfo is not being passed along through the action functions on weapons.
Toss that inside of the weapon's PrintOIDAction() at the top and you'll see it outright stops printing.
Code: Select all
if (stateinfo == null) return;- Graf Zahl
- Lead GZDoom+Raze Developer

- Posts: 49252
- Joined: Sat Jul 19, 2003 10:19 am
- Location: Germany
Re: OverlayID() fails on weapon functions
This is a user error.
You are calling PrintOIDAction through 'invoker', not 'self'. This changes ownership of the called function to the weapon. The overlay belongs to the player, i.e. 'self' and cannot be found when queried from the weapon.
This works as intended:
You are calling PrintOIDAction through 'invoker', not 'self'. This changes ownership of the called function to the weapon. The overlay belongs to the player, i.e. 'self' and cannot be found when queried from the weapon.
This works as intended:
Code: Select all
BFGG A 35 { invoker.PrintOID(); PrintOIDAction(); }