Welcome, Guest. Please login or register. Did you miss your activation email?

Author Topic: Replacing Half-Life 2 Weapon HUD Icons/Sprites  (Read 3228 times)

0 Members and 1 Guest are viewing this topic.

Offline minmi96

  • *
  • *
  • +7% chance to make useful post
  • minmi96 is working their way up.minmi96 is working their way up.minmi96 is working their way up.
    • www.titsassesanddicks.cum
Replacing Half-Life 2 Weapon HUD Icons/Sprites
« on: August 30, 2015, 07:03:20 AM »
I Recently released this Sniper Rifle Replacement for the Crossbow in Half-Life 2 and I wanted to Replace the Weapon and Ammo HUD Icons/Sprites for the Crossbow as part of the Replacement but I unfortunately lack the skill and knowledge to do it.

Does anyone know how to do this or know any Tutorials on how to do this?


Let's Get Some Pussy Tonight.

Offline minmi96

  • *
  • *
  • +7% chance to make useful post
  • minmi96 is working their way up.minmi96 is working their way up.minmi96 is working their way up.
    • www.titsassesanddicks.cum
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #1 on: August 31, 2015, 06:58:50 AM »
Anyone gonna help or?


Let's Get Some Pussy Tonight.

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #2 on: August 31, 2015, 08:59:01 AM »
Replace
Code: [Select]

"font" "WeaponIcons"
"character" "e"
with
Code: [Select]

"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
in the TextureData block of your weapon script's icon.

IE
Code: [Select]

"weapon"
{
"font" "WeaponIcons"
"character" "e"
}
would become
Code: [Select]

"weapon"
{
"file" "sprites/mygun"
"x" "0"
"y" "0"
"width" "512"
"height" "512"
}
._. I love coffee.

Offline minmi96

  • *
  • *
  • +7% chance to make useful post
  • minmi96 is working their way up.minmi96 is working their way up.minmi96 is working their way up.
    • www.titsassesanddicks.cum
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #3 on: August 31, 2015, 09:41:40 AM »
Replace
Code: [Select]

"font" "WeaponIcons"
"character" "e"
with
Code: [Select]

"file" "sprites/crosshairs"
"x" "0"
"y" "48"
"width" "24"
"height" "24"
in the TextureData block of your weapon script's icon.

IE
Code: [Select]

"weapon"
{
"font" "WeaponIcons"
"character" "e"
}
would become
Code: [Select]

"weapon"
{
"file" "sprites/mygun"
"x" "0"
"y" "0"
"width" "512"
"height" "512"
}
Does this apply for any Half-Life 2 Mod aswell?


Let's Get Some Pussy Tonight.

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #4 on: August 31, 2015, 09:45:12 AM »
Yes, if memory serves correct. I AM kind of rusty getting back into the source/Half Life 2 modding scene though.
._. I love coffee.

Offline minmi96

  • *
  • *
  • +7% chance to make useful post
  • minmi96 is working their way up.minmi96 is working their way up.minmi96 is working their way up.
    • www.titsassesanddicks.cum
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #5 on: August 31, 2015, 11:21:57 AM »
Well Shit...


Let's Get Some Pussy Tonight.

Offline sirmasters

  • *
  • +5% chance to make useful post
  • sirmasters barely matters.sirmasters barely matters.
    • My Twitter (My Forums are inactive at the moment)
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #6 on: August 31, 2015, 11:41:17 AM »
Well Shit...
Adjust the X Y width height parameters to surround only the rifle icon. Judging from firefight's weapon scripts, the icon height and width is
Code: [Select]

"width" "128"
"height" "64"
So you may need resize your icon.
._. I love coffee.

Offline Comrade

  • *
  • *
  • +11% chance to make useful post
  • Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #7 on: August 31, 2015, 01:04:07 PM »
Well Shit...
Adjust the X Y width height parameters to surround only the rifle icon. Judging from firefight's weapon scripts, the icon height and width is
Code: [Select]

"width" "128"
"height" "64"
So you may need resize your icon.

The icon for the G3/SG1 is 256x64... whoa that looks messed up.

Offline minmi96

  • *
  • *
  • +7% chance to make useful post
  • minmi96 is working their way up.minmi96 is working their way up.minmi96 is working their way up.
    • www.titsassesanddicks.cum
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #8 on: August 31, 2015, 01:19:48 PM »


Starting to run out of ways to work around this.

Here's the Script File for the Weapon for those who can help figure this out.

Code: [Select]
// Crossbow

WeaponData
{
// Weapon data is loaded by both the Game and Client DLLs.
"printname" "Sniper Rifle"
"viewmodel" "models/weapons/v_crossbow.mdl"
"playermodel" "models/weapons/w_crossbow.mdl"
"anim_prefix" "bow"
"bucket" "3"
"bucket_position" "1"
"bucket_360" "0"
"bucket_position_360" "2"

"clip_size" "1"
"default_clip" "5"
"primary_ammo" "XBowBolt"
"secondary_ammo" "None"

"weight" "6"
"item_flags" "0"

// Sounds for the weapon. There is a max of 16 sounds per category (i.e. max 16 "single_shot" sounds)
SoundData
{
"single_shot" "Weapon_Crossbow.Single"
"reload" "Weapon_Crossbow.Reload"
"special1" "Weapon_Crossbow.BoltElectrify"
"special2" "Weapon_Crossbow.BoltFly"
}

// Weapon Sprite data is loaded by the Client DLL.
TextureData
{

"weapon"
{
"file" "sprites/g3sg1"
"x" "0"
"y" "0"
"width" "256"
"height" "64"
}
"weapon_s"
{
"font" "WeaponIconsSelected"
"character" "g"
}
"weapon_small"
{
"font" "WeaponIconsSmall"
"character" "g"
}
"ammo"
{
"file" "sprites/rounds/round_7.62"
"x" "0"
"y" "0"
"width" "64"
"height" "32"
}
"crosshair"
{
"font" "Crosshairs"
"character" "Q"
}
"autoaim"
{
"file" "sprites/crosshairs"
"x" "0"
"y" "96"
"width" "24"
"height" "24"
}
"zoom"
{
"font" "Crosshairs"
"character" "Q"
}
"zoom_autoaim"
{
"file" "sprites/crosshairs"
"x" "24"
"y" "112"
"width" "104"
"height" "16"
}
}
}


Let's Get Some Pussy Tonight.

Offline Comrade

  • *
  • *
  • +11% chance to make useful post
  • Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #9 on: August 31, 2015, 01:21:23 PM »
Choose the smaller version then, the vtf is 256x64 and doesn't fit into the bounding box.

Or stop playing at 1280x720.

Seems like you didn't install the round textures where they're supposed to be either, explains the missing texture pattern where the bullet is supposed to be. I've found out that normally it doesn't really appear there (in SMOD at least), but once you pick up ammo, it will.

EDIT: Oh snap. Seems like the bullets don't really have a vmt, THAT's why the bullets have a missing texture. I hope you know how to edit vmt's, cause the fix is really simple: just take any vmt from the weapon icons and paste it into the directory you've specified for the round, then go into the vmt and point it at the round vtf.

EDIT 2: they do, you didn't install them properly or something
« Last Edit: August 31, 2015, 01:25:56 PM by Comrade »

Offline Comrade

  • *
  • *
  • +11% chance to make useful post
  • Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...Comrade might someday be someone...
Re: Replacing Half-Life 2 Weapon HUD Icons/Sprites
« Reply #10 on: August 31, 2015, 01:27:42 PM »
The pack provides a readme file, why don't you read it? It perfectly (at least in my opinion) explains how to install these sprites and how to make them work.