Actually, i know how to do it, but there's a problem: if i (Create [building] on (Unit position([another building]))), the newly created one's position doesn't match with the first one's, even despite their footprints are same. Quite weird, isn't it?
Sry for a noobish question, but is your listing from trigger GUI or from a script?
I haven't found a function which displays point's coordinates in both, anyway...
Finally, i believe that the error is hiding somewhere else, most likely in footprints...
(Looks like this thread is for misc dev subforum...)
in the trigger GUI there is a commands that return the X and Y coordinates from a point.
And also it could very well be due to the footprint of the first building.
The "create unit" function has some options at the end of it. click on the options and select "ignore placement". Otherwise it will offset the unit created. I'm willing to bet that will solve your problem.
In future though, if you come across a problem like this you need to isolate WHAT the problem ACTUALLY is.
for example you were having a problem with the line "if i (Create [building] on (Unit position([another building])))" but that is actually TWO things:
1) getting the location of an existing building and
2) creating a new building at a specific location
The very first thing you should be doing with a problem like this is isolating what the problem actually is like in the suggested post I made above.
Actually, i know how to do it, but there's a problem: if i (Create [building] on (Unit position([another building]))), the newly created one's position doesn't match with the first one's, even despite their footprints are same. Quite weird, isn't it?
I'm guessing you made a mistake somewhere. If you want help on how to go about debuging this I would try the following:
variable P <point>;
set variable P = position of [other building];
debug(text(X of P));
debug(text(Y of P));
create [building] at position P;
does the debug statement match what it should be? can you check the position of the unit in the map editor?
@finiteturtles: Go
Sry for a noobish question, but is your listing from trigger GUI or from a script? I haven't found a function which displays point's coordinates in both, anyway... Finally, i believe that the error is hiding somewhere else, most likely in footprints... (Looks like this thread is for misc dev subforum...)
in the trigger GUI there is a commands that return the X and Y coordinates from a point.
And also it could very well be due to the footprint of the first building.
The "create unit" function has some options at the end of it. click on the options and select "ignore placement". Otherwise it will offset the unit created. I'm willing to bet that will solve your problem.
In future though, if you come across a problem like this you need to isolate WHAT the problem ACTUALLY is.
for example you were having a problem with the line "if i (Create [building] on (Unit position([another building])))" but that is actually TWO things:
1) getting the location of an existing building and
2) creating a new building at a specific location
The very first thing you should be doing with a problem like this is isolating what the problem actually is like in the suggested post I made above.
@finiteturtles: Go
YEAH!!! IT WORKS!!! Raised ur reputation by 2 man))) Thx, and thx again!!!
@FunBotan: Go
You would use .... point = Position of Unit(unit you want the position of)
.... why are you not using morphs.... from data?
@SouLCarveRR: Go
Morphs... Sry, but i've already made this working in other way. Thx anyway.