(Oddly enough however, should I past the values through in actual numbers, they appear with no flaw or problem)Are you saying here that you are passing text to the locate() still? Make sure you are using text2num().
1
2
In response to YoukoSieg
|
|
YoukoSieg wrote:
|
Oh no, by that I meant if I placed "src.loc = locate(2,2,1)" it'd work [which is to be expected, yet baffles me as to why it wouldn't work with variables]. Not that I was still passing text.
|
Logical thinking should lead you to believe that if hard-coded numeric values work but variables don't, then those variables must not be holding numeric values.
|
But they are. If you haven't noticed, I've taken the values directly from the Building.x, Building.y, and Building.z. Those are normally numeric values, and I pass those values right into the New(), never once touching them / changing them.
|
I just scrolled back up. Why do you have brackets here?
src.loc = locate([X+2],[Y+2],[Z]) |
To add the change in locations by just a slightly different x and y, by adding the 2. Thinking it over now, I suppose it never really mattered, but I don't believe by having brackets, it would change the numeric value to a string/text value, would it?
|
Who knows. I've only really used brackets outside of strings to access list indices, so it may or may not work. Try it out, and maybe give X, Y, and Z a default value of 0 (Just so it knows that it is a number).
You should also really not use usr unless you have to. It can make things quite confusing later when you don't remember and have to search through the code to find what is calling New() to see what the usr is. |
Tried all of that and still no change. This is really baffling to me... I might just go about spawning this thing in a completely different way...
|
In response to YoukoSieg
|
|
YoukoSieg wrote:
> for(var/obj/Unit/U) You realize that this loops through every /obj/Unit that is created already, right? If you want to loop through every Unit that is coded in you need to use typesof(). |
1
2
Only two lines have changed [with some added debugging statements]: The call to the New() for /obj/Unit and the loc of a /obj/Unit upon creation.
Edit: My call to the Create_Unit() as below (if that helps any):
The above procedure itself is only called upon when a building is clicked.