Announcement

Collapse
No announcement yet.

New BR goal, rotation wrong on client

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

    New BR goal, rotation wrong on client

    I have a mutator that replaces the existing BR goals with my own (aswell as the bomb spawn but there's no problem with that). On instant action games it's fine but on network game, the rotation of the BR goal on the client is wrong. It seems as though the rotation is not set on the client when it is spawned even though the location is correct. The effect this has is the goal appears to be the wrong way round yet if you jump into it you will still go through it. This is because it is correct on the server. So how can I get it to replicate the goal's rotation correctly? Here's my code:

    Code:
    class FFABRMutator extends Mutator;
    
    function bool CheckReplacement( Actor Other, out byte bSuperRelevent )
    {
             local FFABombDelivery fbd;
    
             If(Other.IsA('xBombSpawn'))
             {
                    Spawn(class'FFABombSpawn',,,Other.Location, Other.Rotation);
                    return false;
             }
             If(Other.IsA('xBombDelivery'))
             {
                    Other.bHidden=true;
                    //Other.bCollideActors=false;
                    fbd = Spawn(class'FFABombDelivery',,,Other.Location, Other.Rotation);
                    return false;
             }
             If(Other.IsA('xBombDeliveryHole'))
             {
                    Other.Destroy();//no need to spawn a new one, FFABombDelivery will do that. Just get rid of it
                    return false;
             }
             return true;
    }
    Thanks

    #2
    Because you are spwaning an actor server side and there is no replication, clients will only see it being spawned and nothing else. Besides, you shouldn't need to spawn these actors yourself, the ReplaceWith() function takes care of this.

    Code:
    If(Other.IsA('xBombDelivery'))
             {
                    xBombDelivery(Other).bHidden=true;
                    xBombDelivery(Other).bCollideActors=false;
                    ReplaceWith(Other,"*****.FFABombDelivery")
                    return false;
             }

    ***** is to be the name of your class.

    Comment


      #3
      Thanks I'll give it a try. I didn't think replacewith would work because the original goal can't be deleted. I find it strange that it get's the location correct but I suppose it must be treated differently to the rotation in native code.

      Comment


        #4
        Yes, sorry, it won't work, I just navigated back throuh the sub classes and found bNoDelete=True, so sorry my friend, my code won't work.


        Try adding a replication block to your mutator:

        Code:
        class FFABRMutator extends Mutator;
        
        var FFABombDelivery fbd;
        
        replication
        {
            // server replicates this to the client
            reliable if(role == Role_AUTHORITY)
                        fbd;
        }
        
        function bool CheckReplacement( Actor Other, out byte bSuperRelevent )
        {
                 If(Other.IsA('xBombSpawn'))
                 {
                        Spawn(class'FFABombSpawn',,,Other.Location, Other.Rotation);
                        return false;
                 }
                 If(Other.IsA('xBombDelivery'))
                 {
                        Other.bHidden=true;
                        //Other.bCollideActors=false;
                        fbd = Spawn(class'FFABombDelivery',,,Other.Location, Other.Rotation);
                        return false;
                 }
                 If(Other.IsA('xBombDeliveryHole'))
                 {
                        Other.Destroy();//no need to spawn a new one, FFABombDelivery will do that. Just get rid of it
                        return false;
                 }
                 return true;
        }
        I am not up with replication, but this may help or just goto Wiki and search for replication, because you are going to need to replicate the spawn function to the clients, otherwise clients are not going to see what the server is doing with the actor.

        Comment


          #5
          You might also have to make the check replacemnt funciton simulated...

          Comment


            #6
            But I don't think a mutator itself even exists on the client so no functions will run on the client even if they are simulated. I'll keep trying anyway.

            Comment

            Working...
            X