HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

ball location using sin cos, help pls

07-14-2006, 09:00 AM#1
JeffreyQ
how to make a dummy unit circle around the caster using sin cos?

What is the difference between setUnitPosition(), and setUnitPositionLoc()?
How to use them?
Are both of them include in GUI triggering?
07-14-2006, 09:17 AM#2
Jacek
x and y should be reals and you shouldn't convert them to Integer... as far as I remember, cos and sin make results between 0 and 1, so when converted to integer you get 0 or 1 and get bizarre results
07-14-2006, 09:35 AM#3
JeffreyQ
hm, i have change to question abit.
But what is the difference between using sin cos or by just using offset with radius and degree?

what is real and what is integer? whats thier differences?
07-14-2006, 09:55 AM#4
Blade.dk
Types
07-14-2006, 01:52 PM#5
JeffreyQ
nice ! thanks for all the help. I manage to understand all other question i asked before. thanks again.
07-14-2006, 02:54 PM#6
The)TideHunter(
Sine(Sin), Cosine(Cos) and Tangent(Tan) are ratio's.
They are to find mainly length's and angles.
You dont really need to know what they are to use them, just the correct calculation and you will be fine.

For example:

A polar offset

Collapse JASS:
    local real x = CurrentX + Distance * Cos(Angle * (3.14159/180.0))
    local real y = CurrentY + Distance * Sin(Angle * (3.14159/180.0))

I dont understand how the use the 180/PI and PI/180 for Degrees to radians and vis versa, but i know they work. Same with Sin and Cos, i dont know what their ratio's are, but again, they work.
07-14-2006, 03:48 PM#7
iNfraNe
It's easy, 1 radian is 1/(2pi) of the whole circle, cuz 2pi radians = the whole circle, so 2pi/360 = to go from radians to angle, = pi/180.
07-14-2006, 05:40 PM#8
JeffreyQ
thanks, now i understand after looking back my old maths book, and with the help of u all, i think i fully understand now. I will go test right away.

2 more questions:
1. When i set lightning effect, for example x unit to y unit. y unit is flying 400 height above train. But the lightning effect only goes under y, but not sticking to its body. How do i solve this?
If you don't understand, see the below attached pic, which highlighted that the lightning effect was sticking underneath the flying unit position. But not to its body.

2. Terrain Cliff 0 = ? Shallow water = -1?
Attached Images
File type: jpglightning effect.JPG (37.3 KB)
07-14-2006, 07:24 PM#9
The)TideHunter(
Use:

Collapse JASS:
native GetTerrainCliffLevel         takes real x, real y returns integer

As a Z value for:

Collapse JASS:
native AddLightningEx               takes string codeName, boolean checkVisibility, real x1, real y1, real z1, real x2, real y2, real z2 returns lightning
07-14-2006, 07:42 PM#10
BertTheJasser
Hmm, I saw a fix... let me think...
Oh in the spell Section "Cabalistic Combustion"

It uses a location, and checks the z of the terrain to get the correct additive amount to manage the perfect lightning point.