Need help!

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

Brood_of_Evil

Selene's martyr
Nov 3, 2001
147
0
0
45
Look outside your window!
Visit site
ok sorry for the multiple posts, I tried posting earlier, but there seemed to be some problems with the forums, as they were extremely low, I tried to delete the other one, but anyways...

Ok. the problem is this, when I call a switch statement using PlayerReplicationInfo.Team as the switch, while in a team game, it always return the red team...look at the code below:

//some other code........

local int OwnerTeam;

OwnerTeam = Pawn(Owner).PlayerReplicationInfo.Team;

if(Level.Game.bTeamGame)
{
switch(OwnerTeam)
{
case 0:

BroadcastMessage("RedTeam");
tw.SetDisplayProperties(STY_Translucent, Texture'UPML.LDot', true, false);
break;

case 1:

BroadcastMessage("BlueTeam");
tw.SetDisplayProperties(STY_Translucent, Texture'UPML.BlueLDot', true, false);
break;

case 2:

BroadcastMessage("GreenTeam");
tw.SetDisplayProperties(STY_Translucent, Texture'UPML.GreenLDot', true, false);
break;

case 3:

BroadcastMessage("GoldTeam");
tw.SetDisplayProperties(STY_Translucent, Texture'UPML.GoldLDot', true, false);
break;
}
}

as you can see, I have put a BroadcastMessage() to follow up the evaluation of the code. but no matter what happens, it always land on 0 (Red team).

As far as I know the team is an array, with 0=Red, 1=blue, 2=green, 4=gold. Is that correct?

Does anyone knows what's wrong with this?
Is there another way to get the team number of pawn other than this?

Oh and another question, what's the differences a simulated function from a normal one?
 

Silver_Ibex

Member
Feb 27, 2001
654
0
16
A simulated function is only calculated on a client machine, things like the HUD
simulated function PostRender( canvas Canvas )

Since the host shouldn’t be bogged down with drawing everyone’s HUD, as that would needlessly hog bandwidth and the draw HUD function has no impact on the other players.
 

usaar33

Un1337
Mar 25, 2000
808
0
0
Unknown
www.UsAaR33.com
is owner none?

BTW, Silver simulated actually means it CAN be run on the client. If the role of an actor is role_simulatedproxy, and a function that is being called is NOT simulated, the function will not be called.
 

tarquin

design is flawed
Oct 11, 2000
3,945
0
36
UK
www.planetunreal.com
Originally posted by Brood_of_Evil
OwnerTeam = Pawn(Owner).PlayerReplicationInfo.Team;

I'd stick a few lines of log after that line ^^ to check what the code thinks it is dealign with:
log( Owner )
log( Pawn(Owner ))
etc etc
 

Papapishu

我是康
Jun 18, 2001
2,043
0
0
42
void
www.vovoid.com
I thought it was the other way around, that the simulated functions were the ones that were run on the server...
waddya know...?

Is it like, when the client wants to call a non-simulated sunction, it calls the server asking it, and then the server returns the answer?
Or how does it work anyway?
I never did understand the tut's about this subject... :hmm:
 

Brood_of_Evil

Selene's martyr
Nov 3, 2001
147
0
0
45
Look outside your window!
Visit site
This is from sweeney's UScript language reference:
"Simulated: Declares that a function may execute on the client-side when an actor is either a simulated proxy or an autonomous proxy. All functions that are both native and final are automatically simulated as well."