Do you think that is unpossible to fix that ?
[Solved]HolywarsNexgenHudFix
-
- Adept
- Posts: 278
- Joined: Tue Feb 28, 2012 7:47 pm
- Location: suisse
-
- Adept
- Posts: 388
- Joined: Mon Nov 11, 2013 7:56 am
- Personal rank: Average
- Location: India
Re: HolywarsNexgenHudFix
I don't have much coding knowledge but in this case it clearly seems Nexgen HUD is not following the owner's hud color, Nexgen needs to follow the owner's HUD color so find the color changing code in Challenge HUD then add it to Nexgen HUD, no need to write any super classes maybe it requires timer to add this.
-
- Adept
- Posts: 388
- Joined: Mon Nov 11, 2013 7:56 am
- Personal rank: Average
- Location: India
Re: HolywarsNexgenHudFix
I tested the holy wars with nexgen and it's working for me, which version of nexgen HUD are you using?
Code: Select all
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor;
You do not have the required permissions to view the files attached to this post.
-
- Adept
- Posts: 278
- Joined: Tue Feb 28, 2012 7:47 pm
- Location: suisse
Re: HolywarsNexgenHudFix
Deepu wrote: ↑Wed Oct 05, 2022 6:47 amI tested the holy wars with nexgen and it's working for me, which version of nexgen HUD are you using?
Shot00038.png
Code: Select all
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor;
wich version of Nexgen are you using ? ( i have tested with Nexgen112 same probleme.
i use this version :
Code: Select all
/***************************************************************************************************
*
* $DESCRIPTION Initializes/updates the variables used in the rendering procedure.
* $PARAM c Canvas object that provides the drawing capabilities.
* $REQUIRE c != none
* $ENSURE c.font != none
*
**************************************************************************************************/
simulated function setup(Canvas c) {
local int index;
local bool bUpdateBase;
local float dummy;
// Make sure the font ain't none.
if (baseFont == none) baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
// Get local PlayerPawn.
player = c.viewport.actor;
// Set base hud color.
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];
}
// Fix offset
C.bCenter = false;
// Prevent redundant setups.
if (lastSetupTime == level.timeSeconds) {
return;
}
// Timer control.
timeSeconds += (level.timeSeconds - lastLevelTimeSeconds) / level.timeDilation;
lastLevelTimeSeconds = level.timeSeconds;
// Check if the base variables need to be updated.
bUpdateBase = lastResX != c.clipX ||
lastResY != c.clipY ||
bForceUpdate;
// Update HUD base variables.
if (bUpdateBase) {
// General variables.
baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
c.strLen("Online [00:00]", minPanelWidth, baseFontHeight);
lastResX = c.clipX;
lastResY = c.clipY;
// Message box info.
msgBoxWidth = int(c.clipX * 0.75);
msgBoxLineHeight = int(baseFontHeight + 4.0);
msgBoxHeight = msgBoxLineHeight * chatMsgMaxCount;
// Other messages.
otherFont = getFont(otherMsgSize, c);
c.font = otherFont;
c.strLen("XXX", dummy, otherFontHeight);
bForceUpdate = false;
}
// Remove expired messages.
if (chatMsgCount > 0 && timeSeconds - chatMessages[0].timeStamp > chatMessageLifeTime) {
for (index = 1; index < chatMsgCount; index++) {
chatMessages[index - 1] = chatMessages[index];
}
chatMsgCount--;
if (chatMsgCount == 0) {
faceImg = none;
}
}
if (msgCount > 0 && timeSeconds - messages[0].timeStamp > messageLifeTime) {
for (index = 1; index < msgCount; index++) {
messages[index - 1] = messages[index];
}
msgCount--;
}
lastSetupTime = level.timeSeconds;
}
-
- Adept
- Posts: 388
- Joined: Mon Nov 11, 2013 7:56 am
- Personal rank: Average
- Location: India
Re: HolywarsNexgenHudFix
Try Nexgen 112 MH edition or UP2
You do not have the required permissions to view the files attached to this post.
-
- Adept
- Posts: 278
- Joined: Tue Feb 28, 2012 7:47 pm
- Location: suisse
Re: HolywarsNexgenHudFix
that work with the Nexgen112N because i have do this fix:
i'm trying to fix that on Nexgen112SDL ( a new private version) like it but that doesn't work.
I have so far fixed the problem by applying the same method as in Nexgen112N but I am not 100% satisfied because it disables the "useUTHUDColor" function
Nexgen112SDL is a private version based on Nexgen113 develloped by Spongebob who are no longer develloped for the moment.
Code: Select all
/***************************************************************************************************
*
* $DESCRIPTION Initializes/updates the variables used in the rendering procedure.
* $PARAM c Canvas object that provides the drawing capabilities.
* $REQUIRE c != none
* $ENSURE c.font != none
*
**************************************************************************************************/
simulated function setup(Canvas c) {
local int index;
local bool bUpdateBase;
// Make sure the font ain't none.
if (baseFont == none) baseFont = getStaticSmallestFont(c.clipX);
c.font = baseFont;
// Get local PlayerPawn.
player = c.viewport.actor;
// Set base hud color.
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor; // use the HUD colour set in UT prefs
/* 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 (!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];
}
*/
// Prevent redundant setups.
if (lastSetupTime == level.timeSeconds) {
return;
}
// Timer control.
timeSeconds += (level.timeSeconds - lastLevelTimeSeconds) / level.timeDilation;
lastLevelTimeSeconds = level.timeSeconds;
// Check if the base variables need to be updated.
bUpdateBase = lastResX != c.clipX ||
lastResY != c.clipY;
// Update HUD base variables.
if (bUpdateBase) {
// Set base hud color.
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor; // use the HUD colour set in UT prefs
// General variables.
baseFont = getStaticSmallestFont(c.clipX);
c.font = baseFont;
c.strLen("Online [00:00]", minPanelWidth, baseFontHeight);
lastResX = c.clipX;
lastResY = c.clipY;
// Message box info.
msgBoxWidth = int(c.clipX * 0.75);
msgBoxLineHeight = int(baseFontHeight + 4.0);
msgBoxHeight = msgBoxLineHeight * arrayCount(chatMessages);
}
// Remove expired messages.
if (chatMsgCount > 0 && timeSeconds - chatMessages[0].timeStamp > chatMessageLifeTime) {
for (index = 1; index < chatMsgCount; index++) {
chatMessages[index - 1] = chatMessages[index];
}
chatMsgCount--;
if (chatMsgCount == 0) {
faceImg = none;
}
}
if (msgCount > 0 && timeSeconds - messages[0].timeStamp > messageLifeTime) {
for (index = 1; index < msgCount; index++) {
messages[index - 1] = messages[index];
}
msgCount--;
}
lastSetupTime = level.timeSeconds;
}
Code: Select all
/***************************************************************************************************
*
* $DESCRIPTION Initializes/updates the variables used in the rendering procedure.
* $PARAM c Canvas object that provides the drawing capabilities.
* $REQUIRE c != none
* $ENSURE c.font != none
*
**************************************************************************************************/
simulated function setup(Canvas c) {
local int index;
local bool bUpdateBase;
local float dummy;
// Make sure the font ain't none.
if (baseFont == none) baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
// Get local PlayerPawn.
player = c.viewport.actor;
// Set base hud color.
if (Level.Game.IsA('HolyWarsGame')){
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor;
}else
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];
}
// Fix offset
C.bCenter = false;
// Prevent redundant setups.
if (lastSetupTime == level.timeSeconds) {
return;
}
// Timer control.
timeSeconds += (level.timeSeconds - lastLevelTimeSeconds) / level.timeDilation;
lastLevelTimeSeconds = level.timeSeconds;
// Check if the base variables need to be updated.
bUpdateBase = lastResX != c.clipX ||
lastResY != c.clipY ||
bForceUpdate;
// Update HUD base variables.
if (bUpdateBase) {
// Set base hud color.
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor; // use the HUD colour set in UT prefs
// General variables.
baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
c.strLen("Online [00:00]", minPanelWidth, baseFontHeight);
lastResX = c.clipX;
lastResY = c.clipY;
// Message box info.
msgBoxWidth = int(c.clipX * 0.75);
msgBoxLineHeight = int(baseFontHeight + 4.0);
msgBoxHeight = msgBoxLineHeight * chatMsgMaxCount;
// Other messages.
otherFont = getFont(otherMsgSize, c);
c.font = otherFont;
c.strLen("XXX", dummy, otherFontHeight);
bForceUpdate = false;
}
// Remove expired messages.
if (chatMsgCount > 0 && timeSeconds - chatMessages[0].timeStamp > chatMessageLifeTime) {
for (index = 1; index < chatMsgCount; index++) {
chatMessages[index - 1] = chatMessages[index];
}
chatMsgCount--;
if (chatMsgCount == 0) {
faceImg = none;
}
}
if (msgCount > 0 && timeSeconds - messages[0].timeStamp > messageLifeTime) {
for (index = 1; index < msgCount; index++) {
messages[index - 1] = messages[index];
}
msgCount--;
}
lastSetupTime = level.timeSeconds;
}
I have so far fixed the problem by applying the same method as in Nexgen112N but I am not 100% satisfied because it disables the "useUTHUDColor" function
Nexgen112SDL is a private version based on Nexgen113 develloped by Spongebob who are no longer develloped for the moment.
-
- Adept
- Posts: 388
- Joined: Mon Nov 11, 2013 7:56 am
- Personal rank: Average
- Location: India
-
- Adept
- Posts: 278
- Joined: Tue Feb 28, 2012 7:47 pm
- Location: suisse
Re: HolywarsNexgenHudFix
i have try to creat a 2nd fonction
Code: Select all
/***************************************************************************************************
*
* $DESCRIPTION Initializes/updates the variables used in the rendering procedure.
* $PARAM c Canvas object that provides the drawing capabilities.
* $REQUIRE c != none
* $ENSURE c.font != none
*
**************************************************************************************************/
simulated function setup(Canvas c) {
local int index;
local bool bUpdateBase;
local float dummy;
// Make sure the font ain't none.
if (baseFont == none) baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
// Get local PlayerPawn.
player = c.viewport.actor;
// Set base hud color.
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];
}
// Fix offset
C.bCenter = false;
// Prevent redundant setups.
if (lastSetupTime == level.timeSeconds) {
return;
}
// Timer control.
timeSeconds += (level.timeSeconds - lastLevelTimeSeconds) / level.timeDilation;
lastLevelTimeSeconds = level.timeSeconds;
// Check if the base variables need to be updated.
bUpdateBase = lastResX != c.clipX ||
lastResY != c.clipY ||
bForceUpdate;
// Update HUD base variables.
if (bUpdateBase) {
// Set base hud color.
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor;
// General variables.
baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
c.strLen("Online [00:00]", minPanelWidth, baseFontHeight);
lastResX = c.clipX;
lastResY = c.clipY;
// Message box info.
msgBoxWidth = int(c.clipX * 0.75);
msgBoxLineHeight = int(baseFontHeight + 4.0);
msgBoxHeight = msgBoxLineHeight * chatMsgMaxCount;
// Other messages.
otherFont = getFont(otherMsgSize, c);
c.font = otherFont;
c.strLen("XXX", dummy, otherFontHeight);
bForceUpdate = false;
}
// Remove expired messages.
if (chatMsgCount > 0 && timeSeconds - chatMessages[0].timeStamp > chatMessageLifeTime) {
for (index = 1; index < chatMsgCount; index++) {
chatMessages[index - 1] = chatMessages[index];
}
chatMsgCount--;
if (chatMsgCount == 0) {
faceImg = none;
}
}
if (msgCount > 0 && timeSeconds - messages[0].timeStamp > messageLifeTime) {
for (index = 1; index < msgCount; index++) {
messages[index - 1] = messages[index];
}
msgCount--;
}
lastSetupTime = level.timeSeconds;
}
/***************************************************************************************************
*
* $DESCRIPTION Initializes/updates the variables used in the rendering procedure.
* $PARAM c Canvas object that provides the drawing capabilities.
* $REQUIRE c != none
* $ENSURE c.font != none
*
**************************************************************************************************/
simulated function setup1(Canvas c) {
local int index;
local bool bUpdateBase;
local float dummy;
if (Level.Game.IsA('HolyWarsGame'))
// Make sure the font ain't none.
if (baseFont == none) baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
// Get local PlayerPawn.
player = c.viewport.actor;
// Set base hud color.
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor;
// Fix offset
C.bCenter = false;
// Prevent redundant setups.
if (lastSetupTime == level.timeSeconds) {
return;
}
// Timer control.
timeSeconds += (level.timeSeconds - lastLevelTimeSeconds) / level.timeDilation;
lastLevelTimeSeconds = level.timeSeconds;
// Check if the base variables need to be updated.
bUpdateBase = lastResX != c.clipX ||
lastResY != c.clipY ||
bForceUpdate;
// Update HUD base variables.
if (bUpdateBase) {
// Set base hud color.
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor;
// General variables.
baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
c.strLen("Online [00:00]", minPanelWidth, baseFontHeight);
lastResX = c.clipX;
lastResY = c.clipY;
// Message box info.
msgBoxWidth = int(c.clipX * 0.75);
msgBoxLineHeight = int(baseFontHeight + 4.0);
msgBoxHeight = msgBoxLineHeight * chatMsgMaxCount;
// Other messages.
otherFont = getFont(otherMsgSize, c);
c.font = otherFont;
c.strLen("XXX", dummy, otherFontHeight);
bForceUpdate = false;
}
// Remove expired messages.
if (chatMsgCount > 0 && timeSeconds - chatMessages[0].timeStamp > chatMessageLifeTime) {
for (index = 1; index < chatMsgCount; index++) {
chatMessages[index - 1] = chatMessages[index];
}
chatMsgCount--;
if (chatMsgCount == 0) {
faceImg = none;
}
}
if (msgCount > 0 && timeSeconds - messages[0].timeStamp > messageLifeTime) {
for (index = 1; index < msgCount; index++) {
messages[index - 1] = messages[index];
}
msgCount--;
}
lastSetupTime = level.timeSeconds;
}
-
- Adept
- Posts: 388
- Joined: Mon Nov 11, 2013 7:56 am
- Personal rank: Average
- Location: India
Re: HolywarsNexgenHudFix
"useUTHUDColor" means customized UT's HUD color right, any color if you customized with UT's HUD, it will copy the same color from master HUD class (ChallengeHUD), IDK why are you still stick with this.
-
- Godlike
- Posts: 2911
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: HolywarsNexgenHudFix
I don't understand such:
Code: Select all
class PlayerReplicationInfo expands ReplicationInfo
...
var byte Team; // Player Team, 255 = None for player.
Not wrong but useless because Team cannot go below zero.Letylove49 wrote: ↑Wed Oct 05, 2022 9:19 pmCode: Select all
simulated function setup(Canvas c) { ... if (0 <= player.playerReplicationInfo.team ...
"If Origin not in center it be not in center." --Buggie
-
- Adept
- Posts: 278
- Joined: Tue Feb 28, 2012 7:47 pm
- Location: suisse
Re: HolywarsNexgenHudFix
is not me who wrote this code but Defrost.Barbie wrote: ↑Fri Oct 07, 2022 1:58 pm I don't understand such:Code: Select all
class PlayerReplicationInfo expands ReplicationInfo ... var byte Team; // Player Team, 255 = None for player.
Not wrong but useless because Team cannot go below zero.Letylove49 wrote: ↑Wed Oct 05, 2022 9:19 pmCode: Select all
simulated function setup(Canvas c) { ... if (0 <= player.playerReplicationInfo.team ...
m<y goal is to set the Holywars hud on the right color who is used by this gametype but with the code that don't work. The only way i have fund until now is to use the same fix that i use on MHA edtion ( desable the orignial code and replace it by
Code: Select all
ChallengeHUD(player.myHUD).HUDColor; // use the HUD colour set in UT prefs
Code: Select all
// Set base hud color.
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor; // use the HUD colour set in UT prefs
/* 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 (!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];
}
*/
-
- Adept
- Posts: 278
- Joined: Tue Feb 28, 2012 7:47 pm
- Location: suisse
Error: C:\UT coding\UnrealTournament\Nexgen112SDL\Classes\NexgenHUD.uc(786) : Error, Unexpected 'if'
Error: C:\UT coding\UnrealTournament\Nexgen112SDL\Classes\NexgenHUD.uc(786) : Error, Unexpected 'if'
Code: Select all
/***************************************************************************************************
*
* $DESCRIPTION Initializes/updates the variables used in the rendering procedure.
* if gametype Holywars Goto setup1 else setup
*
*
**************************************************************************************************/
// check wich function muste be used;
if(Level.Game.IsA('HolyWarsGame')) goto Function setup1;
else goto function setup;
/***************************************************************************************************
*
* $DESCRIPTION Initializes/updates the variables used in the rendering procedure.
* $PARAM c Canvas object that provides the drawing capabilities.
* $REQUIRE c != none
* $ENSURE c.font != none
*
**************************************************************************************************/
simulated function setup(Canvas c) {
local int index;
local bool bUpdateBase;
local float dummy;
// Make sure the font ain't none.
if (baseFont == none) baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
// Get local PlayerPawn.
player = c.viewport.actor;
// Set base hud color.
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];
}
// Fix offset
C.bCenter = false;
// Prevent redundant setups.
if (lastSetupTime == level.timeSeconds) {
return;
}
// Timer control.
timeSeconds += (level.timeSeconds - lastLevelTimeSeconds) / level.timeDilation;
lastLevelTimeSeconds = level.timeSeconds;
// Check if the base variables need to be updated.
bUpdateBase = lastResX != c.clipX ||
lastResY != c.clipY ||
bForceUpdate;
// Update HUD base variables.
if (bUpdateBase) {
// Set base hud color.
// General variables.
baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
c.strLen("Online [00:00]", minPanelWidth, baseFontHeight);
lastResX = c.clipX;
lastResY = c.clipY;
// Message box info.
msgBoxWidth = int(c.clipX * 0.75);
msgBoxLineHeight = int(baseFontHeight + 4.0);
msgBoxHeight = msgBoxLineHeight * chatMsgMaxCount;
// Other messages.
otherFont = getFont(otherMsgSize, c);
c.font = otherFont;
c.strLen("XXX", dummy, otherFontHeight);
bForceUpdate = false;
}
// Remove expired messages.
if (chatMsgCount > 0 && timeSeconds - chatMessages[0].timeStamp > chatMessageLifeTime) {
for (index = 1; index < chatMsgCount; index++) {
chatMessages[index - 1] = chatMessages[index];
}
chatMsgCount--;
if (chatMsgCount == 0) {
faceImg = none;
}
}
if (msgCount > 0 && timeSeconds - messages[0].timeStamp > messageLifeTime) {
for (index = 1; index < msgCount; index++) {
messages[index - 1] = messages[index];
}
msgCount--;
}
lastSetupTime = level.timeSeconds;
}
/***************************************************************************************************
*
* $DESCRIPTION Initializes/updates the variables used in the rendering procedure.
* $PARAM c Canvas object that provides the drawing capabilities.
* $REQUIRE c != none
* $ENSURE c.font != none
*
**************************************************************************************************/
simulated function setup1(Canvas c) {
local int index;
local bool bUpdateBase;
local float dummy;
// Make sure the font ain't none.
if (baseFont == none) baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
// Get local PlayerPawn.
player = c.viewport.actor;
// Set base hud color.
baseHUDColor = ChallengeHUD(player.myHUD).HUDColor;
/*
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];
}
*/
// Fix offset
C.bCenter = false;
// Prevent redundant setups.
if (lastSetupTime == level.timeSeconds) {
return;
}
// Timer control.
timeSeconds += (level.timeSeconds - lastLevelTimeSeconds) / level.timeDilation;
lastLevelTimeSeconds = level.timeSeconds;
// Check if the base variables need to be updated.
bUpdateBase = lastResX != c.clipX ||
lastResY != c.clipY ||
bForceUpdate;
// Update HUD base variables.
if (bUpdateBase) {
// Set base hud color.
// General variables.
baseFont = getFont(chatMsgSize, c);
c.font = baseFont;
c.strLen("Online [00:00]", minPanelWidth, baseFontHeight);
lastResX = c.clipX;
lastResY = c.clipY;
// Message box info.
msgBoxWidth = int(c.clipX * 0.75);
msgBoxLineHeight = int(baseFontHeight + 4.0);
msgBoxHeight = msgBoxLineHeight * chatMsgMaxCount;
// Other messages.
otherFont = getFont(otherMsgSize, c);
c.font = otherFont;
c.strLen("XXX", dummy, otherFontHeight);
bForceUpdate = false;
}
// Remove expired messages.
if (chatMsgCount > 0 && timeSeconds - chatMessages[0].timeStamp > chatMessageLifeTime) {
for (index = 1; index < chatMsgCount; index++) {
chatMessages[index - 1] = chatMessages[index];
}
chatMsgCount--;
if (chatMsgCount == 0) {
faceImg = none;
}
}
if (msgCount > 0 && timeSeconds - messages[0].timeStamp > messageLifeTime) {
for (index = 1; index < msgCount; index++) {
messages[index - 1] = messages[index];
}
msgCount--;
}
lastSetupTime = level.timeSeconds;
}
-
- Skilled
- Posts: 178
- Joined: Sat Nov 30, 2019 10:56 pm
Re: HolywarsNexgenHudFix
As it was mentioned above, Level.Game is None if Level.NetMode==NM_Client (need to use another GameType sign that exists client side, for example GameReplicationInfo).
Also, initialization scripts should be called from within some event (such as PostBeginPlay), and using proper UC syntax...
These "setup(Canvas s)" functions obviously must be called from PostRender event.
Also, initialization scripts should be called from within some event (such as PostBeginPlay), and using proper UC syntax...
Automatically merged
-
- Godlike
- Posts: 2911
- Joined: Fri Sep 25, 2015 9:01 pm
- Location: moved without proper hashing
Re: Error: C:\UT coding\UnrealTournament\Nexgen112SDL\Classes\NexgenHUD.uc(786) : Error, Unexpected 'if'
As mentioned above Level.Game is always NONE in a HUD class. Better use such as
Code: Select all
if (PlayerPawn(Owner) != None)
if (PlayerPawn(Owner).GameReplicationInfo != None)
if (PlayerPawn(Owner).GameReplicationInfo.IsA('HolyWarsGame'))
You mixed up a GOTO with a function call. Use GOTO within a code block. Call another function just by its name.Letylove49 wrote: ↑Sun Oct 09, 2022 9:38 pm Error: C:\UT coding\UnrealTournament\Nexgen112SDL\Classes\NexgenHUD.uc(786) : Error, Unexpected 'if'
Code: Select all
if(...) goto Function setup1; else goto function setup;
Example for GOTO (The GoTo statement should generally be avoided. (Why?)):
Code: Select all
function JonDoe()
{
if (WhatEver) goto Label1;
// do some other stuff here
Label1:
// this is executed in every case
} // function JonDoe() ends here
Code: Select all
if (...) setup1();
else setup();
"If Origin not in center it be not in center." --Buggie
-
- Adept
- Posts: 278
- Joined: Tue Feb 28, 2012 7:47 pm
- Location: suisse
Re: HolywarsNexgenHudFix
this not work. i got the same error with this:
Code: Select all
if (PlayerPawn(Owner) != None)
if (PlayerPawn(Owner).GameReplicationInfo != None)
if (PlayerPawn(Owner).GameReplicationInfo.IsA('HolyWarsGame')) setup1();
else setup();
}