help display something from gamereplicationinfo

  • 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.

zupafly

New Member
Aug 13, 2004
147
0
0
Lo,

I want to display number of laps for race mod. The numlap variable is located in my gamereplicationinfo class as thats the way it should be (atleast that's what I think) but now im having trouble to get it into hud.

Can someone give me info on how to do it ? Just display a defaultpropertie variable in hud using gamereplicationinfo class

Thx
 

Dark[NSF]

Northwest Secessionalist Forces
You shouldn't have to worry about replication because gamereplicationinfo is ueber like that. The wiki explains this.


This will involve a small amount of typecasting.
Level.Game.GameReplicationInfo is the parent to your class I'd suppose.
so..

iHaveLapsInMyGametype(Level.Game.GameReplicationInfo).lapsX0rz
 
Last edited by a moderator:

Zisu

Rune Player
Dec 12, 2004
34
0
0
You shouldn't have to worry about replication because gamereplicationinfo is ueber like that. The wiki explains this.


This will involve a small amount of typecasting.
Level.Game.GameReplicationInfo is the parent to your class I'd suppose.
so..

iHaveLapsInMyGametype(Level.Game.GameReplicationInfo).lapsX0rz

Actually... If you want to use the lapsX0rz of your GameReplicationInfo subclass in the HUD, you cant do it like that. Client has no idea about "Level.Game" and you end up with accessed nones.

Code:
class myGameReplicationInfo expands someGameReplicationInfo;
var int lapsX0rz;
replication
{
  reliable if (Role == Role_Authority) lapsX0rz;
}

Code:
class blaHUD expands someHUD;
function someFunction()
{
  local myGameReplicationInfo myGRA;
  myGRA = myGameReplicationInfo(PlayerPawn(Owner).GameReplicationInfo);
  //do whatever you want with myGRA.lapsX0rz
}

I apologize for possible typos.

EDIT. You also need to define myGameReplicationInfo as default GameReplicationInfo to your game
 
Last edited:

zupafly

New Member
Aug 13, 2004
147
0
0
with last u mean this in gameplay class:

GameReplicationInfoClass=class'RcGameReplicationInfo'

I get error because of following line
local int numlap;
local RcGameReplicationInfo rcGRA;

rcGRA = RcGameReplicationInfo(PlayerPawn(Owner).GameReplicationInfo);
*error here* numlap = rcGRA.NumberOfLaps;
 

zupafly

New Member
Aug 13, 2004
147
0
0
didnt know arf, im noob at hud stuff & gamereplicationinfo stuff

so what should I use instead ?
 

Zisu

Rune Player
Dec 12, 2004
34
0
0
post the HUD code and RcGameReplicationInfo code here, either as a link to uc file or if they are small, inside "code" -tags in these forums.