AHK1221 Posted June 11, 2016 Share Posted June 11, 2016 Hello all, I am trying to work on a mod, but sadly I have encountered a bug. Infinte loading bug using FadeIn and FadeOut. First of all, I had no idea what to pass in as params, did something, and it worked. After some tinkering, it never loads! I have no idea what I have done. Can someone check the code to see if something is fish? public class CutsceneTeleportation : Script { public static void TimeTravel(Vehicle delorean) { float speedConserve = delorean.Speed; delorean.IsVisible = false; Game.Player.Character.IsVisible = false; delorean.Speed = 0; delorean.IsInvincible = true; delorean.EngineRunning = false; World.AddExplosion(delorean.Position, ExplosionType.PlaneRocket, 20f, 0f); Wait(2000); Game.FadeScreenIn(-1); Weather weatherToSet = RandomWeather(); World.TransitionToWeather(weatherToSet, 1); if (Game.Player.WantedLevel > 0) Game.Player.WantedLevel = 0; //int hours = DateManager.GetHours(); //Function.Call(Hash.SET_CLOCK_TIME, hours, 0, 0); Script.Wait(5000); Game.FadeScreenOut(1); if (Game.IsScreenFadingOut == false) { Script.Wait(5000); World.AddExplosion(delorean.Position, ExplosionType.PlaneRocket, 20f, 0f); Script.Wait(500); World.AddExplosion(delorean.Position, ExplosionType.PlaneRocket, 20f, 0f); Wait(500); delorean.IsVisible = true; Game.Player.Character.IsVisible = true; delorean.Speed = speedConserve; delorean.IsInvincible = true; delorean.EngineRunning = true; } } public static Weather RandomWeather() { Random rand = new Random(); int randWeather = rand.Next(1, 10); Weather returnWeather = Weather.Clear; if (randWeather > 5) { returnWeather = Weather.ExtraSunny; } if (randWeather <= 5) { returnWeather = Weather.Raining; } return returnWeather; } } Link to comment Share on other sites More sharing options...
unknown modder Posted June 11, 2016 Share Posted June 11, 2016 It seems like you're fading the screen out but then never fading it back in, Use Game.FadeScreenIn(1000) at the end of the Time Travel function Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now