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.

inventory sprites, what are the rules?

Postby Barnaby Bindledidge » Sat May 16, 2020 8:36 am

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?
Barnaby Bindledidge
 

Re: inventory sprites, what are the rules?

Postby Jarewill » Sat May 16, 2020 8:44 am

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)
Jarewill
 
 
 
Joined: 21 Jul 2019

Re: inventory sprites, what are the rules?

Postby Jaska » Sun Jun 14, 2020 6:09 am

What are the dimensions? 64x64? 32x32? Offsets?
Jaska
 
Joined: 17 Dec 2019
Operating System: Windows 10/8.1/8/201x 64-bit
OS Test Version: No (Using Stable Public Version)
Graphics Processor: nVidia with Vulkan support

Re: inventory sprites, what are the rules?

Postby Jarewill » Sun Jun 14, 2020 6:40 am

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.
Jarewill
 
 
 
Joined: 21 Jul 2019


Return to Assets (and other stuff)

Who is online

Users browsing this forum: No registered users and 1 guest