[Solved]HolywarsNexgenHudFix

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

Re: HolywarsNexgenHudFix

Post by Barbie » Thu Oct 13, 2022 10:12 pm

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
Experienced
Posts: 120
Joined: Sat Nov 30, 2019 10:56 pm

Re: HolywarsNexgenHudFix

Post by Eternity » Thu Oct 13, 2022 10:38 pm

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
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: HolywarsNexgenHudFix

Post by Letylove49 » Thu Oct 13, 2022 11:19 pm

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;
}
<[MHA]>Letylove49 aka -=]UK[=-Shado

Eternity
Experienced
Posts: 120
Joined: Sat Nov 30, 2019 10:56 pm

Re: HolywarsNexgenHudFix

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

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: HolywarsNexgenHudFix

Post by Letylove49 » Fri Oct 14, 2022 2:04 pm

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.
<[MHA]>Letylove49 aka -=]UK[=-Shado

Letylove49
Skilled
Posts: 174
Joined: Tue Feb 28, 2012 7:47 pm
Personal rank: <[MHA]> /UK Admin
Location: suisse

Re: HolywarsNexgenHudFix

Post by Letylove49 » Fri Oct 28, 2022 11:38 pm

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];
	}
*/
  
<[MHA]>Letylove49 aka -=]UK[=-Shado