invalid arguments in player_ctrl

Posted By: MaximilianPs

invalid arguments in player_ctrl - 05/28/09 16:16

i've made a panel where my text is scrolling via an ultra-elemental function. which copy a string to the next.

Code:
function logger(text)
{
	str_cpy(log_str1,"");		 // clear the string
	str_cpy(log_str1,log_str2);
	
	str_cpy(log_str2,""); 		// clear the string
	str_cpy(log_str2,log_str3);

	str_cpy(log_str3,""); 		// clear the string
	str_cpy(log_str3,log_str4);

	str_cpy(log_str4,""); 		// clear the string
	str_cpy(log_str4,text);
	wait(1);
}


the function will receive a string that will be copied to the line 4.
the problem is when the strings arent strings ! :-\

so my answare is: How can i brutally convert the value to a text that can be displayed ?

i mean, i wish to use some simply

logger("Erica say: hello");

but i can use also

logger(my.x);

i've tried something like
logger(str_cat_num(temp_str, "%.0f",my.x));

but the game give me the error:
invalid arguments in player_ctrl (which is the action that call the funcion)
frown
Posted By: Ottawa

Re: invalid arguments in player_ctrl - 05/29/09 00:46

Hi!

Have you explored

TEXT*

or

PANEL*

both of these will in some way place text and numbers on the screen.

Ottawa smile
Posted By: MaximilianPs

Re: invalid arguments in player_ctrl - 05/29/09 08:30

Yep, i've tested booth of them but the problem is
how to convert value to strings, 'cause this thing "logger(str_cat_num(temp_str, "%.0f",my.x));" generate an error
Posted By: EvilSOB

Re: invalid arguments in player_ctrl - 05/29/09 09:37

Couple of thing to try.
Code:
logger(_str(str_cat_num(temp_str, "%.0f", my.x)});

or

if you dont mind having to chop off or ignore a leading space
logger(str_cat_num(_str(" "), "%.0f", my.x));  
//the _str(" ") CANNOT change, must contain one space.

© 2024 lite-C Forums