How Do I SBARINFO? - A Tutorial

Handy guides on how to do things, written by users for users.
Forum rules
Please don't start threads here asking for help. This forum is not for requesting guides, only for posting them. If you need help, the Editing forum is for you.

Re: How Do I SBARINFO? - A Tutorial

Postby Silentdarkness12 » Thu Jun 23, 2016 6:20 pm

2. So, then the scaling of the HUD centers around the Resolution parameter in SBARINFO? What would be an optimal setting for the Resolution parameter?
User avatar
Silentdarkness12
Level 7: ZScript Victim
 
Joined: 15 Aug 2013
Location: Plains of Pride

Re: How Do I SBARINFO? - A Tutorial

Postby wildweasel » Thu Jun 23, 2016 6:41 pm

Silentdarkness12 wrote:2. So, then the scaling of the HUD centers around the Resolution parameter in SBARINFO? What would be an optimal setting for the Resolution parameter?

Personally, I leave that alone, because all my graphics are designed for the original resolution to begin with. If anything needs to be sharper, like weapon icons, I'll scale those using Textures. If you're wanting a lot more information on screen, you might try it at 640*400, or using smaller fonts. I try to avoid writing labels in anything bigger than the default Smallfont.
User avatar
wildweasel
「お前はもうトースト」[you are already toast.]
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: How Do I SBARINFO? - A Tutorial

Postby Silentdarkness12 » Fri Jun 24, 2016 12:00 pm

3. I must still be missing something here.

Code: Select allExpand view
Height 0;
Resolution 640,400;
CompleteBorder True;
Statusbar Fullscreen, FullscreenOffsets, Forcescaled
{
ininventory not wipedout
{
DrawImage "DHUDBOX1",0,0,none,150,150;
DrawImage "DHUDBOX2",200,0,none,100,100;
DrawImage "DHUDBOX2",300,0,none,100,100;
DrawImage "DHUDBOX1",570,0,none,150,150;
DrawImage "DHUDBOX2",400,0,none,100,100;
}
}


I've got a FullscreenOffsets Forcescaled 640x400 hud, but it still seems that it gets cut off on different resolutions other than the one I used to check the positioning. Am I doing something wrong here?
User avatar
Silentdarkness12
Level 7: ZScript Victim
 
Joined: 15 Aug 2013
Location: Plains of Pride

Re: How Do I SBARINFO? - A Tutorial

Postby wildweasel » Fri Jun 24, 2016 12:17 pm

I don't have your graphics on hand to test at the moment, but do you mean to define the max height/width attributes? Those aren't strictly necessary unless your graphics are larger than those maximums and you intend to trim them.
User avatar
wildweasel
「お前はもうトースト」[you are already toast.]
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: How Do I SBARINFO? - A Tutorial

Postby Silentdarkness12 » Fri Jun 24, 2016 12:38 pm

wildweasel wrote:I don't have your graphics on hand to test at the moment, but do you mean to define the max height/width attributes? Those aren't strictly necessary unless your graphics are larger than those maximums and you intend to trim them.


They are indeed, so I have to trim them.

4. What is it that is the determining factor in how a hud scales to resolution? How it stretches across the screen to fit? I've wracked my brain over this many many times and haven't been able to figure it out worth a singular damn. I am aware that aspect ratio also plays some part in it, but fixing it for one aspect ratio comes first : P

Here is what I have so far.

Dark Hud V4.1 testing version
User avatar
Silentdarkness12
Level 7: ZScript Victim
 
Joined: 15 Aug 2013
Location: Plains of Pride

Re: How Do I SBARINFO? - A Tutorial

Postby wildweasel » Fri Jun 24, 2016 1:33 pm

Augh, I'm about ready to declare that Mediafire is no good anymore. I got your file, but I also got directed to an obvious phishing page that pretended to be a BSOD error and wouldn't quit spamming me with Javascript messages. Anyway...
Image
Where I'm puzzled, though, is why forcescaled (and in fact the user settings) are being completely ignored. My laptop runs gzdoom at 1366x768, so the screenshot shows exactly what this would look like if it were NOT scaled, but even with the Resolution command commented out, forcescaled enabled, AND ST_Scale set to True in the in-game settings, it still just stays anchored to the corner.

I don't get it. This might be one of those "olde dark magicks" kind of things.
User avatar
wildweasel
「お前はもうトースト」[you are already toast.]
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: How Do I SBARINFO? - A Tutorial

Postby Silentdarkness12 » Fri Jun 24, 2016 2:18 pm

I'm not going to be comfortable putting any more work into this thing until I can address this scaling issue.

Here is what it looks like for me at 1440x900: http://imgur.com/ZTWQnyY

Is this a bug, or something?
User avatar
Silentdarkness12
Level 7: ZScript Victim
 
Joined: 15 Aug 2013
Location: Plains of Pride

Re: How Do I SBARINFO? - A Tutorial

Postby Alekv » Tue Jul 26, 2016 2:16 pm

I stretched HUD only if you write:
Code: Select allExpand view
Status Bar FullScreen, Forcescaled
User avatar
Alekv
 
Joined: 08 Jun 2015
Location: My world :)

Re: How Do I SBARINFO? - A Tutorial

Postby Silentdarkness12 » Tue Jul 26, 2016 4:25 pm

You know what's weird?

I turned off ForceScaled, and I think it might be fixed. Might. Not sure.

Someone want to confirm this for me?
User avatar
Silentdarkness12
Level 7: ZScript Victim
 
Joined: 15 Aug 2013
Location: Plains of Pride

Re: How Do I SBARINFO? - A Tutorial

Postby Silentdarkness12 » Thu Sep 01, 2016 3:01 pm

Having a minor confusion here on SBARINFO.

Doing more work on the Hideous Destructor addon.

InInventory ShotgunTube,8
{
DrawImage "SHLHC0",325,78,center,10,10;
}

This doesn't seem to be working. If it take the DrawImage line and put it outside of the InInventory set, it works just fine. However, it doesn't work right here, for some reason.

Why?
User avatar
Silentdarkness12
Level 7: ZScript Victim
 
Joined: 15 Aug 2013
Location: Plains of Pride

Re: How Do I SBARINFO? - A Tutorial

Postby Blue Shadow » Thu Sep 01, 2016 3:55 pm

It'll work if the player has 8 or more ShotgunTube items in the inventory.
User avatar
Blue Shadow
 
 
 
Joined: 14 Nov 2010
Operating System: Windows 10/8.1/8 64-bit
Graphics Processor: ATI Radeon (Modern GZDoom)

Re: How Do I SBARINFO? - A Tutorial

Postby Silentdarkness12 » Thu Sep 01, 2016 4:39 pm

Yep. And the maximum of ShotgunTube IS 8.

I've used the same inventory item check earlier on in SBARINFO and it works just fine.....but not here....

http://pastebin.com/3BMkdqUz

EDIT: Okay, i'm stupid. It's 7, not 8. Nevermind.
User avatar
Silentdarkness12
Level 7: ZScript Victim
 
Joined: 15 Aug 2013
Location: Plains of Pride

Re: How Do I SBARINFO? - A Tutorial

Postby wildweasel » Fri Sep 02, 2016 6:15 pm

I was about to say, I can't look through this. It really could use some cleaning up, because nearly 3000 lines of SBARINFO - and not even for a gigantic in game information system like DRLA's - seems like insane overkill. There must be a cleaner and more readable way to do a lot of this, no offense intended.
User avatar
wildweasel
「お前はもうトースト」[you are already toast.]
Moderator Team Lead
 
Joined: 15 Jul 2003

Re: How Do I SBARINFO? - A Tutorial

Postby Silentdarkness12 » Fri Sep 02, 2016 9:04 pm

None taken. I can understand it.

Well, if you know such a way, i'm listening. It could just be that what i'm making is really quite complicated and not simple to do at all in SBARINFO.

Although I did realize that there was no need to have many lines just for closing brackets.

Honestly, it's not *that* hard to decipher. It's cut up into sections, one section for each weapon.
User avatar
Silentdarkness12
Level 7: ZScript Victim
 
Joined: 15 Aug 2013
Location: Plains of Pride

Re: How Do I SBARINFO? - A Tutorial

Postby arookas » Sat Sep 03, 2016 7:50 am

You could try to simplify it by not using else/if for the ammo sprite bars and drawing only one sprite per ininventory, like this:

Code: Select allExpand view
InInventory HDSecondPistolLoaded, 15 {
  DrawImage "BULLD0",321,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 14 {
  DrawImage "BULLD0",324,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 13 {
  DrawImage "BULLD0",327,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 12 {
  DrawImage "BULLD0",330,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 11 {
  DrawImage "BULLD0",333,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 10 {
  DrawImage "BULLD0",336,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 9 {
  DrawImage "BULLD0",339,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 8 {
  DrawImage "BULLD0",342,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 7 {
  DrawImage "BULLD0",345,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 6 {
  DrawImage "BULLD0",348,88,none,8,8;
}
InInventory HDSecondPistolLoaded, 5 {
  DrawImage "BULLD0",328,95,none,8,8;
}
InInventory HDSecondPistolLoaded, 4 {
  DrawImage "BULLD0",331,95,none,8,8;
}
InInventory HDSecondPistolLoaded, 3 {
  DrawImage "BULLD0",334,95,none,8,8;
}
InInventory HDSecondPistolLoaded, 2 {
  DrawImage "BULLD0",337,95,none,8,8;
}
InInventory HDSecondPistolLoaded, 1 {
  DrawImage "BULLD0",340,95,none,8,8;
}

You could also utilize weapon primary/secondary ammo icons, as well as weapon icons so that you only draw icons for the weapons/ammo in one place. You could then set the offsets of specific icons in their respective graphic files if you need to have the positions differ.
User avatar
arookas
...but only sometimes.
 
Joined: 24 Jan 2011

PreviousNext

Return to Tutorials

Who is online

Users browsing this forum: No registered users and 0 guests