PDA

View Full Version : Copying Var's and Rep Info


BrownCow
8th Sep 2001, 07:32 PM
Ok, since this is the only real problem i've been having with uscript, i'll ask it.


I make a mutator, the mutator has 1 config var. It is a boolean lets say.

I subclass a player class. In ModifyPlayer i write this line of code:

Pawn(Other).myBool = myBool;

Obviously i didn't subclass that class, but this is what i'm doing w/o getting into details.

Now, if i log the Pawn's myBool var, it will be correct. WHen it comes time, in game to actually use it, it is blank. Like the bool is None, not false, not true, None.

First question, why the hell can you not do that? It is never going to be changed, i don't understand why i'd have to use Replication to do something as simple as this.

Unless i don't. If i don't, please tell me how to do something as simple as copying a boolean from mutator to class w/o using replication.

And lets say i did replication, i would do this in my player class:

replication
{
reliable if( ROLE == ROLE_AUTHORITY )
myBool;
}

is that correct? That would say, server send this bool to the client.


i've read all the stupid tuts and faq's, for the most part, they are next to useless for the stuff that really matters. If anyone could help, that would be great.

thanks
-cow