Expecting endifs?

D.V.D

Make a wish
Reaction score
73
Forgot to mention, your supposed to press the left arrow key for it to start. Don't move songoku when he starts it or it will look really bad.
 

wraithseeker

Tired.
Reaction score
122
Nothing appeared anyway.... Also I don't get why you are making ur code so long with the BJS and stuff , right now you should go and clean up your code with the CreateUnit native and removing the pause unit. Is all that TriggerSleepAction needed? I personally don't use them much.

JASS:
set Laser[GetForLoopIndexA()] = null


?? I don't understand that, Is it

JASS:
set Laser<i> = null</i>
 

D.V.D

Make a wish
Reaction score
73
It could be Laser. Im not using CreateUnit because I have absolutley no clue how X/Y's work. I don't have too much BJ's just the CreateUnit's. Unless there's a tutorial on using X/Y's I will probably never use them. Im using those waits and stuff so the spell looks like the actual spellfrom DBZ.
 

wraithseeker

Tired.
Reaction score
122
Ok I assume that you don't have primary school level math , you ever heard of graphs?

There is the x and y axis and the warcraft map is just a whole pile of graph, you use X and Y to get the location of the unit simple.
 

D.V.D

Make a wish
Reaction score
73
I understand that, but I how do you figure out the X/Y of any unit and stuff like that? How do yuo make offsets with X/Y's? I don't know any X/Y calls.
 

Romek

Super Moderator
Reaction score
963
> but I how do you figure out the X/Y of any unit and stuff like that?
JASS:


> How do yuo make offsets with X/Y's?
JASS:
GetUnitX(u) + 50
GetUnitY(u) + 50


Or, for offsets to a direction:
JASS:
x + (distance) * Cos(angle)
y + (distance) * Sin(angle)

With x/y being the position of the unit.
 

D.V.D

Make a wish
Reaction score
73
You see, I don't know Cos or Sin, im still in grade 8. And is the distance measured the same as points in pixels?
 

Romek

Super Moderator
Reaction score
963
> im still in grade 8.
I'm about the same age as you then. So don't use that as an excuse.

> And is the distance measured the same as points in pixels?
No. It's just it's the games own measurement. I don't even think it has a name.
 

D.V.D

Make a wish
Reaction score
73
Could you tell me what Sin and Cos is? Im saying Im in grade 8 because Sin and Cos is learned at like grade 10.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
You don't even have to know what they are to use them.
Cos goes with X, Sin goes with Y;
That's all you really need to know.
 

WolfieeifloW

WEHZ Helper
Reaction score
372
No, Cos corresponds to X, while Sin corresponds to Y.

I don't know what Sin nor Cos do, but I still use them.
 

D.V.D

Make a wish
Reaction score
73
How? You just multiply them with the angle? And is there a native polarprojection.
 

Flare

Stops copies me!
Reaction score
662
How? You just multiply them with the angle? And is there a native polarprojection.
You get the Cos (for offsetting X) and Sin (for offsetting Y) value of your angle*, and multiply it by your offset distance. Then, add the resultant values to the coordinates you are offsetting e.g.
JASS:
local real x1 = GetUnitX (caster)
local real y1 = GetUnitY (caster)
local real x2 = x1 + Cos (someAngle) * offsetDistance
local real y2 = y1 + Sin (someAngle) * offsetDistance
call SetUnitPosition (caster, x2, y2) //for example


*Cos/Sin take the angle in radians - most native functions that deal with angles return the angle in radians, apart from GetUnitFacing (that's the only one I know off the top of my head). If you were using GetUnitFacing as the offset angle, you would have to multiply it by bj_DEGTORAD e.g.
JASS:
local real angle = GetUnitFacing (caster) * bj_DEGTORAD
local real x2 = x1 + Cos (angle) * offset
local real y2 = y1 + Sin (angle) * offset

Although, for most targeted spells, you will be using Atan2, which returns the angle in radians - it's used like so
(if we wanted the angle from the caster towards a spell's target location)
JASS:
local real angle = Atan2 (GetLocationY (targetLoc) - GetUnitY (caster), GetLocationX (targetLoc) - GetUnitX (caster))
local real x2 = x1 + Cos (angle) * offset
local real y2 = y1 + Sin (angle) * offset
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top