Wondering .. is it common that people write at their own visitor page to answer some post from someone else? I've seen that many time now ^^
Well as I said, I solved the dummy moving problem I had and I just wanna say what was wrong (you don't mind it anyway ._.):
That was what I used all the time:
set .f = bj_DEGTORAD * Atan2(.y - GetUnitY(.caster),.x - GetUnitX(.caster))
set .dummy = CreateUnit(GetOwningPlayer(.caster),DUMMY_ID,GetUnitX(.caster),GetUnitY(.caster),.f)
// and for the move I did that:
local real x = GetUnitX(.dummy)
local real y = GetUnitY(.dummy)
local real dx = .x - x
local real dy = .y - y
if dx * dx + dy * dy > 100 then // speed * speed \\
set x = x + 10. * Cos(.f)
set y = y + 10. * Sin(.f)
call SetUnitX(.dummy,x)
call SetUnitY(.dummy,y)
So as you see my first mistake was using bj_DEGTORAD instead bj_RADTODEG. After I changed it the facing thing worked all the time, but the movement doesn't and I know now why, because Cos() and Sin() takes radians and I converted them to degrees and this messed up everything. Now I use it like this:
set .f = Atan2(.y - GetUnitY(.caster),.x - GetUnitX(.caster))
set .dummy = CreateUnit(GetOwningPlayer(.caster),DUMMY_ID,GetUnitX(.caster),GetUnitY(.caster),.f * bj_RADTODEG)
// and for the move I did that:
local real x = GetUnitX(.dummy)
local real y = GetUnitY(.dummy)
local real dx = .x - x
local real dy = .y - y
if dx * dx + dy * dy > 100 then // speed * speed \\
set x = x + 10. * Cos(.f)
set y = y + 10. * Sin(.f)
call SetUnitX(.dummy,x)
call SetUnitY(.dummy,y)
Yes I know I could delete the dx and dy local here and calculate it at once, but all in all this seems to be the easiest and fastest way for me, to make something move correctly =D
- As I just said, if my friend (watermelon1234) comes online, he knows what to do .. and as you see, hes just a genius
[-10 rep] Naja ich bin dann mal off für heut - gute nacht und bis später =) [/-10 rep]
Edit: Actually curse me for asking Ralle to increase the maximum signs of visitor messages from 1000 to 14999, now I can write all the day