ID:163010
![]() Oct 25 2007, 11:23 am
|
|
Ok, I have a var, called Locations="100,200,3", now, I have an obj, called A, and I need to somehow place A at 100,200,3 using only the info in the Locations var, something like A.loc=locate(Locations), although that example doesnt work for some reason, is there any way you know of to do this? And yes it -has- to be done with a text string.
|
Dragonn wrote:
Ok, I have a var, called Locations="100,200,3", now, I have an obj, called A, and I need to somehow place A at 100,200,3 using only the info in the Locations var, something like A.loc=locate(Locations), although that example doesnt work for some reason, is there any way you know of to do this? And yes it -has- to be done with a text string. The locate() procedure can only get x,y,z values as numerical arguments. What this means is you need to find a way to convert your string of coordinates into numerical values. But before you do that you need to separate the values in the string. http://developer.byond.com/hub/Deadron/TextHandling is a good resource for this job. Right after you include the lib into your project, you use the dd_text2list(text, separator) function in the lib. var/Coord = "100,200,3" I'm pretty sure this is not the best code to use in your own code. It's just an example of how it could be done. I hope it provides some insight. |
Actually no I cant, because the reason I need it is so I can save every thing on the map as text then restore it later from the text. But that other guys response probably solved it.
|
You could either make three seperate vars, or use a locate() in the var.