add short alias for mutator

This commit is contained in:
GenZmeY 2023-12-31 23:47:42 +03:00
parent 4d60429c7b
commit bf19cfa7b7
Signed by: GenZmeY
GPG Key ID: 424DA4BC3CB2CF39
3 changed files with 63 additions and 62 deletions

View File

@ -15,7 +15,7 @@ https://forums.tripwireinteractive.com/index.php?threads/whitelisting-mods-and-m
[*]Subscribe to this mutator;
[*]Start KF2;
[*]Open console (`) and input:
[b]open KF-BioticsLab?Mutator=YAS.YASMut?[/b]
[b]open KF-BioticsLab?Mutator=YAS.Mut?[/b]
(replace the map and add the parameters you need)
[*]<Enter>.
[/olist]
@ -30,7 +30,7 @@ https://forums.tripwireinteractive.com/index.php?threads/whitelisting-mods-and-m
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
[b]ServerSubscribedWorkshopItems=2521826524[/b]
[*]Start the server and wait until the mutator is downloading;
[*]Add mutator to server start parameters: [b]?Mutator=YAS.YASMut[/b] and restart the server.
[*]Add mutator to server start parameters: [b]?Mutator=YAS.Mut[/b] and restart the server.
[/olist]
[h1]Important setup information[/h1]

60
YAS/Classes/Mut.uc Normal file
View File

@ -0,0 +1,60 @@
class Mut extends KFMutator;
var private YAS YAS;
public simulated function bool SafeDestroy()
{
return (bPendingDelete || bDeleteMe || Destroy());
}
public event PreBeginPlay()
{
Super.PreBeginPlay();
if (WorldInfo.NetMode == NM_Client) return;
foreach WorldInfo.DynamicActors(class'YAS', YAS)
{
break;
}
if (YAS == None)
{
YAS = WorldInfo.Spawn(class'YAS');
}
if (YAS == None)
{
`Log_Base("FATAL: Can't Spawn 'YAS'");
SafeDestroy();
}
}
public function AddMutator(Mutator M)
{
if (M == Self) return;
if (M.Class == Class)
Mut(M).SafeDestroy();
else
Super.AddMutator(M);
}
public function NotifyLogin(Controller C)
{
YAS.NotifyLogin(C);
Super.NotifyLogin(C);
}
public function NotifyLogout(Controller C)
{
YAS.NotifyLogout(C);
Super.NotifyLogout(C);
}
DefaultProperties
{
GroupNames.Add("Scoreboard")
}

View File

@ -1,60 +1 @@
class YASMut extends KFMutator;
var private YAS YAS;
public simulated function bool SafeDestroy()
{
return (bPendingDelete || bDeleteMe || Destroy());
}
public event PreBeginPlay()
{
Super.PreBeginPlay();
if (WorldInfo.NetMode == NM_Client) return;
foreach WorldInfo.DynamicActors(class'YAS', YAS)
{
break;
}
if (YAS == None)
{
YAS = WorldInfo.Spawn(class'YAS');
}
if (YAS == None)
{
`Log_Base("FATAL: Can't Spawn 'YAS'");
SafeDestroy();
}
}
public function AddMutator(Mutator Mut)
{
if (Mut == Self) return;
if (Mut.Class == Class)
YASMut(Mut).SafeDestroy();
else
Super.AddMutator(Mut);
}
public function NotifyLogin(Controller C)
{
YAS.NotifyLogin(C);
Super.NotifyLogin(C);
}
public function NotifyLogout(Controller C)
{
YAS.NotifyLogout(C);
Super.NotifyLogout(C);
}
DefaultProperties
{
GroupNames.Add("Scoreboard")
}
class YASMut extends Mut; // backward compatibility