Page 1 of 1

set text based on count variable.

PostPosted: Wed Sep 13, 2006 6:28 pm
by Hyperyon
How do I set text of actor in script editor?

PostPosted: Wed Sep 13, 2006 7:14 pm
by makslane
You need to use the strcpy function:

Code: Select all
strcpy(text, "your text here");

PostPosted: Thu Sep 14, 2006 2:07 am
by Hyperyon
It gives me 'warning: trying to convert from cos int to '* const char' after I put in the text.

here is the code i used:

count++;

if(count==1)
{
strcpy(thetext.text, 12);
}


I'm trying to change a text from image file.
'the text' is my text actor

PostPosted: Thu Sep 14, 2006 4:02 am
by makslane
If you need set a number, use:

Code: Select all
thetext.textNumber =  12;

PostPosted: Tue Sep 19, 2006 8:59 pm
by Hyperyon
Im still not getting part of this... :oops:

I got 2 actors. Text (with text from true type)and keydown actor with a keydown event/script editor/

count++;

if (count==1)
{
strcpy(ttext.text, "greetings");
}
else if(count==2)
{
strcpy(ttext.text, "how are you?");
}


When I press the keydown, the text changes forward into count2 ("how are you") instead of the first text.

Maybe im doing it wrong in the 'copy string' window that pops up when i click on strcpy from variables/functions?

PostPosted: Tue Sep 19, 2006 9:54 pm
by Game A Gogo
put the count++ aftyer the code.

PostPosted: Tue Sep 19, 2006 11:30 pm
by Hyperyon
Now it just shuffles the texts without stopping.

PostPosted: Tue Sep 19, 2006 11:32 pm
by Game A Gogo
mmmmm, maybe its because thatthe action is always repeated.

PostPosted: Tue Sep 19, 2006 11:38 pm
by Hyperyon
ah, I dunno what I'm doing wrong...guess I'll resort to learning C.