Some examples from my MapPatcher:
Code: Select all
case "MH-Agony":
if (FindActorByName('PlayerStart1', A, 'PlayerStart')) // placed in the void
{
PlayerStart(A).bEnabled = false;
PatchCount++;
}
case "MH-Hydro16-fixed":
foreach AllActors(class'Actor', A, 'PlayerStart') // #=2*19
if (PlayerStart(A).TeamNumber != 0)
{
PlayerStart(A).bEnabled = false;
PatchCount++;
}
case "MH-UM-The3Crystals(b)]13[":
if (FindActorByName('PlayerStart5', A, 'PlayerStart'))
{
PlayerStart(A).bEnabled = false; // see log: "Couldn't spawn player at MH-UM-The3Crystals(b)]13[.PlayerStart5"
PatchCount++;
}
I'm not sure if you can change the location of a static Actor. I solved that "moving" by disabling existing PlayerStarts and spawning new ones at the location I like:
Code: Select all
function int PatchMap_MH_IslandInvasion() {
local Actor A;
local int PatchCount;
foreach AllActors(class 'Actor', A, 'PlayerStart')
switch(String(PlayerStart(A).Name))
{
case "PlayerStart0":
case "PlayerStart1":
case "PlayerStart3":
case "PlayerStart6":
case "PlayerStart7":
case "PlayerStart9":
case "PlayerStart8":
case "PlayerStart11":
PlayerStart(A).bEnabled = False;
PatchCount++;
}
if (SpawnActorToList(PlayerStartClassNotStatic, LogLevel, , , vect(1242, -2566, -2311)) != None)
PatchCount++;
...
"PlayerStartClassNotStatic" is the following:
Code: Select all
class PlayerStartSB extends PlayerStart;
defaultproperties {
bAutoBuilt=false
bStatic=false
bCollideWorld=true
bCollideWhenPlacing=true
// uncomment the following for visual debugging:
// bHidden=false
// Mesh=LodMesh'UnrealShare.Pottery0M'
// DrawType=DT_Mesh
}
Aldebaran wrote:How can I disable a playerstart?
Find the PlayerStart Actor and do
Aldebaran wrote:How can I set another tag for a playstart?
Find the PlayerStart Actor and do
For finding an Actor I use
Code: Select all
function bool FindActorByName(name ActorName, out Actor FoundActor, optional name ActorTag) {
local Actor A;
foreach AllActors(class'Actor', A, ActorTag)
if (A.Name == ActorName)
{
FoundActor = A;
logger(Log_Debug, "FindActorByName", ActorName @ "found");
return true;
}
logger(LOG_Error, "FindActorByName", ActorName @ "not found");
return false;
}