OMG SOMEONE PLEASE ANSWERE

Non-platform specific questions.

OMG SOMEONE PLEASE ANSWERE

Postby Hblade » Wed Jun 03, 2009 7:22 pm

Hey, it's me, and I was wondering, HOW THE HECK DO I FIX THIS? I want it to when you press enter, the message erases, but dosn't delete the actor.
Code: Select all
Global Code
int framecount;
int i;
int newmessage;
int complete;
int temp;
int nextmessage;
void TypeMessage(char q[255], int speed)
{
    if (newmessage == 0)
    {
        strncpy(q, "", i);
        newmessage = 1;
    }
    strcmp("q", text);
    framecount = framecount + 1;
    if (framecount == speed && i<strlen(q) + 1)
    {
        strncpy(text, q, i);
        framecount = 0;
        i++;
        PlaySound2("data/sound.wav", 1.000000, 1, 0.000000);
        q = q + 1;
        if (i == strlen(q) + 1)
        {
            temp = 1;
        }
        if (nextmessage == 1)
        {
            strncpy(q, " ", 1);
            temp = 0;
            nextmessage = 0;
            strcpy(q, " ");
        }
    }
}
Last edited by Hblade on Fri Jun 05, 2009 4:00 am, edited 1 time in total.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: Even more text problems.

Postby skydereign » Wed Jun 03, 2009 9:19 pm

What are you asking for? Do you want the message to erase as new letters are introduced? Or do you want the text to erase itself first, and then type the new message? If so, I would either add an Actor* variable, allowing you to control which text you are changing, or have a function that sets up a char*/char[]. This way the actor only needs to print the string, and another actor, controlling the function, would work. This may not seem optimal, but it does prevent the need to add another variable, if that is what you prefer. Since you are already using a char[], why not implement one more so the comparison and text clean up is easier? If you would like me to explain more, I can, and if you want me just to try to fix it now, as it is, I can try.
User avatar
skydereign
 
Posts: 3510
Joined: Mon Jul 28, 2008 8:29 am
Score: 589 Give a positive score

Re: Even more text problems.

Postby Hblade » Wed Jun 03, 2009 9:35 pm

Ok, what I'm asking is can I make the message compleatly erase before it types the next message?
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: OMG SOMEONE PLEASE ANSWERE

Postby savvy » Fri Jun 05, 2009 12:00 pm

a realy simple option would be that you could add a timer which destroys it, instead of a load of coding.
--> 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: OMG SOMEONE PLEASE ANSWERE

Postby Hblade » Fri Jun 05, 2009 1:01 pm

You dont get what I'm saying. Ok, what I'mn trying to say is, Here... Heres a text box.
|||||||||||||||||||||||||||||
| This is a typing text |
|||||||||||||||||||||||||||||
Now, the message in the text box types out, I have that done already, but when i want it to display a new message, say example, This is message 2, it would overwrite the older one, so it would look like this.
|||||||||||||||||||||||||||||
| This is metypeing text. |
|||||||||||||||||||||||||||||
Instead of looking like this.
|||||||||||||||||||||||||||||
| This is message 2 |
|||||||||||||||||||||||||||||
So, instead of typing a new message, it just overwrites that message.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: OMG SOMEONE PLEASE ANSWERE

Postby jimmynewguy » Sat Jun 06, 2009 11:04 pm

let me see the file, you deleted it
EDIT: Nvm made my own attempting to help....
Working on a probably too ambitious project! Wild-west-adventure-RPG-shooter-thing.
User avatar
jimmynewguy
 
Posts: 1137
Joined: Sat Mar 31, 2007 6:27 pm
Score: 89 Give a positive score

Re: OMG SOMEONE PLEASE ANSWERE

Postby Bee-Ant » Sat Jun 06, 2009 11:23 pm

You have to put the reset code before the writing code.
Wait, i have a demo about this...
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: OMG SOMEONE PLEASE ANSWERE

Postby Bee-Ant » Sun Jun 07, 2009 1:24 pm

Heres the demo.
Hope helps :D
Attachments
TypeWritingDialog.zip
(96.8 KiB) Downloaded 85 times
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score

Re: OMG SOMEONE PLEASE ANSWERE

Postby Hblade » Sun Jun 07, 2009 7:36 pm

Hey bee-ant, nice job! I've been waiting for weeks to get this answere.
Subscribe to my YouTube? - Yes| No
User avatar
Hblade
 
Posts: 4455
Joined: Fri Dec 08, 2006 11:14 pm
Score: 181 Give a positive score

Re: OMG SOMEONE PLEASE ANSWERE

Postby Bee-Ant » Mon Jun 08, 2009 12:01 am

Thanks, but all the credits belongs to pyrometal.
I just added the sound, next notification, and timer system :D
User avatar
Bee-Ant
 
Posts: 3723
Joined: Wed Apr 11, 2007 12:05 pm
Location: http://www.instagram.com/bee_ant
Score: 210 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest

cron