char text[MAX_SCRIPTTEXT];

Non-platform specific questions.

char text[MAX_SCRIPTTEXT];

Postby Just4Fun » Wed May 05, 2004 4:07 pm

How does one interpret all/any of the listed C script functions in GE?

For example:
char text[MAX_SCRIPTTEXT];
or this:
char name[ACTOR_NAME];

or better yet:
How do we come up with proper interpretations of this stuff for GE?


From this: char *strcpy(char * dst, const char * src)
To this: strcpy(MyActor.text,"Hello World.");

There must be some kind of pattern or system to using/translating these functions in GE, but I can't see it. :(

My numerous C language books don't seem to make things any clearer when applying this stuff to GE.

At this point, I am trying to go through the script docs and get some working knowledge of how each function works and how to call each function in GE. As usual... TIA
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby makslane » Thu May 06, 2004 1:38 pm

text[MAX_SCRIPTTEXT] is a C string with a maximum of
MAX_SCRIPTTEXT characters (256 characters)

name[ACTOR_NAME] is a C string with a maximum of ACTOR_NAME characters (32 characters)


If your actor MyActor has a text set in Actor Control, you can use

strcpy(MyActor.text,"Hello World.");

To change the text to "Hello World."
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score

Postby Just4Fun » Thu May 06, 2004 3:22 pm

Thank you, Makslane,

I *think* I understand what the actual C script is doing from my C language books....but,

how is the C script for GE interpreted into GE syntax?

I understand how to use strcpy syntax now, thanks to Jazz-e-Bob's posting....but

How do I interpret the other C language script into GE syntax?

For example:

is name[Actor] called in GE using ("MyActor") in GE syntax?

is text[MAX_SCRIPTTEXT] called using MyActor.text(20)? in GE syntax


I'm looking for help for the conversion from the C script listed in the GE docs to GE script syntax...


For Example,
What is the syntax for these"[]" in GE script? Do they = "()" in GE?

What is the syntax for "text[]" in GE script? Is text= ".text()" or ".text[]" in GE?

Maybe I'm missing the point err here? and...probably giving everyone else a headache... :?
I've learned that I still have a lot to learn.

** Makslane == Genious **
Just4Fun
 
Posts: 524
Joined: Tue Jul 01, 2003 5:19 am
Location: USA: Washington State; West Coast
Score: 6 Give a positive score

Postby makslane » Fri May 07, 2004 12:26 pm

> how is the C script for GE interpreted into GE syntax?
There is no GE sintax, but a C syntax into GE

> MyActor.text(20)?
This make no sense :-(


forget [] in the text vars. Simply, use:

text to access "Event Actor" text
YourActor.text to access the text of YourActor actor
makslane
Site Admin
 
Posts: 3947
Joined: Sat Apr 05, 2003 6:47 pm
Score: 182 Give a positive score


Return to General

Who is online

Users browsing this forum: No registered users and 1 guest