Yeah, the account was nthl0gik. I was helping you with save/load stuff. And yeah, round is one of those functions that converts floats and doubles to ints. Usually though I'd suggest floor over round though, as that keeps the indexing starting from 0. Anyway, if you wanted to make a text actor display a random number, you can do this.
text_actor -> Key Down Enter (repeat disabled) -> Script Editor
- Code: Select all
int random = rand(256);
textNumber=random;
Of course you can also use text instead of textNumber, that way you can prefix it with something.
- Code: Select all
int random = floor(rand(256));
sprintf(text, "random: %d", random);
And in these examples I stored the random value into a variable, as chances are you want to do more than just one thing with it. But, if for some reason you only needed it once, you could just replace the variable name with floor(rand(256)).