Coding Question

Feel free to chat about non-Chaos stuff in here.
Post Reply
T-Bone7
Posts: 49
Joined: Tue Jul 15, 2003 4:49 am
Location: Louisiana, USA

Coding Question

Post 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.
Wombats fall from the sky and reality disappears...
T-Bone7
Posts: 49
Joined: Tue Jul 15, 2003 4:49 am
Location: Louisiana, USA

Post by T-Bone7 »

I find it hard to believe jb doesn't know anything about this. :)
Wombats fall from the sky and reality disappears...
MassChAoS
Posts: 1301
Joined: Thu May 02, 2002 3:26 am
Location: Florida
Contact:

Post by MassChAoS »

He probably hasn't seen the thread.
jb
Posts: 9825
Joined: Fri May 03, 2002 12:29 am
Location: Coral Springs, FL
Contact:

Post 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.
Jb
T-Bone7
Posts: 49
Joined: Tue Jul 15, 2003 4:49 am
Location: Louisiana, USA

Post 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]
Wombats fall from the sky and reality disappears...
jb
Posts: 9825
Joined: Fri May 03, 2002 12:29 am
Location: Coral Springs, FL
Contact:

Post 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...
Jb
T-Bone7
Posts: 49
Joined: Tue Jul 15, 2003 4:49 am
Location: Louisiana, USA

Post by T-Bone7 »

Oh, nevermind me then, I guess I'm just a young whippersnapper.

Thanks for your help!
Wombats fall from the sky and reality disappears...
Post Reply