Creating a new pickup item Created 8 years ago2015-12-08 01:39:53 UTC by _Vissova_ _Vissova_

Created 8 years ago2015-12-08 01:39:53 UTC by _Vissova_ _Vissova_

Posted 8 years ago2015-12-08 03:03:35 UTC Post #327679
I'm trying to make a small version of the normal battery item that gives the player less suit power.
The small battery can be spawned via the console and placed in maps as "item_battery_small" and everything works correctly, except it does not display an icon on the hud when collected. All I want to know is where I go in the sdk to tell the game to display an icon when this item is collected, and how.
Posted 8 years ago2015-12-08 16:13:32 UTC Post #327684
Didn't you try to set icon for your item in sprites\hud.txt?

Like that:
item_battery_small 320 320hud2 48 52 20 20
item_battery_small 640 640hud2 176 0 44 44
Posted 8 years ago2015-12-08 23:18:30 UTC Post #327686
I never knew there was a hud.txt in there. Never saw it buried in all the sprites.
I added the lines you've provided where they should be in hud.txt and saved it, but it hasn't had any effect.
Posted 8 years ago2015-12-08 23:46:41 UTC Post #327687
Those were only examples.
Suparsonik SuparsonikI'm going off the edge to meet my maker.
Posted 8 years ago2015-12-08 23:48:22 UTC Post #327688
Then can the numbers be explained so I know what I'm doing?
Posted 8 years ago2015-12-08 23:57:51 UTC Post #327689
As far as I know it goes like "Image size" then comes the coordinates for where it is. "X", "y", and "Z" in that order. That tells the game where to get the graphic from in the image.
Suparsonik SuparsonikI'm going off the edge to meet my maker.
Posted 8 years ago2015-12-08 23:59:18 UTC Post #327690
Alright, that helps. I think I can try to figure the rest out on my own from here. Thanks.
Posted 8 years ago2015-12-09 06:56:11 UTC Post #327708
The format of the client's hud.txt file (also for weapon files)is this:
<entry number>
<icon name> <size> <sprite file> <X co-ord> <Y co-ord> <width> <height>
The entry number tells the client DLL how many entries to read into
memory. So, if you add any more entries, you Must increment the current
number or it will not work.

sprite file is the naturally the sprite file that the icon is located
and to be read from. The .spr extension is not needed.

size is either 320 (for low resolutions) or 640 (for higher resolutions).
I believe that anything above 800x600 screen resolutions will use the 640 size.

The X and Y co-ordinates are plotted from the upper left hand corner of
the BMP file that the sprite is made from. The game reads the width
number of pixels from left to right, starting from the X co-ordinate.
It reads the height number of pixels from top to bottom starting
from the Y co-ordinate. Whatever is in that bounding box in the sprite
file will be displayed on the client's screen.
Posted 8 years ago2015-12-09 23:10:05 UTC Post #327729
Thank you for explaining everything. It works now! Thank you very much for the help.
You must be logged in to post a response.