I'm trying to create a new form of scripted texture that when triggered, increases a variable mathematically by one, then reports the number to a scripted texture. My first guess at this compiled, but displayed no numbers. My guess is the problem lies in the fact that I haven't told it WHEN to render (or re-render) the texture, but I can't seem to call that function successfully.
Code:
class ScoreKeeperTexture expands ClientScriptedTexture;
var() Font Font;
var() color FontColor;
var() float YPos[3];
var() float XPos[2];
var string score;
var int scorecount;
simulated function PostBeginPlay()
{
Super.PreBeginPlay();
SetTimer( 1.0, true );
scorecount = 0;
}
function Trigger( actor Other, pawn EventInstigator )
{
scorecount++;
SetTimer( 1.0, true );
}
simulated function Timer()
{
score = string(scorecount);
}
simulated event RenderTexture(ScriptedTexture Tex)
{
Tex.DrawColoredText( XPos[0], YPos[0], score, Font, FontColor );
}