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


Messages In This Thread
Stuck Again - Showing Messages - by summit - 08-27-2013, 06:56 PM
RE: Stuck Again - Showing Messages - by ExpectedIdentifier - 08-27-2013, 07:06 PM
RE: Stuck Again - Showing Messages - by summit - 08-27-2013, 07:12 PM



Users browsing this thread: 1 Guest(s)