Page 1 of 1

Can I change the value of a text actor dependant on...

PostPosted: Thu Jan 05, 2006 8:09 pm
by CGameMaker
Hi.

I've got a problem. I've got this cool game I'm working on, but I need it so that at the end, on the appropriate "Game Over" screen, it says a different thing dependant on the Score and Level the player reached. These are determined by the numerical values of "score" and "levelno", respectively.

To sum it up, I want the value of a text actor to change when the "score" or "level" reaches a certain value. But this actor (which I have named "code") is not a number. How can I do this?

I have tried the following code, but it doesn't seem to work, so I need to know if there is another way. Thanks!

Code: Select all
if(levelno.textNumber > 2 && score.textNumber > 2119)
{
    code.text == "COMPLETION CODE";
}
else if(levelno.textNumber < 2)
 {
     code.text == "EXAMPLE TEXT 1";
 }
else if(levelno.textNumber == 2)
{
    code.text == "EXAMPLE TEXT 2";
}
else if(levelno.textNumber > 2 && score.textNumber < 2120)
{
code.text == "EXAMPLE TEXT 3";
}
else
code.text == "";

PostPosted: Fri Jan 06, 2006 7:33 pm
by makslane
With strings, you must use the strcpy function to copy:

strcpy(code.text, "COMPLETION CODE");

PostPosted: Fri Jan 06, 2006 9:29 pm
by CGameMaker
*Laughs* So that's what strcopy() function is for! I heard people saying about itt, but I did not understand what it was. Thank you makslane.