I am a student at Full Sail so I don't want just the solution; I want to understand the problem. I am working from tutorial videos where we are supposed to have a HUD, a score, and a timer. When I first started, my player had a gun and a HUD. As I worked through the videos, the HUD changed, the score showed up but the HUD disappeared. Now the score disappeared as well as well as the HUD and I only have a gun. When I playtest it from Visual Studio, nothing shows up at all but when I load editor only the gun shows up.
This is the code setting up my game type
// Credit: Christopher Maxwell GameType W1 Video
class EricsMapGameType extends UTGame; //Sets game type as Unreal Tournament Game
var int myScore; // Sets myScore as a Variable Integer
defaultproperties // Sets the properties to default
{
HUDType =class 'EricsMapInterfaceHud' // Sets the interfacehud class to the Hudtype variable
PlayerControllerClass = class' EricsMapInterfacePlayerController' // Sets the player controllers class into the the player class Variable
DefaultPawnClass = class' EricsMapPawn' //Sets the maps custom pawn class to the default pawn variable
bUseClassicHUD = true // Turns off the Flash Hud and allows use of custom Hud
}
//This is the code for my score, timer, and HUD
class EricsMapInterfaceHUD extends HUD; // EricsMapInterface class extends from Hud
var bool showCursor;
var const Texture2D CursorTexture;
var const Color CursorColor;
var Font m_HUDFont;
var Texture2D m_textureEX;
//------------------------------------------------
function DrawHUD()
{
super.DrawHUD();
drawMyScore();
drawHUDText( "Hello!", 8);
ericTexture();
}
//------------------------------------------------
function ericTexture()
{
Canvas.SetPos(300,100);
Canvas.SetDrawColor(255,255,255);
Canvas.DrawTile(m_textureEX, 64, 64, 0, 16, 32, 16);
}
//------------------------------------------------
function drawHUDText(string _hudString, int _aNumber)
{
local float textSizeX;
local float textSizeY;
local string ericText;
ericText=_hudString @ _aNumber;
Canvas.Font = m_HUDFont;
Canvas.TextSize(ericText, textSizeX, textSizeY, 0.1, 0.1);
Canvas.SetPos((Canvas.SizeX/2) - (textSizeX/2),(Canvas.SizeY/2) - (textSizeY/2));
Canvas.SetDrawColor (255,0,0);
Canvas.DrawText(ericText,,0.1,0.1);
}
//------------------------------------------------
function DrawMyScore()
{
local WorldInfo rWorldInfo;
local EricsMapGameType rGame;
local int nScore;
rWorldInfo = class 'WorldInfo' .static.GetWorldInfo();
if(rGame != none)
{
rGame=EricsMapGameType(rWorldInfo.Game); // Turns the generic game into the custom game
if(rGame!=none) //If not custome game goes back to original map
{
nScore = rGame.myScore;
}
}
Canvas.SetPos(10,10);
Canvas.Font = class 'Engine' .static.GetMediumFont();
Canvas.SetDrawColor(255,0,0);
Canvas.DrawText("Score:" @nScore);
}
//------------------------------------------------
event PostRender()
{
// Canvas.SetPos(MouseInterfacePlayerInput.MousePosition.X,MouseInterfacePlayerInput.MousePosition.Y); //Gives me a bad or missing expression call to SetPos
Canvas.DrawColor = CursorColor; //Draws cursor color
Canvas.DrawTile(CursorTexture, CursorTexture.SizeX, CursorTexture.SizeY,0.f,0.f,CursorTexture.SizeX, CursorTexture.SizeY,, true);
}
defaultproperties
{
CursorColor=(255,0,0,);
CursorTexture=Texture2D'EngineResources.Cursors.Arrow';
showCursor=true;
m_HUDFont = Font'UI_Fonts.Fonts.UI_Fonts_Positec14';
m_textureEX = Texture2D'UDKHUD.skull'
}
Please don't just tell me the answer; help me understand the answer.