PDA

View Full Version : accessing data



legacy-Slayerizer
07-03-2003, 07:33 PM
Hi
I managed to begin my new game type mod. I have created 2 files, one for the gametype and one for a custom HUD. I have a STRING variable globally declared in my gametype class. I would like to draw the content of this string from within my Hud class but I don,t know how to access the variable. I tried to do something like this but it's not working:


drawtext( XDBM.MyString, false );

any suggestions? I've searched in the game's .uc files but didnt find anything yet.

thanks for any info

legacy-Magus[WTF]
07-04-2003, 12:34 AM
XDBM(Level.Game).MyString

legacy-wacko412
07-04-2003, 12:40 AM
could you just not do.


c.drawtext( "text", false ); ???

that will display your text. or are you trying to have it display dynamic data?

legacy-Slayerizer
07-04-2003, 01:13 AM
I'm trying to display dynamic data!! I will try the method suggested above by Magus..

Meanwhile I've found a dirty way to access it


foreach AllActors( class'xBDM',tempxbdm)

it works but it's not very clean!

:rolleyes:

legacy-wacko412
07-04-2003, 02:06 AM
after doing some research. magus's way does work. it pulls what ever the mystring is.

legacy-Mychaeel
07-04-2003, 03:02 AM
it works but it's not very clean!It won't work as soon as you go online; your GameInfo actor isn't present on client-side. Put that data in a custom GameReplicationInfo subclass instead, replicate it and access it via the GRI variable in your HUD (and don't forget about typecasting (http://wiki.beyondunreal.com/wiki/Typecasting)).