Merge pull request #1 from GenZmeY/short-name
add short alias for mutator
This commit is contained in:
commit
d8e0d68a18
@ -27,7 +27,7 @@ No. This mod is not whitelisted and will de-rank your server. Any XP gained will
|
|||||||
[*]Subscribe to this mutator;
|
[*]Subscribe to this mutator;
|
||||||
[*]Start KF2;
|
[*]Start KF2;
|
||||||
[*]Open console (~) and input:
|
[*]Open console (~) and input:
|
||||||
[b]open KF-BioticsLab?Mutator=TRB.TRBMut[/b]
|
[b]open KF-BioticsLab?Mutator=TRB.Mut[/b]
|
||||||
(replace the map and add the parameters you need)
|
(replace the map and add the parameters you need)
|
||||||
[*]<Enter>.
|
[*]<Enter>.
|
||||||
[/olist]
|
[/olist]
|
||||||
@ -42,7 +42,7 @@ No. This mod is not whitelisted and will de-rank your server. Any XP gained will
|
|||||||
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
|
[*]Add the following string to the [b][OnlineSubsystemSteamworks.KFWorkshopSteamworks][/b] section (create one if it doesn't exist):
|
||||||
[b]ServerSubscribedWorkshopItems=3047331564[/b]
|
[b]ServerSubscribedWorkshopItems=3047331564[/b]
|
||||||
[*]Start the server and wait while the mutator is downloading;
|
[*]Start the server and wait while the mutator is downloading;
|
||||||
[*]Add mutator to server start parameters: [b]?Mutator=TRB.TRBMut[/b] and restart the server.
|
[*]Add mutator to server start parameters: [b]?Mutator=TRB.Mut[/b] and restart the server.
|
||||||
[/olist]
|
[/olist]
|
||||||
|
|
||||||
[h1]Important setup information[/h1]
|
[h1]Important setup information[/h1]
|
||||||
|
47
TRB/Classes/Mut.uc
Normal file
47
TRB/Classes/Mut.uc
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
class Mut extends KFMutator
|
||||||
|
dependson(TRB);
|
||||||
|
|
||||||
|
var private TRB TRB;
|
||||||
|
|
||||||
|
public simulated function bool SafeDestroy()
|
||||||
|
{
|
||||||
|
return (bPendingDelete || bDeleteMe || Destroy());
|
||||||
|
}
|
||||||
|
|
||||||
|
public event PreBeginPlay()
|
||||||
|
{
|
||||||
|
Super.PreBeginPlay();
|
||||||
|
|
||||||
|
if (WorldInfo.NetMode == NM_Client) return;
|
||||||
|
|
||||||
|
foreach WorldInfo.DynamicActors(class'TRB', TRB)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TRB == None)
|
||||||
|
{
|
||||||
|
TRB = WorldInfo.Spawn(class'TRB');
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TRB == None)
|
||||||
|
{
|
||||||
|
`Log_Base("FATAL: Can't Spawn 'TRB'");
|
||||||
|
SafeDestroy();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function AddMutator(Mutator M)
|
||||||
|
{
|
||||||
|
if (M == Self) return;
|
||||||
|
|
||||||
|
if (M.Class == Class)
|
||||||
|
Mut(M).SafeDestroy();
|
||||||
|
else
|
||||||
|
Super.AddMutator(M);
|
||||||
|
}
|
||||||
|
|
||||||
|
defaultproperties
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
@ -1,47 +1 @@
|
|||||||
class TRBMut extends KFMutator
|
class TRBMut extends Mut; // backward compatibility
|
||||||
dependson(TRB);
|
|
||||||
|
|
||||||
var private TRB TRB;
|
|
||||||
|
|
||||||
public simulated function bool SafeDestroy()
|
|
||||||
{
|
|
||||||
return (bPendingDelete || bDeleteMe || Destroy());
|
|
||||||
}
|
|
||||||
|
|
||||||
public event PreBeginPlay()
|
|
||||||
{
|
|
||||||
Super.PreBeginPlay();
|
|
||||||
|
|
||||||
if (WorldInfo.NetMode == NM_Client) return;
|
|
||||||
|
|
||||||
foreach WorldInfo.DynamicActors(class'TRB', TRB)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TRB == None)
|
|
||||||
{
|
|
||||||
TRB = WorldInfo.Spawn(class'TRB');
|
|
||||||
}
|
|
||||||
|
|
||||||
if (TRB == None)
|
|
||||||
{
|
|
||||||
`Log_Base("FATAL: Can't Spawn 'TRB'");
|
|
||||||
SafeDestroy();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public function AddMutator(Mutator Mut)
|
|
||||||
{
|
|
||||||
if (Mut == Self) return;
|
|
||||||
|
|
||||||
if (Mut.Class == Class)
|
|
||||||
TRBMut(Mut).SafeDestroy();
|
|
||||||
else
|
|
||||||
Super.AddMutator(Mut);
|
|
||||||
}
|
|
||||||
|
|
||||||
defaultproperties
|
|
||||||
{
|
|
||||||
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user