lep / jassdoc

Document the WarCraft 3 API
52 stars 20 forks source link

SpecialEffect: clarify height reset for position changes #159

Closed Luashine closed 4 months ago

Luashine commented 4 months ago

Testing setup has got to be like that:

I suggest to start by spawning stuff on the slope/platforms becauase these give "nice" odd height values. Then set locations back and forth between other terrain heights. If you still get the spawning platform's odd value, then it was reset.

Tip: your testing map SHOULD start on either a +1 hill or -1 shallow water. Otherwise you'll get confused like I was that it resets to Z=0 (default flat surface).

Tested functions:

set height, set Z, set loc, set position (x,y,z), set special effect matrix, reset special effect matrix. Only the SetX, SetY, SetLoc functions needed corrections.

TLDR: there's no easy way to make a specialeffect adapt to a terrain elevation other than checking the terrain height yourself.