UE1 - UT Dynamic Tally Scripted Texture

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
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 );

}
 

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
And it is definitely set correctly in the actor in the level, but it seems in scripted textures such as the scrolling tally it has a more dynamic function including variables like LastDrawTime. RenderTexture may be automatically called, but does it automatically call it again if the data has changed?

I'm pretty sure it doesn't have anything to do with text's offset to the texture, I've tested that theory.
 
Last edited:

Rajada

Member
Jan 21, 2008
213
0
16
rajada.tumblr.com
It should be called every frame when the texture is visible.

That's good to know, the problem must be elsewhere... but it seems like there shouldn't be any problems with the code itself.

EDIT: Does the surface have to have any special flags applied? I only have made it unlit so far...
 
Last edited: