![]() |
|
|
#1 |
[UT2004] Variable Replication
Hi,
I'm having a little problem where i'm setting the default value of a global variable from another class. when i run this on a dedicated server the value logs 0.00 (locally it works fine) I've tested various ROLE and RemoteRole's and i can't quite figure out why it's not working. Code:
class DynamicShockProjectile extends ShockProjectile;
var float GlobalAngle;
replication
{
reliable if (ROLE == ROLE_Authority)
GlobalAngle;
}
simulated function getAngle()
{
......
class'DShockComboVortex'.default.GlobalAngleTemp=GlobalAngle;
}
Code:
class DShockComboVortex extends ShockComboVortex;
var float GlobalAngleTemp;
replication
{
reliable if (ROLE == ROLE_Authority)
GlobalAngleTemp;
}
event PostBeginPlay()
{
Super.PostBeginPlay();
ScaleInterp.Mid=1.6*default.GlobalAngleTemp;
log("default.GlobalAngleTemp "$default.GlobalAngleTemp);
}
defaultproperties
{
ScaleInterp=(Start=0.400000,Mid=1.60000,End=0.200000,InTime=0.400000,OutTime=0.400000,InStyle=IS_InvExp,OutStyle=IS_InvExp)
RemoteRole=ROLE_SimulatedProxy
bAlwaysRelevant=true
ROLE==ROLE_Authority
}
thanks eLy
__________________
My UT Tribute (12min/160MB): http://eLy.ch.vu (disable popup blockers) Last edited by eLy; 23rd May 2004 at 12:41 PM. |
|
|
|
|
|
|
#2 |
|
Registered User
Join Date: May. 14th, 2004
Posts: 36
|
I believe PostBeginPlay occurs before variable replication. There is another function to use though it has the word Net somewhere in there, hold on I'll look it up for ya.
Ok goody found it, PostNetBeginPlay ( ). Now keep in mind this isn't guaranteed to have received the packet of info before it is called. However, PostBeginPlay has 0 % chance of that happening simply because its called before the info is processed. Instead its probably best to just set a small timer and do what you need to do there. Last edited by Zengi; 23rd May 2004 at 10:57 AM. |
|
|
|
|
|
#3 |
|
hey Zengi, thanks for the reply.
I have tried using PostNetBeginPlay() before ... no luck. but i'm gonna check out the Timer as you said, I haven't used that function before.
__________________
My UT Tribute (12min/160MB): http://eLy.ch.vu (disable popup blockers) |
|
|
|
|
|
|
#4 |
|
Registered User
Join Date: May. 8th, 2004
Posts: 5
|
for the Server, i think PostBeginPlay() should be okay
but for the Client, try setting the value in PostNetReceive(), and bNetNotify=true Last edited by DarkWithin; 23rd May 2004 at 12:38 PM. |
|
|
|
|
|
#5 |
|
Default values of variables are not replicated.
__________________
http://come.to/MrEvil |
|
|
|
|
|
|
#6 |
|
oh, this is so great.
there's no way to do this ? argh, after 4 days of trying to find a new way to do this: http://forums.beyondunreal.com/showthread.php?t=135332 I was so happy that somebody had a solution for me yesterday... just to find out that it's impossibile...again ? are there any other ways to simply read GlobalAngle (in DynamicShockProjectile) from within DShockComboVortex ? that's all i want.. (...that work on a dedicated server...) well thanks anyway guys.
__________________
My UT Tribute (12min/160MB): http://eLy.ch.vu (disable popup blockers) Last edited by eLy; 23rd May 2004 at 01:16 PM. |
|
|
|
|
|
|
#7 |
|
Registered User
Join Date: Apr. 11th, 2004
Posts: 184
|
Code:
class'DShockComboVortex'.default.GlobalAngleTemp Code:
var DShockComboVortex D; D = spawn(class'DShockComboVortex'); D.GlobalAngleTemp |
|
|
|
|
|
#8 |
|
thanks dataangel, i actually have tried that too =)
But it returned 0.00 I'm assuming that is because D.GlobalAngleTemp gets accessed after DShockComboVortex has already fully executed. Or is there a way to have DShockComboVortex "wait" for me to set D.GlobalAngleTemp before it starts executing? that would probably be a good solution.
__________________
My UT Tribute (12min/160MB): http://eLy.ch.vu (disable popup blockers) |
|
|
|
|
![]() |
| Thread Tools | |
| Display Modes | |
|
|