inventory sprites, what are the rules?

Ask about editing graphics, sounds, models, music, etc here!
Shaders (GLSL) and SNDINFO questions also go here!

Moderators: GZDoom Developers, Raze 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.
Post Reply
Guest

inventory sprites, what are the rules?

Post by Guest »

I cannot find anywhere what parameters (if any) exist for creating inventory icons. All of my searches show tell me Inventory.Icon <sprite>. So, like, do you want the whole filename? Does it have to be in the same folder? Does it have to have to certain data in the filename?

while we're at it, how do I get the tid of the actor who picked up the item? Can I include it as an argument during acs_execute?
Jarewill
 
 
Posts: 1766
Joined: Sun Jul 21, 2019 8:54 am

Re: inventory sprites, what are the rules?

Post by Jarewill »

For the icons, you can use either sprites (between S_START and S_END in a wad or in the "sprites" folder in a pk3 file) or graphics. (outside any markers in a wad or in the "graphics" folder in a pk3 file)
You just need to write the name of the graphic/sprite you wish to use, for example:
Inventory.Icon "I_STMP" or Inventory.Icon "STIMA0"

As for the item pickup, if it's a CustomInventory-based pickup, you can just execute an ACS script in the pickup state.
That will put the player who picked it up as the activator. (aka tid 0 in most cases)
Jaska
Posts: 113
Joined: Tue Dec 17, 2019 5:12 am
Graphics Processor: nVidia with Vulkan support

Re: inventory sprites, what are the rules?

Post by Jaska »

What are the dimensions? 64x64? 32x32? Offsets?
Jarewill
 
 
Posts: 1766
Joined: Sun Jul 21, 2019 8:54 am

Re: inventory sprites, what are the rules?

Post by Jarewill »

The size can be freely set.
For example: Strife's icon for the med patch is 16x10, meanwhile for the medikit it's 16x16 and for the surgery kit is 24x16.
However, they can't be scaled down by parameters, (I think they might be scalable with the TEXTURES lump though) so it would be better if they don't have massive dimensions.

As for the offsets, it matters what they are for.
When it comes to the inventory bar, the offsets are applied, so if the icon has offsets like a pickup, it will appear out of the inventory box.
Back to example of Strife's med patch, it has dimensions of 16x10 and offsets of 0, -3. This makes it appear on the left center of the inventory box with Strife's inventory bar.
But you can also draw icons on the screen in a status bar and you can specify offsets there, if it should use item offsets or not.
Post Reply

Return to “Assets (and other stuff)”