Announcement

Collapse
No announcement yet.

GameReplication - Interaction question

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

    GameReplication - Interaction question

    I have a mutator with an interaction, there is a setting in the mutator ini file to turn it on/off. It works great in Instant Action, becuase the setting is in the local ini file...

    However, when it plays on a server, it still references the local variable, rather than getting one set by the servers configuration.

    I cannot change the Level.Game.GameReplicationInfoClass to my own becuase the game type (Invasion) already has a custom GameReplicationInfo.

    Two questions:

    1) is there a way to add another variable to an existing GameReplicationInfo?

    2) is there a better way to deal with this?


    *replicaion makes my head hurt!:sulk:

    #2
    Not real sure what your doing here.

    Do you have a configurable mutator?
    Because if you don't, then it is easy to setup and config your Interaction to be turned on/off via the mutator config menu, in fact you can even bind a key to turn it off on the run, even for admin. I have this in my PUT_Relics (not finished, too lazy)

    How are you setting up the interaction?
    Because it maybe easier to make it a non-useable inventory item, which can use key binding.

    If your interaction spawns things then it will need replication..

    Comment


      #3
      The interaction doesn't spawn anything, it renders to the canvas.

      The mutator is configurable...

      The user can go in and play an instant action game, if they turn the setting on, the main mutator will add the interaction to the list (or not if its turned off). This works great. (it happens in ModifyPlayer, and I have a check for )

      (I am not good at replication stuff, my real first challenge, in fact I am not even sure replication is the way to go)

      My problem is, that on a server the server needs to over-ride whatever the local setting is. If the server says don't use the interaction, then what ever is in the local ini file should have no say in it.

      Right now, what is happening, is in the main mutator code I also have a call to PostNetBeginPlay, but when I check my variable it still looks at the local value, not the server value...

      I know I am making this more difficult than it has to be!!! There must be an easy way to get this to work... Any suggestions, or sample code I can look at to see how it can be done would be great.

      Comment


        #4
        Sorry, it really was a dumb question (I think)!

        I fixed it by adding this to my mutator:

        replication
        {
        reliable if(Role == Role_Authority)
        bShowMonsterHealth;
        }

        If this is bad someone quickly slap me, if not, ummm yea for me! I think I am starting to understand replication, and my head doesn't hurt so bad anymore!

        Comment


          #5
          replication
          {
          reliable if(Role == Role_Authority)
          bShowMonsterHealth;
          }


          What your doing there is telling the server that when bShowMonsterHealth is modified and it is the Authority to replicate that value to clients.

          Replication isn't that hard if you know what is to be server controlled and client controlled.

          Comment


            #6
            could you post the other part of the code that sets the bMonsterHealth from the mutator to the interaction?

            Comment


              #7
              MMInvasionGameReplicationInfo(GameReplicationInfo) .bShowMonsterHealth = class'MutMonsterManager'.default.bShowMonsterHealt h;


              Its more than a mutator its also a game type, but this is the line that sets the value.

              Comment


                #8
                so in the mutator:

                var config bool bShowMonsterHealth;
                ....
                replication
                {
                reliable if(Role == Role_Authority)
                bShowMonsterHealth;
                }


                and in the interaction:
                MMInvasionGameReplicationInfo(GameReplicationInfo) .bShowMonsterHealth = class'MutMonsterManager'.default.bShowMonsterHealt h;

                is that correct?

                Comment


                  #9
                  Actually the replication statement is in my GameReplicationInfo for my game type.

                  The typecast of GRI is in the Game, and its setting the Mutators value...

                  Sorry I am sure fell off your chair becuase that is not clear at all.

                  I suggest you download MonsterManager_1_7 (or wait one day and download 1.8).

                  Decompile the code and look at it (search for bShowMonsterHealth) and it will be much more understandable.

                  Comment

                  Working...
                  X