Re: SwarmSpawn v2.0 - UT99 Preview Release II
Posted: Sat Jun 04, 2016 9:32 pm
I was just interested and had a look at "SwarmSpawn_v2.0-UT99-Preview2"'s code. There I stumbled over
Because an InventorySpot is created for every inventory item and that InventorySpot is already part of "Level.NavigationPointList" you could put this together to
A difference of InventoryItem/InventorySpot is the Z component because InventorySpot is placed above the item.
And another suggestion: for setting properties as text I use an extended version:So I can see in the log files if something went bad.
Just my 2 ct.
Code: Select all
var Vector SpawnLocs[4096];
...
function PostBeginPlay() {
...
for (N = Level.NavigationPointList; N != NONE; N = N.NextNavigationPoint)
if ((N.IsA('PathNode') || N.IsA('SpawnPoint') || N.IsA('PlayerStart')) && (!N.Region.Zone.bWaterZone || !N.Region.Zone.bPainZone))
(... filling your SpawnLocs array here ...)
forEach AllActors(class'Inventory', Inv)
if ((!Inv.Region.Zone.bWaterZone) && (!Inv.Region.Zone.bPainZone))
(... additionally filling your SpawnLocs array here ...)
Code: Select all
for (N = Level.NavigationPointList; N != NONE; N = N.NextNavigationPoint)
if ((N.IsA('PathNode') || N.IsA('SpawnPoint') || N.IsA('PlayerStart') || N.IsA('InventorySpot')) && (!N.Region.Zone.bWaterZone || !N.Region.Zone.bPainZone))
(... filling your SpawnLocs array here ...)
And another suggestion: for setting properties as text I use an extended version:
SetPropertyTextEx
Code: Select all
static function bool SetPropertyTextEx(Object obj, coerce string PropName, coerce string PropValue) {
/*******************************************************************************
Does the same as *SetPropertyText* but logs a warning if function failed.
*******************************************************************************/
Obj.SetPropertyText(PropName, PropValue);
if (Obj.GetPropertyText(PropName) != PropValue)
{
warn(obj $ ".SetPropertyText(" $ PropName $ "=" $ PropValue $ ") faild for" @ obj $", current property value=\"" $ Obj.GetPropertyText(PropName) $ "\"");
return false;
}
else
return true;
}
Just my 2 ct.