Home   Help Search Login Register  

Author Topic: Fade to black to rscPicture Problem:  (Read 1508 times)

0 Members and 3 Guests are viewing this topic.

Offline Wabbit

  • Members
  • *
  • Jeez, I used to have so many posts!
Fade to black to rscPicture Problem:
« on: 18 Oct 2006, 17:20:06 »
I guess we've lost the latest posts, so I will try again with this one.  This is a followup to a post I had about using a picture in a cutscene.  Several people have given some great help, and I had tried to reply to the last one, Mandoble:

Thanks, Mandoble, that is almost perfect!  I changed to a 1024x512 picture and had to do a lot of trial and error to get it positioned right, but it looks pretty good now.

I say almost perfect because there is still a small problem of a sort of hiccup during the fade to black when the picture comes on.  It's supposed to show the last movie scene and fade to black, then show the map picture with the black background. For some reason, right after it fades to black and just as the map picture comes on, instead of the black background it shows the island in the background.  I tried playing around with the script, but it doesn't seem to change anything.

Here is the section from the intro.sqs:
Code: [Select]
_cam camsettarget helo2
_cam camcommit 0
@camcommitted _cam

titlecut ["But their BlackHawk was hit by Triple-A on the return trip.","BLACK IN",5]
~10

;titlecut [" ","BLACK OUT",5]
;~5

6 fadeSound 0

titlecut [" ","BLACK OUT",6]
~6

;Show map picture
cutRsc ["endpicture", "PLAIN", 0.01]

TitleText ["We believe the helicopter has crashed, and if there are survivors,\ntheir long range radio must have been damaged.","PLAIN DOWN"]
~5
TitleText ["They should still have short range communications, but Strauss would\n have destroyed any communications equipment he had before being extracted.","PLAIN DOWN"]
~5
TitleText ["The Soviets started a major offensive on Malden last night,\nso we have limited resources to recover the survivors and time is running out.","PLAIN DOWN"]
~5

TitleText [" ","PLAIN DOWN"]

;End cutscene
_cam cameraeffect ["terminate", "back"]
camdestroy _cam
endcut = true

exit

And here is the section from the description.ext:
Code: [Select]
#define CT_STATIC 0
#define ST_PICTURE 48

class RscPicture
{
type = CT_STATIC;
style = ST_PICTURE;
idc = -1;
colorBackground[] = {1, 1, 1, 1};
colorText[] = {1, 1, 1, 1};
font = "tahomaB24";
size = 0;
sizeEx = 1;
lineSpacing = 1.0;
};

class RscText
{
        type = CT_STATIC;
        idc = -1;
        style = ST_LEFT;
        colorBackground[] = {0, 0, 0, 0};
        colorText[] = {1, 1, 1, 1};
        font = "tahomaB36";
        sizeEx = 0.04;
};

class RscTitles
{
        class endpicture
{
idd=-1;
movingEnable=false;
duration=35;
name="endpicture";
controls[]={"thebackground","thepicture"};
class thebackground : RscText
{
        style = ST_CENTER;
        x = 0;
        y = 0;
        w = 1;
        h = 1;
text = "";
        colorBackground[] = {0, 0, 0, 1};
};
class thepicture : RscPicture
{
text = "map.jpg";
x = 0.09; y = 0.04;
w = 0.85; h = 0.65;
};
};
};

Can you see where I am goofing it up?
Thanks!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fade to black to rscPicture Problem:
« Reply #1 on: 18 Oct 2006, 21:56:59 »
So you see the picture but not the black rectangle?

Try cutRsc ["endpicture", "PLAIN", 99999]

If no effect, to be sure the rectangle is there, try this in your description.ext

Code: [Select]
class thebackground : RscText
{
        style = ST_CENTER;
        x = 0;
        y = 0;
        w = 1;
        h = 0.25;
text = "HELLOHELLOHELLOHELLOHELLOHELLOHELLOHELLOHELLOHELLO";
        colorBackground[] = {0, 0, 1, 0.5};
};

That should show a blue semitransparent rectangle in the upper side of the screen with white fonts.

Offline Wabbit

  • Members
  • *
  • Jeez, I used to have so many posts!
Re: Fade to black to rscPicture Problem:
« Reply #2 on: 18 Oct 2006, 22:00:49 »
No, the black background is there, but for a second right in the beginning, it's not.
It goes from scene, fades to black, then shows map with island scene behind it for a second, then that fades to a black background for the rest of the show.
I thought I might be doing the black out part wrong, but I tried different things with no luck.
Thanks!

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fade to black to rscPicture Problem:
« Reply #3 on: 18 Oct 2006, 22:08:13 »
Now I understand.

I think the problem is as follows (comments with <-- first):
Code: [Select]
titlecut [" ","BLACK OUT",6] <-- you dont need the ",6" remove it
~6 <-- "BLACK OUT" by default needs a second to complete, so you use a second to blackout and 5 seconds with the screen black

;Show map picture
cutRsc ["endpicture", "PLAIN", 0.01] <-- Now comes the picture, it will need a second also to complete
~1 <-- ADD THIS HERE
TitleText ["We believe the helicopter has crashed, and if there are survivors,\ntheir long range radio must have been damaged.","PLAIN DOWN"] <-- Immediatelly after the picture you cancel the tittlecut BLACKOUT with a tittlecut PLAIN DOWN, and before the picture resource has finished showing its background. Because this I put ~1 just above this

Offline Mandoble

  • Former Staff
  • ****
    • Grunt ONE and MandoMissile suite
Re: Fade to black to rscPicture Problem:
« Reply #4 on: 19 Oct 2006, 22:42:41 »
A better way to have an instant black background:

1 - Place an empty Vulcan anywhere with 0 fuel, 0 ammo and 0 health, name it background (for example)
2 - Execute
Code: [Select]
[background]exec"Blackcam.sqs"

Code: [Select]
;Blackcam.sqs
; only parameter is the name of an empty Vulcan placed anywhere created with 0 fuel, 0 health and 0 ammo.
_tgt = _this select 0

titleText["This is going have suddenly a black background without any delay", "PLAIN"]
~6
_cam = "camera" camcreate [0, 0, 0]
_cam cameraeffect ["internal", "back"]
_dir = getDir _tgt
_pos = [(getPos _tgt select 0)+sin(_dir-90)*3,(getPos _tgt select 1)+cos(_dir-90)*3,1]
_cam camSetPos _pos
_cam camSetTarget _tgt
_cam camSetFov 0.1
_cam camCommit 0
;Now everything should be black

~2
titleText["Now everything should be black\nYou may change this text by a cutRsc to show a picture", "PLAIN"]
~8
titleText["Going back to normal in 6 seconds...", "PLAIN"]
~6
_cam cameraeffect ["terminate", "back"]
camDestroy _cam
exit

Offline Wabbit

  • Members
  • *
  • Jeez, I used to have so many posts!
Re: Fade to black to rscPicture Problem:
« Reply #5 on: 20 Oct 2006, 03:00:43 »
Thanks Mandoble!  You're edit to my script fixed the problem!  It actually gave a nice effect, fading out the Shilka in the background of the map.

Thanks!