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
Script Help Stuck Again - Showing Messages
summit Offline
Senior Member

Posts: 273
Threads: 20
Joined: Jun 2013
Reputation: 7
#1
Stuck Again - Showing Messages

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
Find
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#2
RE: Stuck Again - Showing Messages

(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.

Closure ModDB page:

[Image: 16LO8Sx]
08-27-2013, 07:06 PM
Find
summit Offline
Senior Member

Posts: 273
Threads: 20
Joined: Jun 2013
Reputation: 7
#3
RE: Stuck Again - Showing Messages

(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
Find
ExpectedIdentifier Offline
Member

Posts: 234
Threads: 10
Joined: Sep 2012
Reputation: 11
#4
RE: Stuck Again - Showing Messages

(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.

Closure ModDB page:

[Image: 16LO8Sx]
08-27-2013, 07:27 PM
Find




Users browsing this thread: 1 Guest(s)