Sbarinfo SP/DM
Posted: Tue Feb 02, 2016 5:56 pm
If you have ever played q4 in deathmatch, the ammo bar in the HUD changes accordingly to the ammo type you're using. Rockets makes the bar red, rails green, cells blue, etc.
I did the same for my mod, however, I might be doing something wrong here, since the colors are overlapping somehow in deathmatch.
Here's the code I used (removed many weapons for the sake of brevity, but this happens in all of them).
Here's how it looks in single player, which is fine (the ammo bar is the one on the left corner). Green weapon ammo HUD for all weapons.
[spoiler]
[/spoiler]
Here's how it's supposed to look (this was tested in SP and changing the SBARINFO code to run on SP too). Colored ammo HUD for every weapon. In this case, blue
[spoiler]
[/spoiler]
And here's how it looks when I use the code above. Blue empty icon mixed with green full icon.
[spoiler]
[/spoiler]
It's basically mixing the deathmacth and single player versions. What am I doing wrong here?
I did the same for my mod, however, I might be doing something wrong here, since the colors are overlapping somehow in deathmatch.
Here's the code I used (removed many weapons for the sake of brevity, but this happens in all of them).
Code: Select all
gamemode deathmatch, teamgame
{
IsSelected Q4Shotgun
{
drawimage "SELWEP3", 642,688, center;
drawbar "AMMW3", "AMMW3E", Ammo1, horizontal, reverse, 168, 724;
drawnumber 3, Q4HUDFONT, white, ammo1, 320, 735;
}
IsSelected Q4HyperBlaster
{
drawimage "SELWEP4", 642,688, center;
drawbar "AMMW4", "AMMW4E", Ammo1, horizontal, reverse, 168, 724; //this is the relevant line
drawnumber 3, Q4HUDFONT, white, ammo1, 320, 735;
}... and so on for the other weapons
}
gamemode singleplayer, cooperative
{
IsSelected Q4Shotgun
{
drawimage "SELWEP3", 642,688, center;
drawbar "AMMOBAR1", "AMMOBAR0", Ammo1, horizontal, reverse, 168, 724;
drawnumber 3, Q4HUDFONT, white, ammo1, 320, 735;
}
IsSelected Q4HyperBlaster
{
drawimage "SELWEP4", 642,688, center;
drawbar "AMMOBAR1", "AMMOBAR0", Ammo1, horizontal, reverse, 168, 724; //this is the relevant line
drawnumber 3, Q4HUDFONT, white, ammo1, 320, 735;
} ... and so on for the other weapons
}
[spoiler]
[/spoiler]Here's how it's supposed to look (this was tested in SP and changing the SBARINFO code to run on SP too). Colored ammo HUD for every weapon. In this case, blue
[spoiler]
[/spoiler]And here's how it looks when I use the code above. Blue empty icon mixed with green full icon.
[spoiler]
[/spoiler]It's basically mixing the deathmacth and single player versions. What am I doing wrong here?