• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Loading Screen and Fade

Status
Not open for further replies.
Level 17
Joined
Dec 11, 2014
Messages
2,004
What I want to achieve is when I see the "PRESS ANY KEY TO CONTINUE" The Loading screen still remain, and after a few seconds it goes black.

So, I used a Reskin for Generic Loading Screen, and a Fade on map start and then changing it to black fade. Though, My "Fade" seems a bit resized compared to Loading Screen, and a Bit Bluer.

Here's a portion of System just in case:

  • Initialization
    • Events
      • Map initialization
    • Conditions
    • Actions
      • Set DH = Demon Hunter 0000 <gen>
      • Environment - Set sky to war3mapImported\MoonySky.mdx
      • Custom script: call Initializer()
JASS:
 function Act1F1 takes nothing returns nothing
    call CinematicFade(bj_CINEFADETYPE_FADEIN, 2, "ReplaceableTextures\\CameraMasks\\Black_mask.blp", 100, 100, 100, 0)
    call CameraSetupApplyForceDuration(gg_cam_Cam_1, true, 0)
    call CameraSetupApplyForceDuration(gg_cam_Cam_2, true, 4)
    call Wait(4)
 endfunction
 
 function EndFade takes nothing returns nothing
     call CinematicFade(bj_CINEFADETYPE_FADEIN, 0, "Ls.tga", 100, 100, 100, 0)
     if (bj_cineFadeContinueTimer != null) then
        call DestroyTimer(bj_cineFadeContinueTimer)
    endif

    if (bj_cineFadeFinishTimer != null) then
        call DestroyTimer(bj_cineFadeFinishTimer)
    endif
    call SetCineFilterTexture("Ls.tga")
    call SetCineFilterBlendMode(BLEND_MODE_BLEND)
    call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
    call SetCineFilterStartUV(0, 0, 1, 1)
    call SetCineFilterEndUV(0, 0, 1, 1)
    call SetCineFilterStartColor(255, 255, 255, 255)
    call SetCineFilterEndColor(0, 0, 0, 255)
    call SetCineFilterDuration(2)
    call DisplayCineFilter(true)
    call Wait(2)
 endfunction
 
 function Initializer takes nothing returns nothing
 local timer t = CreateTimer()
     call StopMusic(false)
     call ClearMapMusic()
     call StopMusic(false)
     call PlayMusic(gg_snd_Nightsong)
        if (not bj_cineModeAlreadyIn) then
            set bj_cineModeAlreadyIn = true
            set bj_cineModePriorSpeed = GetGameSpeed()
            set bj_cineModePriorFogSetting = IsFogEnabled()
            set bj_cineModePriorMaskSetting = IsFogMaskEnabled()
            set bj_cineModePriorDawnDusk = bj_useDawnDuskSounds
            set bj_cineModeSavedSeed = GetRandomInt(0, 1000000)
        endif
        if (IsPlayerInForce(GetLocalPlayer(), bj_FORCE_ALL_PLAYERS)) then
            call ClearTextMessages()
            call ShowInterface(false, 0)
            call EnableUserControl(false)
            call EnableOcclusion(false)
            call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_UNITMOVEMENT,  bj_CINEMODE_VOLUME_UNITMOVEMENT)
            call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_UNITSOUNDS,    bj_CINEMODE_VOLUME_UNITSOUNDS)
            call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_COMBAT,        bj_CINEMODE_VOLUME_COMBAT)
            call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_SPELLS,        bj_CINEMODE_VOLUME_SPELLS)
            call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_UI,            bj_CINEMODE_VOLUME_UI)
            call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_MUSIC,         bj_CINEMODE_VOLUME_MUSIC)
            call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_AMBIENTSOUNDS, bj_CINEMODE_VOLUME_AMBIENTSOUNDS)
            call VolumeGroupSetVolume(SOUND_VOLUMEGROUP_FIRE,          bj_CINEMODE_VOLUME_FIRE)
        endif
        call SetGameSpeed(bj_CINEMODE_GAMESPEED)
        call SetMapFlag(MAP_LOCK_SPEED, true)
        call FogMaskEnable(false)
        call FogEnable(false)
        call EnableWorldFogBoundary(false)
        set bj_useDawnDuskSounds = false
        call SetRandomSeed(0)
        call UnitAddAbility(udg_DH, 'Arav')
        call CinematicFade(bj_CINEFADETYPE_FADEOUT, 0, "Ls.tga", 100, 100, 100, 0)
        call TimerStart(t, 2, false, function EndFade)
 endfunction
JASS:
function CinematicFade takes integer fadetype, real duration, string tex, real red, real green, real blue, real trans returns nothing
    if (fadetype == bj_CINEFADETYPE_FADEOUT) then
        // Fade out to the requested color.
        set udg_IsInFade = true
    if (bj_cineFadeContinueTimer != null) then
        call DestroyTimer(bj_cineFadeContinueTimer)
    endif

    if (bj_cineFadeFinishTimer != null) then
        call DestroyTimer(bj_cineFadeFinishTimer)
    endif
    call EnableUserUI(false)
    call SetCineFilterTexture(tex)
    call SetCineFilterBlendMode(BLEND_MODE_BLEND)
    call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
    call SetCineFilterStartUV(0, 0, 1, 1)
    call SetCineFilterEndUV(0, 0, 1, 1)
    call SetCineFilterStartColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-100))
    call SetCineFilterEndColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-trans))
    call SetCineFilterDuration(duration)
    call DisplayCineFilter(true)
    elseif (fadetype == bj_CINEFADETYPE_FADEIN) then
        set udg_IsInFade = false
    if (bj_cineFadeContinueTimer != null) then
        call DestroyTimer(bj_cineFadeContinueTimer)
    endif

    if (bj_cineFadeFinishTimer != null) then
        call DestroyTimer(bj_cineFadeFinishTimer)
    endif
    call EnableUserUI(false)
    call SetCineFilterTexture(tex)
    call SetCineFilterBlendMode(BLEND_MODE_BLEND)
    call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
    call SetCineFilterStartUV(0, 0, 1, 1)
    call SetCineFilterEndUV(0, 0, 1, 1)
    call SetCineFilterStartColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-100))
    call SetCineFilterEndColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-trans))
    call SetCineFilterDuration(duration)
    call DisplayCineFilter(true)
    if duration > 0 then
    set bj_cineFadeFinishTimer = CreateTimer()
    call TimerStart(bj_cineFadeFinishTimer, duration, false, function FinishCinematicFadeBJ)
    else
    call DestroyTimer(bj_cineFadeFinishTimer)
    set bj_cineFadeFinishTimer = null
    call DisplayCineFilter(false)
    call EnableUserUI(true)
    endif
    elseif (fadetype == bj_CINEFADETYPE_FADEOUTIN) then
        // Fade out to the requested color, and then fade back in from it.
        if (duration > 0) then
    if (bj_cineFadeContinueTimer != null) then
        call DestroyTimer(bj_cineFadeContinueTimer)
    endif

    if (bj_cineFadeFinishTimer != null) then
        call DestroyTimer(bj_cineFadeFinishTimer)
    endif
    set udg_IsInFade = false
    call EnableUserUI(false)
    call SetCineFilterTexture(tex)
    call SetCineFilterBlendMode(BLEND_MODE_BLEND)
    call SetCineFilterTexMapFlags(TEXMAP_FLAG_NONE)
    call SetCineFilterStartUV(0, 0, 1, 1)
    call SetCineFilterEndUV(0, 0, 1, 1)
    call SetCineFilterStartColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-100))
    call SetCineFilterEndColor(PercentTo255(red), PercentTo255(green), PercentTo255(blue), PercentTo255(100-trans))
    call SetCineFilterDuration(duration)
    call DisplayCineFilter(true)
    set bj_cineFadeContinueRed = red
    set bj_cineFadeContinueGreen = green
    set bj_cineFadeContinueBlue = blue
    set bj_cineFadeContinueTrans = trans
    set bj_cineFadeContinueDuration = duration
    set bj_cineFadeContinueTex = tex
    set bj_cineFadeContinueTimer = CreateTimer()
    call TimerStart(bj_cineFadeContinueTimer, duration, false, function ContinueCinematicFadeBJ)
    set bj_cineFadeFinishTimer = CreateTimer()
    call TimerStart(bj_cineFadeFinishTimer, duration, false, function FinishCinematicFadeBJ)
        endif
    else
    endif
endfunction

JASS:
function WaitEx takes nothing returns nothing
  set udg_Func_Num = udg_Func_Num + 1
 call ExecuteFunc("Act" + I2S(udg_Act_Num) + "F" + I2S(udg_Func_Num))
endfunction

function Wait takes real sec returns nothing
 local timer t = CreateTimer()
    call TimerStart(t, sec, false, function WaitEx)
 set t = null
endfunction
 
Level 31
Joined
Jun 27, 2008
Messages
2,557
Fade filters react to lighting. Let's say you use call SetDayNightModels ("",""), this will make all your fade filters black. If there is night, your filters will be blueish. If there is a day, it will be normal color. Try to change game time to 12:00 when game starts. If you want your fade filter to be HQ, use high resolution (more than 1024x1024) TGA files instead of BLP, because BLP is forced into 512x512 ingame no matter the resolution.
 
Level 31
Joined
Jun 27, 2008
Messages
2,557
If I recall correctly it was only 2 images with 512x512 and ther 2 images with 256x256, so overall result is not really that good, just 1024x768. Yet it still does much better than 512x512. If one wish to free from this limitation and avoid those messy tutorials, just use TGA files no matter the size, it is not forced into 512x512 as BLPs, so any resolution can be used, of course size is even greater then.

But in this case proper transition between loading screen and a fade filter must be done. Having a good lighting and one big TGA both can be done.

Another method would be to take a plane model and apply 512x512 BLP textures to it. You will have to make several or many plane models with split skin of the loading screen, similar to 4 image loading screen method. So when you have like 4-10 of those planes with each piece of screen, put them together ingame on ground and apply camera over it. You can make those planes unshaded and unfogged, so fogs and lighting would have no effect anymore. But easiest way is to go with TGA and sacrifice 5-7 MBs of space.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
No seriously guys no need to complicate this more and more. The problem is simple to understand.
The fact is, the loading screen is not bordered by UI (As APproject said), so 512x512 will be displayed with no stretching. The fade filters in-game will be resized, and any square-sized images will be widened to fit with 16:9 settings (or 4:3).

In order to fix such problem, you have LoadingScreen.blp aside, okay, you won't to add it as a fade-filter because it bugs. Instead, make another picture with the very same picture but crop it, you know how to crop it? Yes, with any drawing program (I recommend Paint.NET as it has a simple user-friendly cropping interface.

Now , how much do you crop? This is a picture that explains it... so our fade-filter won't be widened if it's not square, but just a not-a-square rectangle sized.

Using the 4:3 option (probably the best) , the new size will be 512x384. So all you have to do is create a new image crop it to be 512x384 (Now be clever, crop a little bit upside, and a little bit more down side, so when you fade filter it in the beginning it'll not look as it moved or something, this is a photo to explain :

NOTE : Import it as TGA format so it will look the best in terms of quality (That's when it comes to fade filters, tga are the best, ignore the name of the file "FadeScreenCropped.blp", Do not import it as BLP !)

Y8KL1.jpg


Good luck.
 
Level 12
Joined
Nov 3, 2013
Messages
989
I'm not an expert but won't you have to take into account different resolutions for each player locally?

And if you do then I guess that means several copies of the same image which would take a lot of space.
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Its not cropped, its resized.

The point is:
How much is that resized?

Man, no one mentioned the photo gets cropped in fade filters. Yes it gets resized, but that'll happen according to "Aspect ratio". So let's assume the aspect ratio of the cinematic watcher is 4:3 (Applies on 640x480 resolution and 800x600) :

The loading screen's original size is 512x512 , when you display it as a fade filters, it'll be resized to fit 4:3 aspect ratio. The new size (automated by warcraft's engine) will be 512x384. So if you want to fade-filter an image and you don't want it to be resized, make sure the aspect ratio is 4:3 and not 1:1 (Such as 512x512) [Square-sized]
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
Man, no one mentioned the photo gets cropped in fade filters. Yes it gets resized, but that'll happen according to "Aspect ratio". So let's assume the aspect ratio of the cinematic watcher is 4:3 (Applies on 640x480 resolution and 800x600) :

The loading screen's original size is 512x512 , when you display it as a fade filters, it'll be resized to fit 4:3 aspect ratio. The new size (automated by warcraft's engine) will be 512x384. So if you want to fade-filter an image and you don't want it to be resized, make sure the aspect ratio is 4:3 and not 1:1 (Such as 512x512) [Square-sized]

Duuuuuuuuuude!

You've counted the loading screen as 512x512, but it is 1024x768. I'm Reskinning the Generic Loading screen.

What I need is how the 1024x768 is resized, not the not-existent 512x512. +rep, just because you're helping.

+rep all!
 
Level 15
Joined
Oct 29, 2012
Messages
1,474
Duuuuuuuuuude!

You've counted the loading screen as 512x512, but it is 1024x768. I'm Reskinning the Generic Loading screen.

What I need is how the 1024x768 is resized, not the not-existent 512x512. +rep, just because you're helping.

+rep all!

You should of said that man. 1024x768 fits 4:3 Aspect ratio. Which means, it, being resized, that's just to fit the 16:9 ratio. (I expect, and as I said before, Warcraft uses 16:9 aspect ratio.)

So the final sentence is, to get a full non-resized photo to work, you have to import your Fade Filter Image as 16:9. The size should be 576 (Trust me, any photo with this size won't get resized, that's a guarantee).

Now you surely dont know how to deal with Aspect ratio and resolutions, but here it is :
There are endless aspect ratios but the most used are 1:1, 16:9, and 4:3. It's just like this in the general form ( Aspect ratio = a:b)
(Width * Aspect ratio's a)/ Aspect Ratio's b = Height.

Good luck.
 
Level 17
Joined
Dec 11, 2014
Messages
2,004
You should of said that man. 1024x768 fits 4:3 Aspect ratio. Which means, it, being resized, that's just to fit the 16:9 ratio. (I expect, and as I said before, Warcraft uses 16:9 aspect ratio.)

So the final sentence is, to get a full non-resized photo to work, you have to import your Fade Filter Image as 16:9. The size should be 576 (Trust me, any photo with this size won't get resized, that's a guarantee).

Now you surely dont know how to deal with Aspect ratio and resolutions, but here it is :
There are endless aspect ratios but the most used are 1:1, 16:9, and 4:3. It's just like this in the general form ( Aspect ratio = a:b)
(Width * Aspect ratio's a)/ Aspect Ratio's b = Height.

Good luck.

Me said:
So, I used a Reskin for Generic Loading Screen

Generic loading screen is 1024x768.

Alright. Will use a 1024x576 Fade. Thank you. Gonna test soon.


EDIT: Does NOT work. It's still resized a bit. and Totally not what I want.
 
Last edited:
Level 15
Joined
Oct 29, 2012
Messages
1,474
Generic loading screen is 1024x768.

Alright. Will use a 1024x576 Fade. Thank you. Gonna test soon.


EDIT: Does NOT work. It's still resized a bit. and Totally not what I want.

Exactly what I expected. You just resized the original picture to 1024x576 without cropping it , therefore the fade image will be resized vertically (To fit UI). You have to crop it, give me your LoadingScreen image in private I will try to crop it to fit 1024x576 and you'll eventually understand how fade filters work in a test map that I'll send to you after I finish cropping.
 
Status
Not open for further replies.
Top