Frictional Games Forum (read-only)

Full Version: Stuck Again - Showing Messages
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello guys, in my CS, at the beggining, I want to tell the custom story's story with messages.

I make the screen black with FadeOut. Now, I want to tell the story with 8 messages.

I want to do something like this:
When I used FadeOut, First message will appear for 10 seconds, after 10 seconds, it will dissappear. The second message will appear for 10 seconds again. I want to repeat this till the last message.

I tried but I'm stuck right now. Can you guys show me an example?
(08-27-2013, 06:56 PM)Arbies Wrote: [ -> ]Hello guys, in my CS, at the beggining, I want to tell the custom story's story with messages.

I make the screen black with FadeOut. Now, I want to tell the story with 8 messages.

I want to do something like this:
When I used FadeOut, First message will appear for 10 seconds, after 10 seconds, it will dissappear. The second message will appear for 10 seconds again. I want to repeat this till the last message.

I tried but I'm stuck right now. Can you guys show me an example?

Spoiler below!

void OnStart()
{
FadeOut(0);
AddTimer("IntroSequence",0,"IntroSequence");
}


void IntroSequence(string &in asTimer)
{
AddLocalVarInt("IntroVar", 1);
float CaseSpeed = 10.0f;

switch(GetLocalVarInt("IntroVar"))
{
case 1:
SetMessage("MessageCategory","MessageText1",10);
break;
case 2:
SetMessage("MessageCategory","MessageText2",10);
break;
case 3:
SetMessage("MessageCategory","MessageText3",10);
break;
}
if(GetLocalVarInt("IntroVar") < 4) AddTimer("IntroSequence", CaseSpeed, "IntroSequence");
}



This is how I'd do it - using a switch case to run through a set of cases, one for each message. This is good as you can easily add more cases and edit current ones.
(08-27-2013, 07:06 PM)sonataarctica Wrote: [ -> ]
(08-27-2013, 06:56 PM)Arbies Wrote: [ -> ]Hello guys, in my CS, at the beggining, I want to tell the custom story's story with messages.

I make the screen black with FadeOut. Now, I want to tell the story with 8 messages.

I want to do something like this:
When I used FadeOut, First message will appear for 10 seconds, after 10 seconds, it will dissappear. The second message will appear for 10 seconds again. I want to repeat this till the last message.

I tried but I'm stuck right now. Can you guys show me an example?

Spoiler below!

void OnStart()
{
FadeOut(0);
AddTimer("IntroSequence",0,"IntroSequence");
}


void IntroSequence(string &in asTimer)
{
AddLocalVarInt("IntroVar", 1);
float CaseSpeed = 10.0f;

switch(GetLocalVarInt("IntroVar"))
{
case 1:
SetMessage("MessageCategory","MessageText1",10);
break;
case 2:
SetMessage("MessageCategory","MessageText2",10);
break;
case 3:
SetMessage("MessageCategory","MessageText3",10);
break;
}
if(GetLocalVarInt("IntroVar") < 4) AddTimer("IntroSequence", CaseSpeed, "IntroSequence");
}



This is how I'd do it - using a switch case to run through a set of cases, one for each message. This is good as you can easily add more cases and edit current ones.
Ah, you again SonataArctica, you dude just made my day today. Thanks for your help. You are awesome. +1
(08-27-2013, 07:12 PM)Arbies Wrote: [ -> ]
(08-27-2013, 07:06 PM)sonataarctica Wrote: [ -> ]
(08-27-2013, 06:56 PM)Arbies Wrote: [ -> ]Hello guys, in my CS, at the beggining, I want to tell the custom story's story with messages.

I make the screen black with FadeOut. Now, I want to tell the story with 8 messages.

I want to do something like this:
When I used FadeOut, First message will appear for 10 seconds, after 10 seconds, it will dissappear. The second message will appear for 10 seconds again. I want to repeat this till the last message.

I tried but I'm stuck right now. Can you guys show me an example?

Spoiler below!

void OnStart()
{
FadeOut(0);
AddTimer("IntroSequence",0,"IntroSequence");
}


void IntroSequence(string &in asTimer)
{
AddLocalVarInt("IntroVar", 1);
float CaseSpeed = 10.0f;

switch(GetLocalVarInt("IntroVar"))
{
case 1:
SetMessage("MessageCategory","MessageText1",10);
break;
case 2:
SetMessage("MessageCategory","MessageText2",10);
break;
case 3:
SetMessage("MessageCategory","MessageText3",10);
break;
}
if(GetLocalVarInt("IntroVar") < 4) AddTimer("IntroSequence", CaseSpeed, "IntroSequence");
}



This is how I'd do it - using a switch case to run through a set of cases, one for each message. This is good as you can easily add more cases and edit current ones.
Ah, you again SonataArctica, you dude just made my day today. Thanks for your help. You are awesome. +1

What can I say, I'm in a helpful mood today! Big Grin Haha. You're welcome.