[Solved]HolywarsNexgenHudFix

Discussions about Coding and Scripting
User avatar
Barbie
Godlike
Posts: 2792
Joined: Fri Sep 25, 2015 9:01 pm
Location: moved without proper hashing

Re: HolywarsNexgenHudFix

Post by Barbie »

Letylove49 wrote: Thu Oct 13, 2022 8:41 pm now i got this : Call to setup1: bad or missing parameter 1.
Well... Maybe learn the basics first?
"Multiple exclamation marks," he went on, shaking his head, "are a sure sign of a diseased mind." --Terry Pratchett
Eternity
Skilled
Posts: 166
Joined: Sat Nov 30, 2019 10:56 pm

Re: HolywarsNexgenHudFix

Post by Eternity »

Letylove49 wrote: Thu Oct 13, 2022 8:41 pm ok
now i got this : Call to setup1: bad or missing parameter 1.
If i understand it right way, each occurrence of "setup(c)" call (there are 3 of them) must be replaced to "GetsetupName(c)".
Also, GetsetupName function must look this way then:

Code: Select all

simulated function GetsetupName(Canvas c)
{
	if (PlayerPawn(Owner) != None)
		if (PlayerPawn(Owner).GameReplicationInfo != None)
			if (PlayerPawn(Owner).GameReplicationInfo.IsA('HolyWarsReplicationInfo'))
				setup1(c);
			else
				setup(c);
}
Problem is that it is necessary to understand how does the whole thing work... But suggestions provided here made with quite unclear vision what are these pieces of code part of...
So, most likely issues will proceed to occur anyway.
Also, any help here could be much more effective if at least some basic homework was done...
Letylove49
Adept
Posts: 277
Joined: Tue Feb 28, 2012 7:47 pm
Location: suisse
Contact:

Re: HolywarsNexgenHudFix

Post by Letylove49 »

ok now i'm able to compile but that don't work like expected.
pehaps i should show how the Hud should work on Holywars .

This come from the mod Holywars. ( pehaps i should put it directely on file NexgenHud.uc

Code: Select all

 //=============================================================================
class HolyWarsHUD expands ChallengeHUD;

simulated function HUDSetup(canvas canvas)
{
	local String MyName, SaintName;
	local bool bHeretic;

	Super.HUDSetup(canvas);

	MyName = PlayerOwner.PlayerReplicationInfo.PlayerName;
	bHeretic = HolyPRI(PlayerOwner.PlayerReplicationInfo).bHeretic;
	SaintName = HolyWarsReplicationInfo( PlayerOwner.GameReplicationInfo ).TheSaint;

	if( MyName == SaintName )
		HUDColor = GoldColor;
	else if( bHeretic )
		HUDColor = RedColor;
	else
		HUDColor = BlueColor;

	SolidHUDColor = HUDColor;
	if ( Level.bHighDetailMode )
		HUDColor = Opacity * 0.0625 * HUDColor;
}
Image



Letylove49 aka Alicia
Eternity
Skilled
Posts: 166
Joined: Sat Nov 30, 2019 10:56 pm

Re: HolywarsNexgenHudFix

Post by Eternity »

Something is not alright there... Look at the call chain/sequence - from ChallengeHUD.PostRender to HUD Mutators PostRender calls and you will realize this issue normally should not occur and such fix should not be needed at all.
Because at the point NexgenHUD is being drawn HolyWarsHUD.HUDSetup function was already executed and proper HUDColor value assigned.
Maybe HUDColor value is overridden and not restored somewhere else - for example, in some of the HUD mutators...
Letylove49 wrote: Thu Oct 13, 2022 11:19 pm This come from the mod Holywars. ( pehaps i should put it directely on file NexgenHud.uc

Code: Select all

bHeretic = HolyPRI(PlayerOwner.PlayerReplicationInfo).bHeretic;
SaintName = HolyWarsReplicationInfo( PlayerOwner.GameReplicationInfo ).TheSaint;
Mod-specific properties access may bring another issues or undesirable side effects in this case, it is better to avoid this...
Letylove49
Adept
Posts: 277
Joined: Tue Feb 28, 2012 7:47 pm
Location: suisse
Contact:

Re: HolywarsNexgenHudFix

Post by Letylove49 »

Eternity wrote: Fri Oct 14, 2022 8:43 am Something is not alright there... Look at the call chain/sequence - from ChallengeHUD.PostRender to HUD Mutators PostRender calls and you will realize this issue normally should not occur and such fix should not be needed at all.
Because at the point NexgenHUD is being drawn HolyWarsHUD.HUDSetup function was already executed and proper HUDColor value assigned.
Maybe HUDColor value is overridden and not restored somewhere else - for example, in some of the HUD mutators...
Letylove49 wrote: Thu Oct 13, 2022 11:19 pm This come from the mod Holywars. ( pehaps i should put it directely on file NexgenHud.uc

Code: Select all

bHeretic = HolyPRI(PlayerOwner.PlayerReplicationInfo).bHeretic;
SaintName = HolyWarsReplicationInfo( PlayerOwner.GameReplicationInfo ).TheSaint;
Mod-specific properties access may bring another issues or undesirable side effects in this case, it is better to avoid this...
i think i will keep the fix that i have done on Nexgen112N in this case.
The problem with the useUTHUDColor only concerns the Nexgenhud and does not affect the original hud so it is not too annoying especially in this case it is not a public version.
Image



Letylove49 aka Alicia
Letylove49
Adept
Posts: 277
Joined: Tue Feb 28, 2012 7:47 pm
Location: suisse
Contact:

Re: HolywarsNexgenHudFix

Post by Letylove49 »

Good new i have fund a way to make work Holywars without loste the function UseUTHudColor:

Code: Select all

 // Set base hud color.
     baseHUDColor = ChallengeHUD(player.myHUD).HUDColor; // use the HUD colour set in UT prefs


     if(useUTHUDColor==True)

{  baseHUDColor = ChallengeHUD(player.myHUD).HUDColor; 
 } else { baseHUDColor = baseColors[player.playerReplicationInfo.team];
}


/*
	if (player == none || player.playerReplicationInfo == none || player.gameReplicationInfo == none) {
		baseHUDColor = baseColors[5];
	} else if (player.playerReplicationInfo.bIsSpectator &&
	    !player.playerReplicationInfo.bWaitingPlayer) {
		baseHUDColor = baseColors[4];
	} else if (useUTHUDColor || (!player.gameReplicationInfo.bTeamGame && ChallengeHUD(player.myHUD) != none)) {
		baseHUDColor = ChallengeHUD(player.myHUD).favoriteHUDColor * 15.9;
	} else if (0 <= player.playerReplicationInfo.team && player.playerReplicationInfo.team <= 3) {
		baseHUDColor = baseColors[player.playerReplicationInfo.team];
	} else {
		baseHUDColor = baseColors[5];
	}
*/
  
Image



Letylove49 aka Alicia
Post Reply