System GetShapePoint

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
Get Shape Point

this system is made to make things easier for all those who hate doing all this math\geometric stuff and to make it easy to use shapes when using it.

this system might look a bit complicated but it's only because i gave it wide sum of options so you could manipulate your shapes anyway you possibly could think of using my system and get what you ask for and after learning it i think you would find it very easy and useful.

k so first the system code:
JASS:
//==============================================================================================
//                            Get(Shape)Point System 
//
//                              Made by Doom-Angel
//==============================================================================================

//=========================== Descriptions and Instructions for each Shape ===========================

//===== Line ======
//***Description***: Takes two points to make a line between them and dividing that 
//line equally by distance to the amount sended in order to recieve from the function
//the desired point out of the divided line.
//======================
//***How to use***: call the function by using Custom script and entering the right values
//to get the required outcome - use this simple call for this function: 
//call GetLinePoint(Starting Point,Ending Point,Divided Part number(integer),Amount of division in line(integer))
//to get the points of the whole line just use Integer A loop(from 0 to divided amount) and place the integer A in the Divided part and you
//will receive each part of the line you just divided,also just to add to put 0 in the divided line part would return the starting point
//Note - asking for parts of the line higher than the amount divided would extend it beyond the size of the line (above the ending point).


//====== Triangle =======
//***Description***: Gets the point from triangle by taking the center point and creating a triangle
//around it toward facing value also takes position to return one of the edges in the 
//triangle - the 1st point is the edge point infront of the facing,the 2nd point is the edge point
//to the left of the facing and the 3rd point is the edge point to the right of the facing.
//===========================
//***How to use***: call the function by using Custom script and entering the right values
//to get the required outcome - use this simple call for this function: 
//call GetTrianglePoint(Center Point,Size of triangle(real),Facing(real),Edge Point - 1/2/3(integer))
//Note - to create a whole triangle just combine this function using the point edges recieved with the GetLinePoint function above.


//====== Rectangle ======
//***Description***: Gets the point from rectangle by taking the center point and creating a rectangle
//around it also takes position to return one of the edges in the rectangle - the 1st point is the 
//edge point from the upper left of the point received,the 2nd point is the edge point from 
//the upper right of the point received,the 3rd point is the edge point from the lower right of 
//the point received and the 4th point is the edge point from the lower left of the point received.
//===========================
//***How to use***: call the function by using Custom script and entering the right values
//to get the required outcome - use this simple call for this function: 
//call GetRectanglePoint(Center Point,Length of rectangle(real),Width of rectangle(real),Edge Point - 1/2/3/4(integer))
//Note - to create a whole rectangle just combine this function using the point edges recieved with the GetLinePoint function above.


//====== Circle ======
//***Description***: Gets the point from circle divided by the amount of value received and returns
//the number of part received in value(starts from the right of the center and continues by clockwise)
//the circle could be divided to any number above 0 and will be divided equally to return the needed
//point to form a circle the circle will also receive a radius to decide the size of it.
//===========================
//***How to use***: call the function by using Custom script and entering the right values
//to get the required outcome - use this simple call for this function: 
//call GetCirclePoint(Center Point,Radius(real),Divided Part number(integer),Amount of division in circle(integer))
//to get the points of the whole circle just use Integer A loop(from 1 to divided amount) and place 
//the integer A in the Divided part and you will receive each part of the circle you just divided.
//Note - asking for parts of the circle higher than the amount divided would just return the same points
//it would receive in lower numbers (since it's circling around).


//===========================  Definition Range   ===========================
//here i will post the Definition range for the values entered for each shape.
//why is this important?
//because giving an invalid value which is not under the definition range would mess the whole 
//function and therefore it would return you null point and will show you a warning messege.

//so here is the Definition Range for each function<img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" class="smilie smilie--sprite smilie--sprite3" alt=":(" title="Frown    :(" loading="lazy" data-shortname=":(" />avoid entering values which doesn&#039;t fit this range)
//Line:
//GetLinePoint(loc,target,position,amount)
// amount &gt; 0 // position &gt;= 0 (Greater or equal)

//Triangle:
//GetTrianglePoint(loc,distance,facing,position)
// distance &gt; 0 // 4 &gt; position &gt; 0 

//Rectangle:
//GetRectanglePoint(loc,length,width,position)
// length &gt; 0 // width &gt; 0// 5 &gt; position &gt; 0

//Circle:
//GetCirclePoint(loc,radius,position,amount)
// radius &gt; 0 // amount &gt; 0 // position &gt;= 0 (Greater or equal)

//just follow these value definition ranges and you won&#039;t get any errors.

//i hope you find this system useful and easy to use.
//Good Luck using it.
//All credits goes to Doom-Angel - if you use it give credit.


//If you don&#039;t know what you are doing don&#039;t touch anything from here on.
function GetLinePoint takes location loc,location target,integer position,integer amount returns location
    local real x = GetLocationX(loc)
    local real y = GetLocationY(loc)
    local real targetX = GetLocationX(target)
    local real targetY = GetLocationY(target)
    local real angle = Atan2(targetY - y, targetX - x)
    local real gap = SquareRoot(((targetX - x) * (targetX - x)) + ((targetY - y) * (targetY - y)))/amount
    if(amount &lt;= 0 or position &lt; 0) then
       call BJDebugMsg(&quot;Error: Invalid values received&quot;)
       return null
    endif
    set x = x + (gap*position) * Cos(angle)
    set y = y + (gap*position) * Sin(angle)
    return Location(x,y)
endfunction


function GetTrianglePoint takes location loc,real distance,real facing,integer position returns location
    local real x = GetLocationX(loc)
    local real y = GetLocationY(loc) 
    if(distance &lt;= 0 or position &lt; 1 or position &gt; 3) then
       call BJDebugMsg(&quot;Error: Invalid values received&quot;)
       return null
    endif
    set facing = bj_DEGTORAD * (facing + 120 * (position - 1))
    set x = x + distance * Cos(facing)
    set y = y + distance * Sin(facing)
    return Location(x,y)
endfunction


function GetRectanglePoint takes location loc,real length,real width,integer position returns location
    local real x = GetLocationX(loc)
    local real y = GetLocationY(loc) 
    local integer valueX = 1
    local integer valueY = 1
    if(length &lt;= 0 or width &lt;= 0 or position &lt; 1 or position &gt; 4) then
       call BJDebugMsg(&quot;Error: Invalid values received&quot;)
       return null
    endif
    if(position == 1 or position == 4) then
        set valueX = -1
    endif
    if(position == 3 or position == 4) then
        set valueY = -1
    endif
    set x = x + (valueX*(length/2))
    set y = y + (valueY*(width/2))
    return Location(x,y)
endfunction


function GetCirclePoint takes location loc,real radius,integer position,integer amount returns location
    local real x = GetLocationX(loc)
    local real y = GetLocationY(loc)
    if(radius &lt;= 0 or position &lt; 0 or amount &lt;= 0) then
       call BJDebugMsg(&quot;Error: Invalid values received&quot;)
       return null
    endif
    set position = ModuloInteger(position,amount+1)
    if(position == 0) then
        set position = 1
    endif
    set x = radius*Cos(I2R(position)/I2R(amount)*2*bj_PI) + x
    set y = radius*Sin(I2R(position)/I2R(amount)*2*bj_PI) + y
    return Location(x,y)
endfunction
i gave there some description and instruction about the system so if you get stuck just read it and im sure you will find an answer to your problem.

so first of all:

How do i implement the system in my map?
To implement this system just copy the code above and paste it to your map header.

Map header? what is that?
Map header is in the trigger editor and it's the map icon with map name.
in case still don't understand what im talking about just look at this picture:
mapheadereu7.jpg

Explanation on the different shapes and how they work
k so here i will show how each shape function is working and i think this is important to read this explanation before trying to work with them.

Line function
i bet most of you are already familiar with this one which is used alot: a simple stright line created from a starting point and reaching an ending point.

so first all a bit of description:
Gets the points from line(which is based of starting and ending points) which is divided equally by distance to the amount sended to the function and returns the desired point out of the divided line.

so as far as you see taking a line and giving it amount of 10 will split it in 10 equal pieces and should be something like that:
lineexamplezc3.jpg

didn't came out accurate but it gives the main idea - as you see asking for the 0 part in this divided line will give us the starting point while 10 gives the ending point and 5 gives the middle one - using all this point you could form a line or half a line or whatever you like to form in this line.

another thing to add is that you can ask for parts which are above amount of the divided line parts for exampe - we divided the line to 10 parts and asked for the 15th part - this will give us a point which is beyond the ending point and would help us forum a line which is 150% bigger than the distance beetwen the the points - that way you could perform lines which are 2 or 3 times bigger as you wish.

and here's a sample picture of the line in work(splited to 10 and receives parts 1 to 10):
linewy8.jpg

Triangle function
Description: Gets the point from triangle by taking the center point and creating a triangle around it toward facing value also takes position and returns the edges of the triangle - the 1st point is the edge point infront of the facing,the 2nd point is the edge point to the left of the facing and the 3rd point is the edge point to the right of the facing.

with this function you could receive the points of the triangle edges within a distance value and change it's rotation towards the chosen facing.

here's an image which would explain how it should be:
triangleexamplepz0.jpg

another bad image made by me :p - anyway as you see this demonstrated which point is returned for each part.

another thing you might have noticed is that you got only 3 edges and you probably asking how is that giving me a triangle - well the answer is that having this edges basically gave you the base for the triangle and the only thing needs to be done now in order to get a full triangle is using the edged points you received from this function and use them with the line function for each point to another(1-2,2-3,3-1) and there you got a whole triangle.

here's a sample picture of the triangle in work:
triangleig8.jpg
oh and another nice thing i made using triangles :cool::
starofdavidpr2.jpg

Rectangle function
for some of you this function is gonna look a bit useless since you could do the same using rects but i thought making it anyway and also the fact that this function doedn't create a rect i think it should be easier and more useful.

Description: Gets the point from rectangle by taking the center point and creating a rectangle around it also takes position and returns the edges of the rectangle - the 1st point is the edge point from the upper left of the point received,the 2nd point is the edge point from the upper right of the point received,the 3rd point is the edge point from the lower right of the point received and the 4th point is the edge point from the lower left of the point received.

so this function would require basically length width center point and the position of the edge you need.
if you didn't understand the description try checking this picture:
rectangleexamplepo1.jpg

as you see after sending the center point length(200) and width(100) the only thing left to send is the position which will return one of the numbered edges depending on the number you sent.

also for those who don't know giving the function an matching value for the length and width will form a square instead. (e.g: length = 200,width = 200)

and another thing to add here is that here as same as the triangle in order to form a full rectangle you would have to combine this function with the line function.

here's a sample picture of the rectangle in work:
rectangleqp8.jpg

Circle function
Description: Gets the point from circle divided by the amount of value received and returns the number of part received in value(starts from the right of the center and continues by clockwise) the circle could be divided to any number above 0 and will be divided equally to return the needed point to form a circle the circle will also receive a radius to decide the size of it.

so now that you read the description i will show in picture how it works and splits up:
circleexmpleeh1.jpg

in the above picture you 3 same sized circles each one splited intro 2,3 and 4 parts each while the point in position 1 will always starts from the right spot as you see the rest of the points in this circle will be going one after each other in clockwise direction.
also notice i marked the Radius so you notice the radius is the value that will decide how big the circle would be from the center point you have sent.
this circle function can split a circle from 1 part to endless amounts of parts (though i do not recommend using high amounts of parts since it might cause lag depending on your actions)

another thing to your attention is what if you entered a value of a position higher the number of parts you splited?
well in that case it will just go on since it's a circle the points splited will keep rolling around so basically a 5 position in a 4 parts splited circle will return the 1st part and the 6th will return the 2nd and so on.

here's a sample picture of the circle in work:
circlemz9.jpg
How do i use these functions in my trigger?
to call those function from a GUI trigger open a "Custom script" action and in it you have to write these lines for each function:

Line
JASS:
set udg_PointVariable = GetLinePoint(Start_Point(point),End_Point(point),which part(integer),line amount of division(integer))

of course what i gave you won't actually run and it only tells you what values you need to enter on the needed spots i also made in brackets the value type required.

here's an example for working function call:
Code:
Custom script:   set udg_TestLoc = GetLinePoint(udg_Loc,udg_TargetLoc,bj_forLoopAIndex,10)

Triangle
JASS:
set udg_PointVariable = GetTrianglePoint(Center_Point(point),Size/Distance from center(real),Facing(real),which edge(integer))

same here as above this won't run either and it's just to tell you what values to insert

here's an example for working function call:
Code:
Custom script:   set udg_TestLoc  = GetTrianglePoint(udg_Loc,500,90,bj_forLoopAIndex)

Rectangle
JASS:
set udg_PointVariable = GetRectanglePoint(Center_Point(point),Length(real),Width(real),which edge(integer))

same here as above this won't run either and it's just to tell you what values to insert

here's an example for working function call:
Code:
Custom script:   set udg_TestLoc  = GetRectanglePoint(udg_Loc,300,200,bj_forLoopAIndex)

Circle
JASS:
set udg_PointVariable = GetCirclePoint(Center_Point(point),Radius(real),which part(integer),circle amount of division(integer))

same here as above this won't run either and it's just to tell you what values to insert

here's an example for working function call:
Code:
Custom script:   set udg_TestLoc = GetCirclePoint(udg_Loc,400,bj_forLoopAIndex,10)

for those who don't know how to use variables in this Jass calls just simply add "udg_" prefix to your variable name.
for exmple if i have an integer variable named Count and i wanna send it as a value to one of the function i would have wrote in: "udg_Count" (also remember it's case-sensitive so it must be Count and not count).


Definition Range
this part here is to give you heads up for what values you may never use in this functions.
when using those "out of definition range" values you will just receive error messege and receive a null point since the function isn't able to deal with values for example like negative numbers or others so im gonna right for each function what values are in your definition range and are allowed to be used in those functions:

Line:
function:
JASS:
GetLinePoint(loc,target,position,amount)

Definition Range:
amount > 0
position >= 0 (Greater or equal)

Triangle:
function:
JASS:
GetTrianglePoint(loc,distance,facing,position)

Definition Range:
distance > 0
4 > position > 0

Rectangle:
function:
JASS:
GetRectanglePoint(loc,length,width,position)

Definition Range:
length > 0
width > 0
5 > position > 0

Circle:
function:
JASS:
GetCirclePoint(loc,radius,position,amount)

Definition Range:
radius > 0
amount > 0
position > 0

if any of your values isn't in the ranges i just gave above expect for an error.
also in case any of you wonder if a value from a function isn't listed above in the definition range it means that you may enter any value you want.

Change Log:
  • Made the comments easier to read and a bit smaller
  • removed parallelogram due to impractical usage of it
  • a few small changes in code functions

that's it i hope you guys would find my system useful and easy to use also im sorry for making it so long and probably boring for some of you but i wanted to make it as noob friendly as possible.

also attached a sample map for the system below if you would like to check.

Enjoy! :p
 

Attachments

  • [System]GetShapePoint.w3x
    20.3 KB · Views: 238

Exide

I am amazingly focused right now!
Reaction score
448
I don't know much about all this..
But this looks awesome. :thup: :D

Well written, good explainations, lovely screenshots.
+rep! <3
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
it just does the math part and returns the requested points.]
with the needed points you receive you do what u need a certain shape for.
i guess mostly this system would be used for eye candy spell but it could be for much more if you just think of every possiblity you got from this system

about the too much to read if you are experienced with jass there are lots of stuff you can skip or read quickly - if i would have made it for jass users only i think i could have cut about 30-40% of it
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
i do use x/y i just covert it back to loc to make it GUI friendly
 

Larcenist

REP: Respect, Envy, Prosperity?
Reaction score
211
What if you wanted to make a really vicious parallellogram that burns everything close to it? If this does nothing but creating the shape it does not cope with this.

Also GetShapePoint() doesn't really describe the system (and doesn't really make sense at all). CreateShapeFromPoint() or something would fit more ^^
 
Reaction score
333
Half the system appears to be comments. Comments spam doesn't enhance the usefulness of your system, it is just ugly and often the important usage details are drowned out by the text equivalent of noise.

I understand the use of locations, but the amount/position thing? Why don't you just allow the user to supply a real signifying the part of the line/shape he wants a point from?

There are also efficiency issues.. This is a system - you can't say how many times these functions will be called and under what conditions. For that reason, it is best to optimize these things internally. Consider a replacement for GetLinePoint:

JASS:
function GetLinePoint takes location a, location b, real pos returns location
    local real x = GetLocationX(a)
    local real y = GetLocationY(a)
    return Location(x + (pos*(GetLocationX(b) - x)), y + (pos*(GetLocationY(b) - y)))
endfunction


And GetCirclePoint:

JASS:
function GetCirclePoint takes location loc, real radius, real deg returns location
    return Location(radius*Cos(deg*bj_DEGTORAD) + GetLocationX(loc), radius*Sin(deg*bj_DEGTORAD) + GetLocationY(loc))
endfunction
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
@Larcanist
>What if you wanted to make a really vicious parallellogram that burns everything close to it? If this does nothing but creating the shape it does not cope with this.

as i already added in the note the parallelogram is still under work and is not fully completed yet therefore it won't work accuratly towards the degrees but as for the rest of the shapes you won't have a problem using them for other uses since they are all very accurate.

>Also GetShapePoint() doesn't really describe the system (and doesn't really make sense at all). CreateShapeFromPoint() or something would fit more ^^

since you are getting only 1 point from a shape you called for therefore GetShapePoint would describe it more if you read a bit about the system you will see that calling a function splits a certain shape (sometimes to chosen amount) and returns the needed position taken.
also if you see all the functions they are all: "GetLinePoint","GetTrianglePoint" so i just switched the shape name and put in an overall name for all - Get(Shape)Point - ^^

>TheDamien
Half the system appears to be comments. Comments spam doesn't enhance the usefulness of your system, it is just ugly and often the important usage details are drowned out by the text equivalent of noise.

probably but as far as you read the description and stuff on this thread which are more neat and organized this thing realy is a spam and you could skip the whole thing and just copy the functions.
but if you haven't read this thread you probably would need to read this "spam" in oder to understand how to work (it's pretty hard to make it organized in Jass.... - i tried my best)
if you are not intrested in this part just cut it off.

>I understand the use of locations, but the amount/position thing? Why don't you just allow the user to supply a real signifying the part of the line/shape he wants a point from?
i could give him the part which he wanted from a line if i get like precent of something but i guess giving the ability to split it into certain amount and take a certain position out of it will give it the ability to be manipulated as far as you want though making it with precent i could do the same.
as for the circle that one could receive degrees like you did but i think that it should be harder for some of users who are not very good in geometry so Afaik the use of position and amount would save them all the math stuff(or at least most of it).

about the rest of the stuff you said about the efficiency you probably right at some or wrong at some also the fact that you use a different method than mine also change a bit from it but i will try and remove a bit of the unefficient stuff in there.

@Vestras
wrong - it is returned to a point variable and that's already up to the user to clear that leak
 
Reaction score
333
probably but as far as you read the description and stuff on this thread which are more neat and organized this thing realy is a spam and you could skip the whole thing and just copy the functions.
but if you haven't read this thread you probably would need to read this "spam" in oder to understand how to work (it's pretty hard to make it organized in Jass.... - i tried my best)

You needn't remove the entire description, you need only:

  • Introduce better formatting.
  • Improve the spelling, capitalization and grammar.
  • Make everything shorter and more concise.

i could give him the part which he wanted from a line if i get like precent of something but i guess giving the ability to split it into certain amount and take a certain position out of it will give it the ability to be manipulated as far as you want though making it with precent i could do the same.

It doesn't make it easier to manipulate, you're just adding the requirement that users provide the quotient as a fraction instead of a value.

as for the circle that one could receive degrees like you did but i think that it should be harder for some of users who are not very good in geometry so Afaik the use of position and amount would save them all the math stuff(or at least most of it).

It is much easier to work in degrees than it is to understand this:

JASS:
//***Description***: Gets the point from circle divided by the amount of value received and returns
//the number of part received in value(starts from the right of the center and continues by clockwise)
//the circle could be divided to any number above 0 and will be divided equally to return the needed
//point to form a circle the circle will also receive a radius to decide the size of it.


about the rest of the stuff you said about the efficiency you probably right at some or wrong at some

To save time lets just assume that I was right about both (which, incidentally, I was).

also the fact that you use a different method than mine also change a bit from it

Did you actually see fit to test them? Provide position/amount for "pos" and you will see that they produce the same results (unless position and/or amount are negative, in which case yours will error unhelpfully).
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
You needn't remove the entire description, you need only:

* Introduce better formatting.
* Improve the spelling, capitalization and grammar.
* Make everything shorter and more concise.
k thanks for the advice i will add that one to my "to do list".
It doesn't make it easier to manipulate, you're just adding the requirement that users provide the quotient as a fraction instead of a value.
k so i guess using a line precentage would be easier to use i should try that one too.
It is much easier to work in degrees than it is to understand this:
mabye at that one you are right but understanding that one is easier:
circleexmpleeh1.jpg

Did you actually see fit to test them? Provide position/amount for "pos" and you will see that they produce the same results (unless position and/or amount are negative, in which case yours will error unhelpfully).
yes i already know that too and i need to check these stuff as well
 
Reaction score
456
Just a general note here.. description is much easier to read when it is not spammed full of BIG non symmetric characters like "#", "@".

JASS:
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@  Get(Shape)Point System @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@  Made by Doom-Angel @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@

That'd be better when using something like "=" or nothing at all:
JASS:
//==================================================================
//                          GetShapePoint
//
//                       Made by Doom-Angel
//==================================================================


---

JASS:
//@@@@@@@@@@@@@@@@@@@@@ Descriptions and Instructions for each Shape @@@@@@@@@@@@@@@@@@@@@@@@@@@

//@@@@@@@@@@ Line @@@@@@@@@@@@@
//***Description***: Gets the points from line(which is based of starting and ending points) which 
//is divided equally by distance to the amount sended to the function and returns the desired 
//point out of the divided line.
//@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
//***Instruction***: simply call the function by using Custom script and entering the right values
//to get the required outcome - use this simple call for this function: 
//call GetLinePoint(Starting Point,Ending Point,Divided Part number(integer),Amount of division in line(integer))
//to get the points of the whole line just use Integer A loop and place the integer A in the Divided part and you will receive each part of the line you just divided.
//Note - asking for parts of the line higher than the amount divided would extend it beyond the size of the line (above the ending point).

Compare with:
JASS:
// How To Use

// Line
// ¯¯¯¯
// Description: 
// Gets the points from line(which is based of starting and ending points) which 
// is divided equally by distance to the amount sended to the function and returns the desired 
// point out of the divided line.

// Instruction: 
// Simply call the function by using Custom script and entering the right values
// to get the required outcome - use this simple call for this function: 
// call GetLinePoint(Starting Point,Ending Point,Divided Part number(integer),Amount of division in line(integer))
// to get the points of the whole line just use Integer A loop and place the integer A in the Divided part and you will receive each part of the line you just divided.
// Note - asking for parts of the line higher than the amount divided would extend it beyond the size of the line (above the ending point).

I really think description and intruction for every shape could be much more shorter.
 

Flare

Stops copies me!
Reaction score
662
JASS:
return Location(x, y)


^Leaks.

That's why you're supposed to do
JASS:
set loc = GetTypePoint (...)

and let the end-user destroy it when they no longer need the point - it'd be retarded to set it to a variable, remove it, then return the null value since that would, obviously, not be of much use, now would it? :rolleyes:
And you can't remove the point after the return since, as you should know, returning prevents execution of the remainder of the function.


And, even if you could, destroying the point within the system would destroy the variable you allocated it to with via
JASS:
set loc = GetTypePoint (...)

since both variables would be pointing to to same location, so if you destroy var1, the location used for var2 is also destroyed
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
i totally forgot about that one...
anyway i changed a few things in the system (check change log)
and you are welcome to comment
 

Darthfett

Aerospace/Cybersecurity Software Engineer
Reaction score
615
You might be able to add onto this:

Line
Equilateral Triangle
Square
Pentagon
Hexagon
Heptagon
Octagon
Nonagon
Decagon
....
Can all be derived from the same formula. All you really have to do, is divide up the degrees of a circle by the number of sides, and you have every side. If you use 2 points, you have them on opposite sides of the circle. If you have 5, you have them in a pentagon-like shape.
 

Doom-Angel

Jass User (Just started using NewGen)
Reaction score
167
^ i know that you can make each of them on the circle but in case of rectangle,line,and triangle it would be easier to use my functions because they are more flexible than in case of using the circle
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top