[Rant] Mods that use HUD Messages

Discuss anything ZDoom-related that doesn't fall into one of the other categories.
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Nash »

Code: Select all

(GetCVar("vid_defwidth") / 4) + 0.0
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Kinsie »

Thanks.

EDIT: Not working. Can you figure this out, sorry?

Code: Select all

hudmessage (s:"The Slots Are Rolling..."; HUDMSG_FADEOUT, 1, 5, (GetCVar("vid_defwidth") / 4) + 0.0, 32.0, 2.0, 1.0);
Last edited by Kinsie on Fri Jan 20, 2012 5:46 am, edited 1 time in total.
User avatar
Jimmy
 
 
Posts: 4728
Joined: Mon Apr 10, 2006 1:49 pm
Preferred Pronouns: He/Him
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Jimmy »

Either that or << 16. :P

edit: :ninja: 'd
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Nash »

What Jimmy said.

Code: Select all

int x = (GetCVar("vid_defwidth") / 4);
hudmessage (s:"The Slots Are Rolling..."; HUDMSG_FADEOUT, 1, 5, (x << 16), 32.0, 2.0, 1.0);
 
EDIT: Jimmy, I've never tried your mod before. Will try in a bit and let you know how it looks in several resolutions (I test in all resolutions, not just my native 1920x1200).
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Kinsie »

Thanks a bunch! Now for something ultra picky.

Code: Select all

	int ar = GetAspectRatio();
	
	if (ar != ASPECT_4_3)
	{
		SetHUDSize((GetCVar("vid_defwidth") / 2.5), (GetCVar("vid_defheight") / 2), 1); //SetHudSize(640, 400, 1);
	} else {
		SetHUDSize((GetCVar("vid_defwidth") / 2), (GetCVar("vid_defheight") / 2), 1); //SetHudSize(640, 400, 1);
	}
The decimal in the code is the closest I can come to compensating for widescreen, but it just causes the messages to not render. Any ideas?
User avatar
Zippy
Posts: 3302
Joined: Wed Mar 23, 2005 5:31 pm
Location: New Jersey

Re: [Rant] Mods that use HUD Messages

Post by Zippy »

Kinsie wrote:

Code: Select all

(GetCVar("vid_defwidth") / 2.5)
Fixed point division is a special case that should be done with [wiki]FixedDiv[/wiki]. Otherwise, "vid_defwidth / 2.5" is the same thing as "vid_defwidth / 327682".
User avatar
The Ultimate DooMer
Posts: 2109
Joined: Tue Jul 15, 2003 5:29 pm
Location: Industrial Zone

Re: [Rant] Mods that use HUD Messages

Post by The Ultimate DooMer »

Nash wrote:Large overlapping texts all over the place (as was the case with Serpent: Resurrection and Reelism).

1) Predetermine a HUD size so that the message will appear at a consistant size, independant of the user's screen settings ([wiki]SetHudSize[/wiki]). This is a modding convention that I have practiced for many years, even before I noticed my first annoyance with the issue at hand.
But Serpent does use SetHudSize.
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Kinsie »

Zippy wrote:
Kinsie wrote:

Code: Select all

(GetCVar("vid_defwidth") / 2.5)
Fixed point division is a special case that should be done with [wiki]FixedDiv[/wiki]. Otherwise, "vid_defwidth / 2.5" is the same thing as "vid_defwidth / 327682".
Sorry to bump this, but can someone handle this for me? I still can't seem to get the horizontal scaling right on widescreen (line 4), even with this.

Code: Select all

	ar = GetAspectRatio();
	if (ar != ASPECT_4_3)
	{
		SetHUDSize((GetCVar("vid_defwidth") / 3), (GetCVar("vid_defheight") / 2), 1); //SetHudSize(640, 400, 1);
		fuckhacksforever = (GetCVar("vid_defwidth") / 6);
	} else {
		SetHUDSize((GetCVar("vid_defwidth") / 2), (GetCVar("vid_defheight") / 2), 1); //SetHudSize(640, 400, 1);
		fuckhacksforever = (GetCVar("vid_defwidth") / 4);
	}
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Kinsie »

Anyone?
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Nash »

I'll have a look at it later...
User avatar
printz
Posts: 2649
Joined: Thu Oct 26, 2006 12:08 pm
Location: Bucharest, Romania
Contact:

Re: [Rant] Mods that use HUD Messages

Post by printz »

What about just using print and being laconic with it (to cope with the stupid fixed display time -- didn't the Id and Raven devs ever think about time-per-character display)? Won't print and printbold messages scale automatically in the same manner as top messages?
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Nash »

Hmm, I don't see why it isn't working. If you perform the expressions in your SetHUDSize calls on a single variable and try to output the variable to screen, what do you see?
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Kinsie »

I mean, it views fine, but the horizontal scaling in widescreen is larger than I want, since it's divided by 3 instead of 2.5, so there's text wrapping around to a new line when i don't want it to.
User avatar
Nash
 
 
Posts: 17505
Joined: Mon Oct 27, 2003 12:07 am
Location: Kuala Lumpur, Malaysia
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Nash »

Code: Select all

SetHUDSize(FixedDiv(GetCVar("vid_defwidth"), 2.5), GetCVar("vid_defheight") / 2, 1);
 
Does this work?
User avatar
Kinsie
Posts: 7402
Joined: Fri Oct 22, 2004 9:22 am
Graphics Processor: nVidia with Vulkan support
Location: MAP33
Contact:

Re: [Rant] Mods that use HUD Messages

Post by Kinsie »

Perfect! Thanks a ton.
Post Reply

Return to “General”