replication issues

Discussions about Coding and Scripting
Post Reply
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

replication issues

Post by Rakiayn »

I am having some trouble with replication.
I am trying to set the Variable 'MMMutator' in the infoactor 'spawnermasterinfo' to A mutator that is in the map
But I dont get it done for the client side. if works offline though. anyone can help me?
I know there are some other topics about replication, and with links to tutorials. Ive read them.
also I tried alot but I cant get it to work. When I play as a client I get bot client messages ( see function Tick in the code)
but the MMMutator stays as 'none'

Code: Select all

//=============================================================================
// SpawnerMasterInfo.
//=============================================================================
class SpawnerMasterInfo expands PlayerreplicationInfo;

var MM_Mutator MMMutator;
//Rakiayn: the MM_mutator 


replication
{
reliable if ( Role == ROLE_Authority )

FindMutator,

}



simulated event Tick(float TimeDelta)
{

      if (mmmutator == none)
      {
      findmutator();
      BroadcastMessage("mmutator = none");
      }
      
      if (mmmutator != none)
      {
      BroadcastMessage("mmutator != none");
      }

}


simulated function FindMutator()
{
local MM_mutator M;


	for (M = level.game.BaseMutator; M != None; M = M.NextMutator)
        {
		//Rakiayn: Searching Through Mutatorlist
		if (M.IsA('MM_Mutator'))
		{
		Log(class$" Destroyed; MM_Mutator has been found");
		MMMutator = M;

		}
                if (M == none)
		{

                }
	}

}
User avatar
anth
Adept
Posts: 257
Joined: Thu May 13, 2010 2:23 am

Re: replication issues

Post by anth »

Neither the BaseMutator nor the NextMutator variables are replicated to the client. The client might be able to see your mutator but you won't be able to access it using the BaseMutator linked list. You could try Level.AllActors(class'Mutator', M) instead
User avatar
Rakiayn
Masterful
Posts: 550
Joined: Fri Aug 28, 2009 3:33 pm

Re: replication issues

Post by Rakiayn »

thanks. I tried it and the mutator variable is now set,
however the variables still couldnt be read properly by other actors. So I put the variables in an other actor.
Post Reply