Page 1 of 1

Coding Question

Posted: Wed Mar 24, 2004 5:53 pm
by T-Bone7
How do you get a mutator to have the server call a function on a client? :?

I tried putting the function in replication: if (Role == Role_Authority) and simulating it, but it is never called on the client.

Posted: Thu Apr 22, 2004 6:40 pm
by T-Bone7
I find it hard to believe jb doesn't know anything about this. :)

Posted: Thu Apr 22, 2004 8:21 pm
by MassChAoS
He probably hasn't seen the thread.

Posted: Fri Apr 23, 2004 1:16 am
by jb
T-Bone, Sorry I did not see it till now.

Replication is a complicated thing. Once you break the replication "train" on the client you can not get it back with out the help of native code :(

So one thing you can do is set a flag for this fucntion, then in the simulated timer (which is running on the client) check this flag, once you see it, then do that function.

But can not really help until I see the code.

Posted: Thu Apr 29, 2004 10:24 pm
by T-Bone7
wha?
set a flag?
what's that?

What I'm trying to do is make a "tweaking" mutator. some variables I want to change aren't replicated in ut2003 so I need to have the client call a function that sets the variable to what it is on the server. I've tried everything I know to get it to call, and I'm certain it's not being called because I put a log command in the function. it never shows up in the log on the client, but usually shows up on the server.
Thanks for your help.

[edit] After looking at your code, I see you have the peculiar habit of calling boolean variables "flags". So you're trying to say: have a replicated bool, and whenever I want to call the function, set it to true, and put a check in the timer to call the function if it's set to true? hmm... [/edit]

Posted: Fri Apr 30, 2004 12:36 pm
by jb
Yes more or less thats what I mean....Also you will have to set these in your defaultproperties of the mut in order to get the mut to replicate to the clients:

bAlwaysRelevant=True
bOnlyDirtyReplication=False
RemoteRole=ROLE_SimulatedProxy


Also flag is or was used a lot in the old days in code to represent a bool or a bit in ASM. You would check that BIT/bool to make a choice. Some one called it a flag and it stuck in the industry...

Posted: Fri Apr 30, 2004 4:02 pm
by T-Bone7
Oh, nevermind me then, I guess I'm just a young whippersnapper.

Thanks for your help!