Sbarinfo SP/DM

Discuss all aspects related to modding Zandronum here.
Post Reply
User avatar
dbthanatos
 
Posts: 72
Joined: Wed Jan 27, 2016 4:02 pm

Sbarinfo SP/DM

#1

Post by dbthanatos » 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).

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
	}

		
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]Image[/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]Image[/spoiler]


And here's how it looks when I use the code above. Blue empty icon mixed with green full icon.
[spoiler]Image[/spoiler]

It's basically mixing the deathmacth and single player versions. What am I doing wrong here?

User avatar
SwordGrunt
Forum Regular
Posts: 377
Joined: Thu Jun 07, 2012 8:43 pm

RE: Sbarinfo SP/DM

#2

Post by SwordGrunt » Tue Feb 02, 2016 7:07 pm

Could very well be another case of SBARINFO stuff fucking up in multiplayer.

Just like you can't see stuff on morphed allies' huds if it's within an InInventory block - yet if they're not morphed, it shows up like it should.

Your code doesn't seem to have anything wrong, though I'm far from an expert in SBARINFO stuff.
Last edited by SwordGrunt on Tue Feb 02, 2016 7:07 pm, edited 1 time in total.

Post Reply