Page 1 of 1

inventory sprites, what are the rules?

Posted: Sat May 16, 2020 8:36 am
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?

Re: inventory sprites, what are the rules?

Posted: Sat May 16, 2020 8:44 am
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)

Re: inventory sprites, what are the rules?

Posted: Sun Jun 14, 2020 6:09 am
by Jaska
What are the dimensions? 64x64? 32x32? Offsets?

Re: inventory sprites, what are the rules?

Posted: Sun Jun 14, 2020 6:40 am
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.