Could be asleep, typing random messages instead.

Multiple skyboxes?

For questions and discussion about UnrealEd, UnrealScript, and other aspects of Unreal Engine design.

Moderators: Semfry, ividyon

User avatar Tarydax
Skaarj Elder Skaarj Elder
Posts: 1052
Joined: 11 Apr 2009, 04:10

Subject: Multiple skyboxes?

Post Posted: 08 May 2013, 05:42

Is there a way to get multiple skyboxes that correspond to specific areas or zones? I used the skybox triggers from RtNP, and although they're fine for cutscenes, they don't work well at all for playable maps. The player has to activate a skybox trigger in order for a skybox to correspond to a zone, and it ends up being an issue.

In the current map we're working on, Doublez-Down found an annoying problem where, if the player loads the map after dying, they'll have to reactivate the skybox trigger if they want the skybox to correspond to the correct zone again.
Image

User avatar integration
Skaarj Berserker Skaarj Berserker
Posts: 445
Joined: 01 Sep 2010, 12:37

Subject: Re: Multiple skyboxes?

Post Posted: 08 May 2013, 07:23

Each ZoneInfo has a variable called SkyZone. That determins which SkyZoneInfo is shown in its face backdrop surfaces. Problem is, this variable is reset (to the last SkyZoneInfo it can find) in its PreBeginPlay function (which is called when you load a game). So, you have to do some custom scripting.

If your SkyZone links are static (that means they should stay as they are the whole game), you could add an actor which relinks all ZoneInfos to certain SkyZoneInfos at the begin of each game. Here's an example. For each ZoneInfo, it looks for a SkyZoneInfo which has the same tag, and links them accordingly (hm ... perhaps it is better to match ZoneInfo.event = SkyZoneInfo.tag; are tags and events of Zones relevant?)

Code: Select all

class MyInfo expands Info;

function PostBeginPlay()
{
   Super.PostBeginPlay();
   SetTimer(0.1, false);
}

function Timer()
{
   local skyzoneinfo S;
   local zoneinfo Z;

   foreach AllActors( class'ZoneInfo', Z, '' )
   {
      // log(Z.tag,'XXXXXXXXX');
      if ( SkyZoneInfo(Z) == none )
      {
         foreach AllActors( class 'SkyZoneInfo', S, Z.tag )
         {
            // log("link" @ Z @ "to" @ S,'XXXXXXXXX');
            Z.SkyZone = S;
         }
         foreach AllActors( class 'SkyZoneInfo', S, Z.tag )
            if ( S.bHighDetail == Level.bHighDetailMode )
               Z.SkyZone = S;
      }
   }
}


If your links are not static, you must write a subclass of SkyBoxTrigger. This would be more verbosely, because the Trigger must know, if it was activated and, if nother trigger has changed its link afterwards.

medor
Skaarj Lord Skaarj Lord
Posts: 171
Joined: 07 Jun 2009, 22:58

Subject: Re: Multiple skyboxes?

Post Posted: 08 May 2013, 08:14

[url=https://www.gametracker.com/server_info/77.135.96.69:7777/][img]https://cache.gametracker.com/server_info/77.135.96.69:7777/b_350_20_692108_381007_ffffff_000000.png[/img][/url]

[url=https://www.gametracker.com/server_info/77.135.96.69:5555/][img]https://cache.gametracker.com/server_info/77.135.96.69:5555/b_350_20_692108_381007_ffffff_000000.png[/img][/url]

[url=https://www.gametracker.com/server_info/77.135.96.69:6777/][img]https://cache.gametracker.com/server_info/77.135.96.69:6777/b_350_20_692108_381007_ffffff_000000.png[/img][/url]

[url=https://www.gametracker.com/server_info/77.135.96.69:6666/][img]https://cache.gametracker.com/server_info/77.135.96.69:6666/b_350_20_692108_381007_ffffff_000000.png[/img][/url]

User avatar integration
Skaarj Berserker Skaarj Berserker
Posts: 445
Joined: 01 Sep 2010, 12:37

Subject: Re: Multiple skyboxes?

Post Posted: 08 May 2013, 09:23

Oops, the relinking via that external actor doesn't work, if you load a saved game. Looks like, it is better to replace the ZoneInfos

Code: Select all

//=============================================================================
// MyZoneInfo.
//=============================================================================
class MyZoneInfo expands ZoneInfo;

// links ZoneInfo to a SkyZoneInfo with ZoneInfo.event = SkyZoneInfo.tag
simulated function LinkToSkybox()
{
   local skyzoneinfo TempSkyZone;

   // original code
   foreach AllActors( class 'SkyZoneInfo', TempSkyZone, '' )
      SkyZone = TempSkyZone;
   foreach AllActors( class 'SkyZoneInfo', TempSkyZone, '' )
      if ( TempSkyZone.bHighDetail == Level.bHighDetailMode )
         SkyZone = TempSkyZone;

   // new code
   if ( event == '' )
      return;
   foreach AllActors( class 'SkyZoneInfo', TempSkyZone, event )
      SkyZone = TempSkyZone;
   foreach AllActors( class 'SkyZoneInfo', TempSkyZone, event )
      if ( TempSkyZone.bHighDetail == Level.bHighDetailMode )
         SkyZone = TempSkyZone;
}

User avatar Tarydax
Skaarj Elder Skaarj Elder
Posts: 1052
Joined: 11 Apr 2009, 04:10

Subject: Re: Multiple skyboxes?

Post Posted: 08 May 2013, 18:51

That works really well, integration. Thanks!
Image


Who is online

Users browsing this forum: No registered users and 28 guests

Copyright © 2001-2024 UnrealSP.org

Powered by phpBB® Forum Software © phpBB Limited