A text cannot be in an action. A text is like a function in terms of how it is placed:

Code:

var my_var = 2; // a variable declaration
string my_string = <filename.tga>; // file name string declaration
string another_string = "I'm a nice string, ain't I?"; // declares a string with content in quotes

text textobject
{
// definition of text object
}

panel mypanel
{
// panel definitions
}

action my_action
{
while(1)
{
// code for a loop
textobject.string = "I'm now a changed string!"; // semicolon at end of a statement
mypanel.pos_y = 5+(2*my_var); // some screwy simple formula
}
// action code - no text objects, panels, etc. in here, just plain code (and function calls)
}

function my_function (parameter1, parameter2)
{
if (parameter1 == 3)
{
my_var = 5; // set only if the condition is true
}

if ((parameter1 !=3) && ((parameter1 <= 5) || (parameter2 > 6))) // complex statement
{
my_var += parameter1/3;
}
}

function main()
{
// the main function and it's code. I use it to get core components working and running.
my_function(3, 8);
}



This is the structure in a very simple manner to help explain. I'm commenting out notes which leave blank functions with nothing in them. I'm doing this to help explain. This is nothing compared to my 2D game's script which has over 22,000 lines (likely to reach or pass 30,000 by the time it's done)....


"You level up the fastest and easiest if you do things at your own level and no higher or lower" - useful tip My 2D game - release on Jun 13th; My tutorials