Page 1 of 1

about global code function...

PostPosted: Wed Feb 03, 2010 11:34 am
by linjichao
when i write a function, such as:
int returnString(char* str)
{
char ss[128];
strncpy(ss, str, strlen(str));
ss[128] = 0;
sprintf(text_actor.text, "%s", ss); // no functional, beacuse i can't see the text from text_actor

return 1;
}

// but i write in script code , it ok, why ?
have any body know? thanks...

Re: about global code function...

PostPosted: Wed Feb 03, 2010 2:46 pm
by makslane
You need to put a "reference" to the actor you are changing in the Global code in the calling event.
For example:

Code: Select all
//text_actor
returnString("ok");