• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!

Using camera yaw to rotate a unit / percents

Status
Not open for further replies.
Level 19
Joined
Aug 8, 2007
Messages
2,765
Hi,
is it possible to get the camera yaw function to rotate a unit?

also, is it possible to convert 2 numbers (like 260700 and 300000) into a percent with 2 decimals?
 
Level 19
Joined
Aug 8, 2007
Messages
2,765
#1: explain in more detail? not sure what you are saying.

#2: yeah, basic math.

n1/n2 *100 = percent.

1. like, if you move your cursor (disabled) to the right, the unit will turn clockwise and vice versa

2. my system would be using big, variable numbers and im afraid that it would turn out like 94.492819385983% as a string. can i just convert that to 94.49%?
 
Level 11
Joined
Aug 1, 2009
Messages
963
#1: well, make it so that the units facing is constantly set to the camera yaw.

#2: unfortunately, there doesn't seem to be a formatted real function anymore like there was in WC3, that allows you to define the number of decimals and shit.

you could do this:

n1/n2 *100 *100 = a real value
convert the real value to an integer, then back to real, then divide by 100.

should give you the right amount of decimal places.
 
Status
Not open for further replies.
Top