Facebook Twitter YouTube Frictional Games | Forum | Privacy Policy | Dev Blog | Dev Wiki | Support | Gametee


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How Do i fade in/out
Author Message
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#1
How Do i fade in/out

Im trying to get my custom story to fade out before the credits roll, but i cant seem to get it working. Is this right?
PHP Code: (Select All)
void EndGame(string &in asParentstring &in asChildint alState)
{
    
FadeOut(0.0f);
    
FadeIn(4.0f);
    
PlayGuiSound("player_bodyfall.snt"5.0f);
    
AddTimer(""7.0f"Win");
}

void Win(string &in asTimer)
{
    
StartCredits("player_darkness.snt"true"Journal""Over"1);


All i want to do is fade out, but idk what to do.
04-06-2011, 10:04 AM
Find Reply
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#2
RE: How Do i fade in/out

Sadly, you can't have FadeIn and FadeOut under the same function. Make a timer for four seconds and FadeIn

04-06-2011, 10:10 AM
Find Reply
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#3
RE: How Do i fade in/out

(04-06-2011, 10:10 AM)Russ Money Wrote: Sadly, you can't have FadeIn and FadeOut under the same function. Make a timer for four seconds and FadeIn

ok thanks, i got it nowSmile i dont feel like making ANOTHER post, so do you think you can help me with loading times, like how to get a picture on the loading screen and possibly say something other than loading....? if not ill just make another topic.
04-06-2011, 10:13 AM
Find Reply
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#4
RE: How Do i fade in/out

In your extra_english.lang file, (or whichever language you're working in) make a new Category and add this.
<CATEGORY Name="LoadingText">
<Entry Name="NAME_OF_ENTRY"> ENTRY TEXT HERE </Entry>
</CATEGORY>

You can use <br> for breaks (starting a new line) when editing .lang file.

Then, in your script.
SetupLoadScreen(string &asTextCat, string &asTextEntry, int alRandomNum, string &asImageFile);

string &asTextCat - The category, which is "LoadingText"
string &asTextEntry - the "NAME_OF_ENTRY"
int alRandomNum - I believe if you have numbered NAME_OF_ENTRY names, it'll choose a random one. I normally have it as 0
string &asImageFile - Inside your custom story root folder, make subfolders which will lead to "YOUR CUSTOM STORY"\graphics\general, in there you can put .jpgs to call as your loading backgrounds.

If you want anymore help on this or anything else, add me to Steam and you can feel free to PM me.

04-06-2011, 10:24 AM
Find Reply
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#5
RE: How Do i fade in/out

(04-06-2011, 10:24 AM)Russ Money Wrote: In your extra_english.lang file, (or whichever language you're working in) make a new Category and add this.
<CATEGORY Name="LoadingText">
<Entry Name="NAME_OF_ENTRY"> ENTRY TEXT HERE </Entry>
</CATEGORY>

You can use <br> for breaks (starting a new line) when editing .lang file.

Then, in your script.
SetupLoadScreen(string &asTextCat, string &asTextEntry, int alRandomNum, string &asImageFile);

string &asTextCat - The category, which is "LoadingText"
string &asTextEntry - the "NAME_OF_ENTRY"
int alRandomNum - I believe if you have numbered NAME_OF_ENTRY names, it'll choose a random one. I normally have it as 0
string &asImageFile - Inside your custom story root folder, make subfolders which will lead to "YOUR CUSTOM STORY"\graphics\general, in there you can put .jpgs to call as your loading backgrounds.

If you want anymore help on this or anything else, add me to Steam and you can feel free to PM me.

I have no games on steam so cant add you. and does the SetupLoadScreen get put in the hps file? and how do i seperate 1 loading screen from another.
04-06-2011, 11:23 AM
Find Reply
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#6
RE: How Do i fade in/out

Yeah, in the .hps
Here's my .lang file, to give you an example.
<CATEGORY Name="LoadingText">
<Entry Name="letter">Writing of a site in South Africa made my skin crawl with goosebumps[br]and my heart race.[br]"remembered as the ones who saved humanity from all illness, all disorders."</Entry>
<Entry Name="plane">I expected the trees and bugs, but I didn't expect the plane's engine to fail.[br][br]I can only remember waking up hours later alone...</Entry>
</CATEGORY>

And the .hps
void OnStart()
{
FadeOut(1.0);
SetupLoadScreen("LoadingText", "letter", 0, "letter.jpg");
ChangeMap("intro_office.map", "intro", "", "");
}

To change them, just setup another SetupLoadScreen func.

(This post was last modified: 04-06-2011, 11:46 AM by Russ Money.)
04-06-2011, 11:46 AM
Find Reply
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#7
RE: How Do i fade in/out

(04-06-2011, 11:46 AM)Russ Money Wrote: Yeah, in the .hps
Here's my .lang file, to give you an example.
<CATEGORY Name="LoadingText">
<Entry Name="letter">Writing of a site in South Africa made my skin crawl with goosebumps[br]and my heart race.[br]"remembered as the ones who saved humanity from all illness, all disorders."</Entry>
<Entry Name="plane">I expected the trees and bugs, but I didn't expect the plane's engine to fail.[br][br]I can only remember waking up hours later alone...</Entry>
</CATEGORY>

And the .hps
void OnStart()
{
FadeOut(1.0);
SetupLoadScreen("LoadingText", "letter", 0, "letter.jpg");
ChangeMap("intro_office.map", "intro", "", "");
}

To change them, just setup another SetupLoadScreen func.

Alright thanks i got it, but when i load up a map, the picture or anything i wrote didnt show up, they only show up if i leave the room and re enter, i tried putting the SetupLoadinScreen both on void OnStart and void OnEnter but either way it either only loads the first time, or doesnt load the first time but loads the second, how can i make it load both? hopefully that makes sense
04-06-2011, 12:04 PM
Find Reply
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#8
RE: How Do i fade in/out

If you're talking about changing the loading screen, the only way I can describe it is the face-shield crying blood tears, I don't believe that can be done without a full conversion mod. And I have no idea how to do that at this moment.

But the load screens change whenever you have them changing. If it's OnStart of your first map, it's going to only show the load screen once you leave.

Otherwise, I'm not too sure what you're saying.

04-06-2011, 12:10 PM
Find Reply
Itskody Offline
Member

Posts: 100
Threads: 30
Joined: Mar 2011
Reputation: 1
#9
RE: How Do i fade in/out

(04-06-2011, 12:10 PM)Russ Money Wrote: If you're talking about changing the loading screen, the only way I can describe it is the face-shield crying blood tears, I don't believe that can be done without a full conversion mod. And I have no idea how to do that at this moment.

But the load screens change whenever you have them changing. If it's OnStart of your first map, it's going to only show the load screen once you leave.

Otherwise, I'm not too sure what you're saying.

i mean if i go from my first map to my second map, the loading screen doesnt show, but when i leave my second map to go to my first map, then go BACK to my second map, the loading screen shows up get it?
04-06-2011, 12:21 PM
Find Reply
Russ Money Offline
Senior Member

Posts: 360
Threads: 25
Joined: Dec 2010
Reputation: 4
#10
RE: How Do i fade in/out

Have you tried placing it under
void OnLeave()
{

}

04-06-2011, 12:23 PM
Find Reply




Users browsing this thread: 1 Guest(s)