• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

Knockback Unit

Level 3
Joined
Sep 4, 2007
Messages
49
Yeah newgen is not available on Mac, unfortunatley cross platforming might be prove to be easier said then done, because some of the methods NewGen uses to patch Wc3 involve assembler not just c/c++ which on Mac would take a decent amount of time to do
 
Level 3
Joined
Sep 4, 2007
Messages
49
There is a mac mpq reader, its just all the mpq reader progs for windows use SF's one so jassnewgen would still require hefty recoding

On topic with the knockback functions, you should probably make the angle argument in degrees and not radians (its just a simple conversion anyways). A lot more people are fimilar with degrees, especially since all the GUI functions return and need angles in degrees
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
Ugh, radians are given way more often in JASS; converting to degrees and back again isn't really worth it imo.

People using GUI can always multiply by bj_DEGTORAD.

But seriously, Atan2 returns radians (which you'll probably be using the most) plus it's just as easy to type the angles in radians.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
GUI users probably won't use this function (at least most of them), I can add the instructions of using the function when you have degrees, if you want.

All JASSers should use radians all the time (except SetUnitFacing/GetUnitFacing and maybe some more), bj_DEGTORAD/bj_RADTODEG-ing all the time can be really annoying.
 
Level 3
Joined
Sep 4, 2007
Messages
49
Its not for me, I use radians whenever possible. Its that other people try to use degrees as much as possible, and its what everyone is familair with (where as not that many people are familiar with radians). You just need to add a simple line anyways, andle * bj_DEGTORAD

But yeah its your choice, you should mention then how to convert to radians for people that don't know
 
Level 3
Joined
Sep 4, 2007
Messages
49
You would seriously be suprised at some of the people u find complaining about functions not working, some people still program in degrees and know JASS well
 
Level 3
Joined
Sep 4, 2007
Messages
49
Except that fact that all GUI functions return in degrees and not radians, you can blame blizzard for that and not me
 
Level 3
Joined
Sep 4, 2007
Messages
49
Look what I was basically trying to say that since 90% of jassers move from GUI to JASS, they still get stuck into using degrees (even though its faster using radians). This and also a lot more people understand degrees then radians, especially since in my school we only learn about radiancs (for advanced maths) in the last year of school (i do extension so I learnt it one year earlier)
 
Level 3
Joined
Sep 4, 2007
Messages
49
True but degrees and radians are just 2 different ways of expressing angles, where as locations are plain stupid because they are handles that are only used to store 2 real values.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
I didn't understand radians either (haven't learned them in school, just recently did) when I was using radians. I was just thinking of the as another way to express an angle, I didn't have to know what they were and how are they written.

I started using radians pretty quick, and I think most JASSers do. When you're using natives (except that darn CreateUnit crap) like Atan2, you kinda don't have a choice anymore.

About locations.......they truly are stupid, some people actually post jass codes (in wc3jass scripts) which use locations. Seeing locations and all those PolarProjectionBJ leaks....... that really hurts my eyes.
 
Level 40
Joined
Dec 14, 2005
Messages
10,532
True but degrees and radians are just 2 different ways of expressing angles, where as locations are plain stupid because they are handles that are only used to store 2 real values.
All angular math uses radians only (or is dual compatible, in basic cases like complimentary angles), so Degrees are the "locations" of angles.

I didn't understand radians either (haven't learned them in school, just recently did) when I was using radians. I was just thinking of the as another way to express an angle, I didn't have to know what they were and how are they written.
If I catch you on MSN some time, I'll explain them fully to you ;)
 
Level 3
Joined
Sep 4, 2007
Messages
49
I know what radians are
The reason why radians are used instead of degrees is because they can easily be compared with our arabic number system. I mean 360 degrees makes a circle, thats fantastic but what happens if we want to compare degrees to lets say 3 or 4, how the hell would you relate that, its like comparing apples to oranges it just doesnt work

So the fundamental of radians is that when you use the rule for circumference of a circle, 2 *pi * r = 360. However if we assume r = 1 (since the radius of a circle has no effect on the angle inside), 2 * pi = 360 so pi = 180/2. So to convert from degrees to radians you times the degree by pi/360. If you want to convert radians to degrees you times the radian by 180/pi.

This is the same reason why programming languages always use radians and if you specify a degree the program (or you yourself) has to convert it to radians.

What you need to remember is that radians is an alternate form of degrees, for example sine of 30 degrees is 0.5, and therefore sine of pi/6 is also 0.5. So in other words if you use blizzards trig functions you must use radians if you work with the straight natives, you will notice that every premade blizzard functions for trig convert any degree you input into radianse (like if you use GUI for example). Thats the same reason why u get something like 1000000000 thats cos ur supposed to input pi instead of 180 (which makes a big difference)
from http://www.scumedit.net/forum/showpost.php?p=12198&postcount=18

Whats your MSN by the way?
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
PurplePoot said:
If I catch you on MSN some time, I'll explain them fully to you ;)

Silvenon said:
haven't learned them in school, just recently did

I don't think that would be necessary, I learned them recently (as I said), they are simple to understand. But it would be nice to see you on MSN some time (though I don't go there as often as I used to)
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
I just tested this........it's not working, I suppose no one knows why? If someone even used this function, why didn't anyone tell me? Oh, I know why, it's because of this update...... well I'm screwed now......I'll try to debug it.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
Modified the function a bit, added a new feature (read the "more fixes").

I haven't tested it so somebody PLEASE test this for me really quick? It's not supposed to have any errors since I was careful, but still.....

P.S. Will fix the Jump function soon too.
 

DKG

DKG

Level 3
Joined
Jan 29, 2008
Messages
54
Copied this into map, i get a syntax error on saving:

Line 179: expected "takes"

static method Knockback__Execute
 

DKG

DKG

Level 3
Joined
Jan 29, 2008
Messages
54
Still getting compile errors on saving :(

4 of them now, am i doing something wrong?

I can just CnP the code into an empty trigger right?
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
This recource is broken.

The script has a great big error in it. Did you not even check before you updated?

That's what I said in my last post, it doesn't make it any more true if you repeat it.

BoneBreaker said:
Change: private Data array Ar

Into: private integer array Ar

Hey! That's really useful, thank you so much!

EDIT: Btw, it was impossible to arrange them so the syntax is correct without BoneBreaker's advice.
 
Level 13
Joined
Nov 22, 2006
Messages
1,260
I know that structs are integers, thanks guys.

Well, a birdy told me that everything works fine now, lets just hope......

The only reason I used that method (without thinking) is because Vex did it in his tutorial, it's funny how he always teaches me wrong things..... :)
 

DKG

DKG

Level 3
Joined
Jan 29, 2008
Messages
54
Is there a way to prevent knocked units from sliding up over cliffs?
 
Top