UE2 - UT2kX Mutators to Server Actors

  • Two Factor Authentication is now available on BeyondUnreal Forums. To configure it, visit your Profile and look for the "Two Step Verification" option on the left side. We can send codes via email (may be slower) or you can set up any TOTP Authenticator app on your phone (Authy, Google Authenticator, etc) to deliver codes. It is highly recommended that you configure this to keep your account safe.

Nathan873

New Member
Apr 27, 2011
2
0
0
Hi, i really need help in converting two mutators to server actors for UT2004. One of them is a weapon mutator and another one is a serverdetails mutator. Any help is appreciated. Thanks so much.
 

gopostal

Active Member
Jan 19, 2006
848
47
28
I explained to you (in detail) why you can't. Others will only tell you this same thing. It's a limitation of the engine. Your friend's "hack" for this didn't change the fundamental engine requirement, he simply hid the flag for it in the server listing. You absolutely cannot do that now as it was patched.
 

Nathan873

New Member
Apr 27, 2011
2
0
0
The guy who coded this mutators for me had a look at the code again said its possible to turn them into serveractors. Only problem is that hes busy with school work and He quit uscript.
 

Wormbo

Administrator
Staff member
Jun 4, 2001
5,913
36
48
Germany
www.koehler-homepage.de
Generally any mutator can be modified to work as ServerActor. The key is to ensure the mutator registers itself on startup and also makes sure it is not already added to the mutators list.

The easiest way to achieve that is overriding (Pre/Post)BeginPlay() for registering and AddMutator() to ensure it only ever exists once:
Code:
function BeginPlay()
{
  Level.Game.BaseMutator.AddMutator(Self);
}

function AddMutator(Mutator M)
{
  if (M != Self) {
    if (M.Class != Class)
      Super.AddMutator(M);
    else
      M.LifeSpan = 0.001; // destroy additional instance, but only after GameInfo.AddMutator!
  }
  // else trying to re-register self, just ignore to prevent loop in the mutators list
}