I started off with a Mouse button down(left) event on the actors and typed in the code:
- Code: Select all
strcpy(txt.text, "This option has not been unlocked yet!");
txt.UserVar = 0;
Where UserVar is needed to tell me when 2.5 seconds have passed and the text will disappear.
However, I found out that I was using the above code a lot of times, just with different text. So I decided to write a function for the above code and call it up when I needed it.
I wrote:
- Code: Select all
void MakeText(char TxT)
{
strcpy(txt.text, "TxT");
txt.UserVar = 0;
}
in the global code, and GE accepts it just fine.
However, when I wrote
- Code: Select all
MakeText(This option has not been unlocked yet!);
in the original Mouse button down event, GE tells me "Error line 1: Undeclared identifier This"
What did I do wrong?