Page 1 of 1
OMG SOMEONE PLEASE ANSWERE
Posted:
Wed Jun 03, 2009 7:22 pm
by Hblade
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, " ");
}
}
}
Re: Even more text problems.
Posted:
Wed Jun 03, 2009 9:19 pm
by skydereign
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.
Re: Even more text problems.
Posted:
Wed Jun 03, 2009 9:35 pm
by Hblade
Ok, what I'm asking is can I make the message compleatly erase before it types the next message?
Re: OMG SOMEONE PLEASE ANSWERE
Posted:
Fri Jun 05, 2009 12:00 pm
by savvy
a realy simple option would be that you could add a timer which destroys it, instead of a load of coding.
Re: OMG SOMEONE PLEASE ANSWERE
Posted:
Fri Jun 05, 2009 1:01 pm
by Hblade
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.
Re: OMG SOMEONE PLEASE ANSWERE
Posted:
Sat Jun 06, 2009 11:04 pm
by jimmynewguy
let me see the file, you deleted it
EDIT: Nvm made my own attempting to help....
Re: OMG SOMEONE PLEASE ANSWERE
Posted:
Sat Jun 06, 2009 11:23 pm
by Bee-Ant
You have to put the reset code before the writing code.
Wait, i have a demo about this...
Re: OMG SOMEONE PLEASE ANSWERE
Posted:
Sun Jun 07, 2009 1:24 pm
by Bee-Ant
Heres the demo.
Hope helps
Re: OMG SOMEONE PLEASE ANSWERE
Posted:
Sun Jun 07, 2009 7:36 pm
by Hblade
Hey bee-ant, nice job! I've been waiting for weeks to get this answere.
Re: OMG SOMEONE PLEASE ANSWERE
Posted:
Mon Jun 08, 2009 12:01 am
by Bee-Ant
Thanks, but all the credits belongs to pyrometal.
I just added the sound, next notification, and timer system