I now notice why?/how? you love maths... but...

The perfect one step solution for creating Ice/Sliding Mazes in both Reign of Chaos and The Frozen Throne. It is the only decent system around and it even works in RoC, is lagfree, perfectly optimized, fast and reliable. The included TerrainKill feature frees you from the tedious task of creating a thousand kill-regions.
User avatar
manstie
Posts: 310
Joined: Wed Jun 17, 2009 9:27 am
Account: manstie
Location: Perth, Australia
Contact:

I now notice why?/how? you love maths... but...

Unread post by manstie »

Hello...
Just came back to post something...
I'm recently learning about using Sine, Cosine and Tangent, but I have no idea where people would use it in life... I guess I was partially wrong :roll:
I noticed that you used *Cos(0.017453278*GetUnitFacing(u) and *Sin(0.017453278*GetUnitFacing
I'd like to know, how did you get 0.017453278?

I'd also like to know what is Atan2? (In "Information for Dummies" talk)



And is there a way to increase the turn speed of your system (It won't turn any faster from like... 0.5 turning speed to 1 turning speed).
Image

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: I now notice why?/how? you love maths... but...

Unread post by 3ICE »

0.017453278 is a magic constant: π/180 Pi/180 is used for converting degrees (°) to radians ().

Computer games need a lot of trigonometry for distance calculations, collision detection, etc. A secretary or a lawyer will never need Sine, Cosine, or Tangent, but a programmer needs this stuff for sure.

Atan2 is on wikipedia. The first paragraph tells you everything you need to know about it. (takes two arguments, x and y, then in a coordinate system calculates the angle between the X axis and the (x;y) point and returns it in radians. I'd draw your a picture, but I'm 5$ not 10$ motivated 15$ enough 20$.

I have nothing on how to make them turn faster. I think all sliding maps have this problem. If you know of any map (protection isn't a problem) that has quicker turns on ice, I'd love to steal that and implement it into my system as a new variable (udg_TurningSpeed).
ImageImageImageImageImage
Image
ImageImage

samtre
Posts: 82
Joined: Thu Nov 27, 2008 6:43 am

Re: I now notice why?/how? you love maths... but...

Unread post by samtre »

the most thing a lot of warcraft map makers have in common is MATH!

it seems it's an addiction as they make systems and custom abilities....i still don't know how to use JASS, but i am able to make JASS spells using gui but with a lot of equations...
i still don't know how to use the other 'Math - ' actions.....

can't you try something like " call SetUnitFacing( GetEnumUnit(), ( GetUnitFacing(GetEnumUnit()) + udg_TurningSpeed ))"?
i tried this thing on my own maps and worked okay, i just removed the "Timed" before "SetUnitFacing" and ", 0.00 " before "udg_TurningSpeed )) ", i've never tried using in on your map..... don't dare to.

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: I now notice why?/how? you love maths... but...

Unread post by 3ICE »

I am already using that*, but it is no good.

*=call SetUnitFacing(u,57.295828*Atan2(GetLocationY(p)-y,GetLocationX(p)-x))

Btw what you have there would spin the unit like crazy, making the player feel slightly out of control :P
ImageImageImageImageImage
Image
ImageImage

User avatar
manstie
Posts: 310
Joined: Wed Jun 17, 2009 9:27 am
Account: manstie
Location: Perth, Australia
Contact:

Re: I now notice why?/how? you love maths... but...

Unread post by manstie »

Yeah...
A map with a faster turn speed (I think, pretty sure the triggers make them turn a bit faster) is Area of Ice Escape 4. (I noticed in Area of Ice Escape 1 that the turn speed wasn't as fast as #4.)
I was thinking - Wouldn't it be impossible to change the turn speed without a trigger that sets a unit's facing point instantly?

I just thought of another thing - Maybe you could do a custom thing to unit facing degreese, and don't use that at all, but use a real value to replace Unit facing degreese, and just make the unit face degreese for show :)
Image

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: I now notice why?/how? you love maths... but...

Unread post by 3ICE »

You make absolutely no sense. SetUnitFacing is the function that sets the unit's facing "instantly". If only it did...
ImageImageImageImageImage
Image
ImageImage

samtre
Posts: 82
Joined: Thu Nov 27, 2008 6:43 am

Re: I now notice why?/how? you love maths... but...

Unread post by samtre »

i think he meant by as you order a unit to move(slide) to a point, instantly changes the unit facing from the unit's position to the point

or

it is just what i said

or
Wouldn't it be impossible to change the turn speed without a trigger that sets a unit's facing point instantly?
i just think of this as
Would it be possible
,
maybe just by changing the unit's turning speed, i remembered you(3ICE) said that your Steer trigger is somehow based on the unit's turning speed

and at the last sentence, why make a custom trigger for unit's facing degrees that we don't use at all? unit's facing degrees uses Real

User avatar
manstie
Posts: 310
Joined: Wed Jun 17, 2009 9:27 am
Account: manstie
Location: Perth, Australia
Contact:

Re: I now notice why?/how? you love maths... but...

Unread post by manstie »

samtre wrote:i think he meant by as you order a unit to move(slide) to a point, instantly changes the unit facing from the unit's position to the point

or

it is just what i said

or
Wouldn't it be impossible to change the turn speed without a trigger that sets a unit's facing point instantly?
i just think of this as
Would it be possible
,
maybe just by changing the unit's turning speed, i remembered you(3ICE) said that your Steer trigger is somehow based on the unit's turning speed

and at the last sentence, why make a custom trigger for unit's facing degrees that we don't use at all? unit's facing degrees uses Real
But with that real, you can't set it instantly to something else, it eases into the direction. So if you make a custom variable and change that, it's instant.
Image

samtre
Posts: 82
Joined: Thu Nov 27, 2008 6:43 am

Re: I now notice why?/how? you love maths... but...

Unread post by samtre »

How about Unit - Move Unit instantly and Face Angle?
this might be dumb.........
you can't use any abilities though.

User avatar
3ICE
Admin
Posts: 2629
Joined: Sat Mar 01, 2008 11:34 pm
Realm: Europe
Account: 3ICE
Clan: 3ICE
Location: Hungary
Contact:

Re: I now notice why?/how? you love maths... but...

Unread post by 3ICE »

This is making less and less sense the deeper we go into it. Especially because you guys keep suggesting things I already use.

EDIT: It would have been great to have this discussion in two separate topics:
I now notice why?/how? you love maths and How to make sliding units turn faster?
ImageImageImageImageImage
Image
ImageImage

Post Reply

Who is online

Users browsing this forum: No registered users and 17 guests