Page 1 of 1

Strcpy in global code?

PostPosted: Thu Jun 08, 2006 6:01 pm
by Novice
Hi,
im trying to make a function that uses strcpy to display text on a text actor, but for some reason it refuses to work :? . So i shoretened it to a minimum, but it still wont work. I've tried every type of function but it's all the same. It seems that strcpy wont work from global script editor to display text.
Code: Select all
void say()
{
strcpy(txt.text, "Hello");
}

and
Code: Select all
char *say()
{
  strcpy(txt.text, "hello");

 return NULL;
}

and other things.
Can someone tell me the right syntax for this, i've read all topics containing "strcpy" but no luck.
TIA

PostPosted: Thu Jun 08, 2006 6:11 pm
by makslane
The problem is nor strcpy, but you try change actors variables in a global code. To works, you need put some reference to used actors in the caller script. If you are using the txt actor, you need use this actor in the caller script, evn in a comment, like this:

//txt <- Your reference
say();

PostPosted: Thu Jun 08, 2006 7:21 pm
by Novice
Thanks it works perfectly! :mrgreen: