class a_MapOptimizer extends a_ActorBase config(HideMut); struct MyZone { var int ZoneKey; //zone key var string ZoneName; //Zone name var array VectorsCoord; //Coordinates of zone borders. Drawing from 0 to 1, 1 to 2 and etc. var float MinX, MinY, MaxX, MaxY; //Minimal coords for setting zoned actors var array PortalActorsRefs; //Actors that are visible through "portal" aka hole between neighbouring zones. Neighbouring zones may have same set of this var array DecorativeActorsRefs; //Decorative stuff between zones var bool IgnoreXAxis; //Ignore this axis when setting active zone var bool IgnoreYAxis; var bool IgnoreZAxis; var bool HideDecorativeActors; var bool HidePortalActors; }; var config array MyZones; struct MyZonedMap { //Struct for map zoning var string MapName; var array MyZoneRef; //reference to my zone structure }; var config array ZonedMaps; struct ZonedStaticMeshes { var int ZoneRef; var array SMA; }; var array ZonedSMA; var PlayerController PC; var int ActiveZonedMap; var int ActiveZone, PrevActiveZone; var int i, k; simulated function StartMapOptimizer() { local StaticMeshActor SMA; PC = Level.GetLocalPlayerController(); if(ZonedMaps.length == 0 || MyZones.length == 0 || PC == none || PC.Pawn == none) return; ActiveZonedMap = -1; for(i=0; i= MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MinX && SMA.Location.Y >= MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MinY)) { ZonedSMA[ZonedSMA.length-1].SMA.length = ZonedSMA[ZonedSMA.length-1].SMA.length + 1; ZonedSMA[ZonedSMA.length-1].SMA[ZonedSMA[ZonedSMA.length-1].SMA.length-1] = SMA; SMA.bHidden = true; SMA.ResetStaticFilterState(); } } } Enable('Tick'); } simulated function StopMapOptimizer() { Disable('Tick'); for(i=0; i MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MinX && PC.Pawn.Location.Y > MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MinY) { if(PC.Pawn.Location.X < MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MaxX && PC.Pawn.Location.Y < MyZones[ZonedMaps[ActiveZonedMap].MyZoneRef[i]].MaxY) { ActiveZone = ZonedMaps[ActiveZonedMap].MyZoneRef[i]; break; } } } if(ActiveZone == -1 || ZonedSMA.length == 0) //No active zones - seems like we are out of rectangle borders return; for(i=0; i