News UnrealEd Files Mods FragBU Liandri Archives
BeyondUnreal Forums

Go Back   BeyondUnreal Forums > Unreal Development > Coding

Reply
 
Thread Tools Display Modes
Old 22nd Sep 2009, 07:30 PM   #1
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 210
Dynamic Tally Scripted Texture

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 );

}
__________________
How to play NAB

Rajada is offline   Reply With Quote
Old 23rd Sep 2009, 02:07 AM   #2
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,785
The RenderTexture() function of an actor is automatically called by a ScriptedTexture if its Client property is set to the actor.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 23rd Sep 2009, 01:37 PM   #3
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 210
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.
__________________
How to play NAB


Last edited by Rajada; 24th Sep 2009 at 12:55 AM.
Rajada is offline   Reply With Quote
Old 24th Sep 2009, 12:54 AM   #4
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 210
No ideas? Anyone? :P
__________________
How to play NAB

Rajada is offline   Reply With Quote
Old 24th Sep 2009, 12:21 PM   #5
Wormbo
 
Wormbo's Avatar
 
Join Date: Jun. 4th, 2001
Location: Germany
Posts: 5,785
It should be called every frame when the texture is visible.
__________________
Wormbo's UT/UT2004/UT3 mods | YouTube channel | PlanetJailbreak/JDN | Unreal Wiki | Liandri Archives
Everything you ever wanted to know about replication| UnrealScript security considerations
<elmuerte> you shouldn't do all-nighters, it's a waste of time and effort
<TNSe> nono
<TNSe> its always funny to find code a week later you dont even remember writing
<Pfhoenix> what's worse is when you have a Star Wars moment
<Pfhoenix> "Luke! I am your code!" "No! Impossible! It can't be!"
Wormbo is offline   Reply With Quote
Old 24th Sep 2009, 02:11 PM   #6
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 210
Quote:
Originally Posted by Wormbo View Post
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...
__________________
How to play NAB


Last edited by Rajada; 24th Sep 2009 at 08:26 PM.
Rajada is offline   Reply With Quote
Old 26th Sep 2009, 03:43 PM   #7
Rajada
Registered User
 
Join Date: Jan. 21st, 2008
Posts: 210
Is my string conversion incorrect? It compiles but that's the only thing I was not 99% sure was okay.

Code:
score = string(scorecount);
__________________
How to play NAB

Rajada is offline   Reply With Quote
Reply

Tags
scripted, texture

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 09:04 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.

Copyright ©1998 - 2012, BeyondUnreal, Inc.
Privacy Policy | Terms of Use
Bandwidth provided by AtomicGamer