Traveler: Solution for broken loadingscreens while travelling

Talk nerdy to us here.
Post Reply
Alex4GER
Reactions:
Posts: 4
Joined: May 11th, 2022, 3:02 pm

Traveler: Solution for broken loadingscreens while travelling

Post by Alex4GER » May 15th, 2022, 7:54 pm

Hello,

for a long time I wasn't sure whether this topic isn't placed better in the Traveler discussion, but I think the following content is almost interesting for developers.
Traveler is one of my most favourite NRaas-mods because it allows you to visit every installed town in the game with your sims without switching the savegame.
But as great as the mod is, one thing has bugged me very often a lot since I've been using it.

Whenever my Sims are travelling to any world, which couldn't be travelled without Traveler (e.g. Bridgeport) the loading screen while travelling looks like this:

Image

As you can see, the text obove the gametips, that contains "Travelling to ..." is shown without the name of the destination world (or is missing completely). The background image is the default and not that one, which is normally displayed while loading a new game or a savegame in Bridgeport. Also, the loading background music isn't played.
Of cause, the gameplay isn't affected by this issue, but it just doesn't look nice. I have searched in some boards, but I didn't find anything useful.

So, I tried to find a working solution to fix that problem with the loading screens myself by modifiing Traveler. First, I created a new class named "LoadingScreenControllerEx" with a list and two static methods, as you can see in the code the below. The "LoadTravellingLoadingScreen"-method is a modified version of the original in the "LoadingScreenController"-class, which can be found in UI.dll.

Code: Select all

using System.Collections.Generic;
using Sims3.SimIFace;
using Sims3.UI;

namespace NRaas.TravelerSpace.Helpers
{
public class LoadingScreenControllerEx
{
/* Contains the names of the worlds which do not need any special handling. */
public static readonly List<WorldName> sVacationWorldNames = new List<WorldName>
{
WorldName.China,
WorldName.Egypt,
WorldName.France,
WorldName.University,
WorldName.FutureWorld
};
/* Traveler will use this function to create a travel loadscreen instead of the EA-default. */
public static void LoadTravellingLoadingScreen(string travelWorldName, WorldName worldName, bool travellingHome, bool isFirstTimeTravelingToFuture)
{
if (!LoadingScreenController.IsLayoutLoaded())
{
LoadingScreenController.sTravelWorldName = travelWorldName;
LoadingScreenController.sbLoadingSaveGame = false;
LoadingScreenController.sWorldName = worldName;
LoadingScreenController.sbTravellingHome = travellingHome;
LoadingScreenController.ResetStatics();
LoadingScreenController.sFirstTimeTravelingToFuture = isFirstTimeTravelingToFuture;
if (worldName == WorldName.China || worldName == WorldName.Egypt || worldName == WorldName.France)
{
LoadingScreenController.sOverrideGameTipsFilename = "GameTipsEP1" + worldName.ToString();
}
else
{
if (worldName == WorldName.University && !travellingHome)
{
LoadingScreenController.sOverrideGameTipsFilename = "GameTipsEP9" + worldName.ToString();
}
else
{
if (worldName == WorldName.FutureWorld && !travellingHome)
{
LoadingScreenController.sOverrideGameTipsFilename = "GameTipsEP11" + worldName.ToString();
}
else
{
LoadingScreenController.sOverrideGameTipsFilename = string.Empty;
}
}
}
if (travellingHome || !sVacationWorldNames.Contains(worldName))
{ /* Play the standard loadloop audio when travelling home or to any world, which has not a specific loadloop. */
Responder.Instance.HudModel.PlayLoadLoopAudio(WorldName.Undefined);
}
else
{ /* Play specific loadloop when travelling to China, Egypt, France, University or FutureWorld. */
Responder.Instance.HudModel.PlayLoadLoopAudio(worldName);
}
if (!LoadingScreenController.CreateInteractiveLoadingScreenIfEnabled() && LoadingScreenController.sLayout == null)
{
ResourceKey resKey = ResourceKey.CreateUILayoutKey("TravelLoadingScreen", 0u);
LoadingScreenController.sLayout = UIManager.LoadLayoutAndAddToWindow(resKey, UICategory.Tooltips);
if (!travellingHome && !sVacationWorldNames.Contains(worldName))
{ /* Start function task to fix the broken loadscreen when travelling to any world which is not a EA-vacation world. */
Simulator.AddObject(new OneShotFunctionTask(new Function(LoadingScreenControllerEx.FixTravelLoadingScreen)));
}
}
}
}
public static void FixTravelLoadingScreen()
{
bool screenHandled = false;
while (!screenHandled)
{
if (LoadingScreenController.sInstance != null)
{
if (LoadingScreenController.sChosenLoadScreen == -1)
{
/* (Re-)create the TravellingTo-string above the gametips. */
Text text = LoadingScreenController.sInstance.GetChildByID(116085280u, true) as Text;
text.Caption = Responder.Instance.LocalizationModel.LocalizeString("Ui/Caption/TravelLoadingScreen:TravelingTo", new object
{
LoadingScreenController.sTravelWorldName
});

/* Replace the default screen image with the right one. */
string text2 = string.Empty;
ProductVersion version = ProductVersion.BaseGame;
if (LoadingScreenController.sTravelWorldName != WorldData.GetLocationName(WorldName.TwinBrook))
{
if (LoadingScreenController.sTravelWorldName != WorldData.GetLocationName(WorldName.NewDowntownWorld))
{
if (LoadingScreenController.sTravelWorldName != WorldData.GetLocationName(WorldName.AppaloosaPlains))
{
if (LoadingScreenController.sTravelWorldName != WorldData.GetLocationName(WorldName.StarlightShores))
{
if (LoadingScreenController.sTravelWorldName != WorldData.GetLocationName(WorldName.MoonlightFalls))
{
if (LoadingScreenController.sTravelWorldName == WorldData.GetLocationName(WorldName.IslaParadiso))
{
text2 = "ep10_world_loading_screen";
version = ProductVersion.EP10;
}
}
else
{
text2 = "world_loading_EP7World";
version = ProductVersion.EP7;
}
}
else
{
text2 = "world_loading_EP6World";
version = ProductVersion.EP6;
}
}
else
{
text2 = "ep5_world_loading_screen";
version = ProductVersion.EP5;
}
}
else
{
text2 = "world_loading_bridgeport";
version = ProductVersion.EP3;
}
}
else
{
text2 = "world_loading_twinbrook";
}
if (!string.IsNullOrEmpty(text2))
{
ImageDrawable imageDrawable = LoadingScreenController.sInstance.Drawable as ImageDrawable;
imageDrawable.Image = UIManager.LoadUIImage(ResourceKey.CreatePNGKey(text2, ResourceUtils.ProductVersionToGroupId(version)));
LoadingScreenController.sInstance.Invalidate();
}
}
screenHandled = true;
}
}
}
}
}
Finally, I did some changes in the method "StartLoadingScreen" in the class "GameStatesEx", which is located in same namespace, I also added my new class to.

Code: Select all

public static void StartLoadingScreen(bool isReturningHome)
{
try
{
PersistStatic.MainMenuLoading = false;
GameStates.EnsureNoModalDialogsUp();
GameUtils.EnableSceneDraw(false);
if (GameStates.DestinationTravelWorld != WorldName.Undefined)
{
string travelWorldName;
if (isReturningHome)
{
travelWorldName = GameStates.sTravelData.mHomeWorld;
}
else
{
if (LoadingScreenControllerEx.sVacationWorldNames.Contains(GameStates.DestinationTravelWorld))
{ /* Get full name string for one of the default vacation worlds. */
travelWorldName = Sims3.Gameplay.UI.Responder.Instance.HudModel.LocationName(GameStates.DestinationTravelWorld, true);
}
else
{ /* Get the right name string for any other world */
travelWorldName = WorldData.GetLocationName(GameStates.DestinationTravelWorld);
}
}
bool isFirstTimeTravelingToFuture = (GameStates.DestinationTravelWorld == WorldName.FutureWorld) && ((CauseEffectService.GetInstance() != null) && (CauseEffectService.GetInstance().GetTimesTraveledToFuture() == 0));
/* Call the modified method instead of the original */
LoadingScreenControllerEx.LoadTravellingLoadingScreen(travelWorldName, GameStates.DestinationTravelWorld, isReturningHome, isFirstTimeTravelingToFuture);
}
SpeedTrap.Sleep(0);
}
catch (Exception e)
{
Common.Exception("StartLoadingScreen", e);
}
}
After building the mod and adding to the game, now the loading screen while travelling to Bridgeport looks like so:

Image

When the loading screen is starting, there may be a short flickering because the image and the text are just replaced after the instance of the loading screen is created.
Otherwise, I couldn't find any other issues during my tests I did in the German version of the game. The correct text should also be displayed in all other languages.

Hope this is useful for everyone who is also bothered by broken loading screens. ;)

Alex4GER
Reactions:
Posts: 4
Joined: May 11th, 2022, 3:02 pm

Traveler: Solution for broken loadingscreens while travelling

Post by Alex4GER » September 4th, 2022, 4:29 pm

The solution above is fixing the background music and the caption ("Travelling to ...") in all cases, but it doesn't replace the loading screen image when travelling to installed worlds like Riverview. Because of this I've been working on a new mod named "NRaas_LoadingScreenExtension". This makes it possible that loading screens for installed worlds can be shown in-game.
An inspiration was the "LoadingScreenOverhaul" by gamefreak130 which can be found here. The new mod by me uses the NRaas-API and brings some optimizations, but it works as same as this. So, you can follow the instructions at MTS if you want to add loading screen images for installed worlds.
The "NRaas_LoadingScreenExtension" doesn't need any other mod to work. If you have installed Traveler, it's necessary to install "NRaas_LoadingScreenExtensionTravelerFix", too. Otherwise there will be still the issue that the loading screens while travelling are not shown correctly and the background loop won't be played.
NRaas_LoadingScreenExtension_V2.zip (tested with game version 1.69)
NRaas_LoadingScreenExtensionTravelerFix_V2.zip (tested with game version 1.69 and NRaas_Traveler_V87)
Last edited by Alex4GER on September 5th, 2022, 1:02 pm, edited 1 time in total.

Alex4GER
Reactions:
Posts: 4
Joined: May 11th, 2022, 3:02 pm

Traveler: Solution for broken loadingscreens while travelling

Post by Alex4GER » September 5th, 2022, 1:00 pm

Important update which fixes some problems with the mod

notes:
## LoadingScreenExtension_V2 ##
+ The dictionary which holds the screen data is now empty before adding the custom screen data.
+ Multiply entries for a world in WorldLoadingScreens.xml will be ignored. The mod will use only the first entry for a world.

## LoadingScreenExtensionTravelerFix_V2 ##
+ The game crash when starting a new game or savegame from main menu should be fixed now.

Please use the links in the last post to get the new mod version.

Alex4GER
Reactions:
Posts: 4
Joined: May 11th, 2022, 3:02 pm

Traveler: Solution for broken loadingscreens while travelling

Post by Alex4GER » March 19th, 2023, 1:16 pm

Small update that includes a feature to set the time to 8am every time your Sims arrive in a town after traveling

When a town is first traveled from the home world, it will be 8am upon arrival. Starting with the second vacation, your Sims will arrive at the time the last trip ended. This small update of the mod includes the feature that sets the time to 8am on each arrivial, just like it is when your Sims travel to China, Egypt or France. Oasis Landing will be not affected by this.

NRaas_LoadingScreenExtension_V3.zip (tested with game version 1.69)
NRaas_LoadingScreenExtensionTravelerFix_V3.zip (tested with game version 1.69 and NRaas_Traveler_V87)

Important note: Be sure to replace both mod files if you're going to use the new version. Otherwise there will be issues.

Post Reply