olseric 0 Posted July 16, 2004 I need an expert opinion on this one. I'm trying to make targets randomly pop-up in a given time frame...in short, the problem that I'm having is the script won't acknowledge the dynamically generated object names. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">target1 setdammage 0.8 Will work just fine...but... <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_targetname = target1 _targetname setdammage 0.8 Will not work at all. Suggestions? Â Ideas? Â I think the easy way would be to get the now string value variable converted back to an object, however, I can't seem to figure out how. Â Furthermore, I have already considered passing an array to it, however, I want to somehow "short form" this. Thanks for your help in advance. Share this post Link to post Share on other sites
CrashnBurn 0 Posted July 16, 2004 "targetname" could be a reserved variable. Give it a different name and try again. Share this post Link to post Share on other sites
olseric 0 Posted July 16, 2004 Okay, tried that, no avail. I should add this. The error that I'm getting is an "Object Expected, Sting Presented" one. Basically, what I'm doing to create the random object selector is taking a number and slapping it on the end of target using the format command...i.e. <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_thistarget = format ["target%1",_number]; Apparently, this is causing it to be treated as a string. So, the question of the day is, is there some way to change the variable type? Or, is there a way to join two variables to achieve my overall goal here? Share this post Link to post Share on other sites
MrZig 0 Posted July 16, 2004 Hmm try <table border="0" align="center" width="95%" cellpadding="0" cellspacing="0"><tr><td>Code Sample </td></tr><tr><td id="CODE">_thistarget = call format ["target%1",_number]; Share this post Link to post Share on other sites