about global code function...

Game Editor comments and discussion.

about global code function...

Postby linjichao » Wed Feb 03, 2010 11:34 am

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...
linjichao
 
Posts: 35
Joined: Fri Jan 22, 2010 10:13 am
Score: 0 Give a positive score

Re: about global code function...

Postby makslane » Wed Feb 03, 2010 2:46 pm

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");
Game Editor is an open source game creator software that's wants to pay it's developers to keep evolving.
If you like Game Editor, make a review!
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to GE - General

Who is online

Users browsing this forum: No registered users and 1 guest

cron