How to make Text dialogue

Talk about making games.

How to make Text dialogue

Postby Setokyo » Sat Aug 14, 2010 7:37 pm

Hi i was wondering how to make the text dialogues for the talking for the ppl in the game?
Any ideas or code for it?
Laws control the lesser man. Right conduct controls the greater one

"I'd rather be hated for who I am than loved for who I am not
User avatar
Setokyo
 
Posts: 85
Joined: Fri Jul 09, 2010 1:52 am
Location: Holetown barbados
Score: 3 Give a positive score

Re: How to make Text dialogue

Postby savvy » Sat Aug 14, 2010 8:25 pm

you could make it so that the text is part of an animation, and when the player presses Z for example, it does
Code: Select all
animindex+=1;
meaning that the animation will change to the next one.
the text has to be seperate, or actually part of the textbox's animation
--> For my help, i ask for a simple +1 if it helps! ^-^
--> I dont code, I type art which you dont understand.
--> I keep winning the 3D model challenge at college, teacher says: "you keep winning im not giving you prizes".
User avatar
savvy
 
Posts: 494
Joined: Wed Jun 03, 2009 11:55 am
Location: England
Score: 44 Give a positive score

Re: How to make Text dialogue

Postby Setokyo » Sat Aug 14, 2010 9:51 pm

any other ideas
Laws control the lesser man. Right conduct controls the greater one

"I'd rather be hated for who I am than loved for who I am not
User avatar
Setokyo
 
Posts: 85
Joined: Fri Jul 09, 2010 1:52 am
Location: Holetown barbados
Score: 3 Give a positive score

Re: How to make Text dialogue

Postby Scorpion50o1 » Sun Aug 15, 2010 12:24 pm

OMG IM SO BORED <(^^)> (>^^)> (>^^)>
92% of teens have moved on to rap. If you are part of the 8% who still listen to real music, copy and paste this into your signature.
User avatar
Scorpion50o1
 
Posts: 246
Joined: Fri Apr 17, 2009 1:07 am
Location: TX
Score: 8 Give a positive score

Re: How to make Text dialogue

Postby Setokyo » Sun Aug 15, 2010 1:31 pm

Hey
THanks it does
any more ideas
Laws control the lesser man. Right conduct controls the greater one

"I'd rather be hated for who I am than loved for who I am not
User avatar
Setokyo
 
Posts: 85
Joined: Fri Jul 09, 2010 1:52 am
Location: Holetown barbados
Score: 3 Give a positive score

Re: How to make Text dialogue

Postby lcl » Sun Aug 15, 2010 3:34 pm

I usually do it this way:

I have actors TalkBg, Text and Talk1.
And I have two global variables, speaking and talk.

TalkBg - create actor- script editor:
Code: Select all
VisibilityState("Event Actor", DISABLE);

Draw actor - script editor:
Code: Select all
if (speech == 1)
{
    VisibilityState("Event Actor", ENABLE);
    if (transp > 0)
    {
        transp -= .05;
    }
}
if (speech == 0)
{
    if (transp < 1)
    {
        transp += .05;
    }
    if (transp == 1)
    {
        VisibilityState("Event Actor", DISABLE);
    }
}


Text - create actor - script editor:
Code: Select all
speaking = 0;
talk = 0;
sprintf(text, " ");
VisibilityState("Event Actor", DISABLE);


key down - key that you want to change text - repeat: disable - script editor:
Code: Select all
if (speaking == 1)
{
    talk += 1;
}


Talk1 - create actor - script editor:
Code: Select all
EventDisable("Event Actor", EVENTANIMATION);


collision - any side of main actor - script editor:
Code: Select all
if(can_speak == 1)
{
    speaking = 1;
    talk = 1;
    VisibilityState("Text", ENABLE);
    EventDisable("Main Actor", EVENTKEYDOWN);
    EventEnable("Event Actor", EVENTANIMATION);
}
if(can_speak == 0)
{
    DestroyActor("Event Actor");
}



Draw actor - script editor:
Code: Select all
switch (talk)
{
    case 1:
    speech = 1;
    sprintf(Text.text, "Here comes what you want your actor say first."); //first words
    break;

    case 2:
    speech = 1;
    sprintf(Text.text, "Here comes what you want your actor say second."); //second words
    break;

    case 3:
    //This is for hiding the text
    sprintf(Text.text, " ");
    talk = 0;
    speaking = 0;
    speech = 0;
    DestroyActor("Event Actor");
    VisibilityState("Text", DISABLE);
    EventEnable("Main actor", EVENTKEYDOWN);
    break;
}


And then i create actors like Talk2, Talk3, and this way for other talkings...
This is my way of doing it, not best but works. :D
User avatar
lcl
 
Posts: 2339
Joined: Thu Mar 25, 2010 5:55 pm
Location: Finland
Score: 276 Give a positive score


Return to Game Development

Who is online

Users browsing this forum: No registered users and 1 guest