Announcement

Collapse
No announcement yet.

Why won't my variable replicate?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Why won't my variable replicate?

    OK here is the variable declaration and replication block (in a subclass of Weapon)
    Code:
    var Projectile HRLP;
    
    replication
    {
        reliable if (Role == ROLE_Authority)
            HRLP;
    }
    Here is where the variable is set in my primary firemode (subclassed off of projectile fire)
    Code:
    MyWeapon(Weapon).HRLP = P;  //p is a local declared projectile
    And here is where the alt fire mode calls it
    Code:
    event ModeDoFire()
    {
        log("Gun\: You found it Russell");
        log("Gun\: Projectile "$MyWeapon(Weapon).HRLP);
        if (GWHRL(Weapon).HRLP != None)
        {
            log("Gun\: Projectile\="$MyWeapon(Weapon).HRLP);
        }
    }
    On the server I see:
    ScriptLog: Gun: You found it Russell
    ScriptLog: Gun: Projectile ctf-1on1-joust.MyProjectile
    ScriptLog: Gun: Projectile ctf-1on1-joust.MyProjectile

    On the client I See:
    ScriptLog: Gun: You found it Russell
    ScriptLog: Gun: Projectile None


    The variable replication I'm using works perfectly for the XLoc, so why does it not work here, I can find zero reason that variable not to replicate, it's set on the server, logs prove it, however it refuses to replicate to the client, when the **** replicaiotn block says this variable changes, tell the client, exacty like it does with the xloc where it works

    #2
    Can you replicate a projectile class?

    I'm not sure that you can. could be wrong.

    try using a bool or vector instead, to see if they replicate.
    If they do, then need to find a different method.

    Comment


      #3
      Projectiles are funny in one particular way - most have the following set:

      bNetTemporary=true

      What this does is when a Projectile is spawned it is created on the server and client and then the connection between the two is completely severed. NO FURTHER REPLICATION OCCURS. The client version will run in a simulated fashion from then on. This is very useful to minimize network overhead for classes that can operate independently on the server and client.

      You need to set bNetTemporary to false and try that. With that set normal replication rules will be followed.

      Comment


        #4
        Thank you LordBozo, that was exaclyt it

        Comment

        Working...
        X