| 08-17-2007, 06:30 AM | #1 |
I'm planning on using set unit X/Y because it doesn't disrupt orders and can be used for some interesting sliding functions, as well as being able to interfere with pathing normalities. A few questions... 1. I forgot what the unit set X/Y function is... what is it? (Don't need the radiants or degrees function yet, just physical X/Y's) 2. Would I be able to use this to find points and move to with set X/Y? Trigger: Actions
![]() Set ReaUnitXY[1] = (X of (Position of (Target unit of ability being cast)))
![]() Set ReaUnitXY[2] = (Y of (Position of (Target unit of ability being cast)))
![]() Custom script: set Unit X/Y thingy here...3. Would I be able to use polar offset with something similar, like this? Actions Trigger: Actions
![]() Set ReaUnitXY[1] = (X of ((Position of (Triggering unit)) offset by 10.00 towards (Facing of (Triggering unit)) degrees))
![]() Set ReaUnitXY[2] = (Y of ((Position of (Triggering unit)) offset by 10.00 towards (Facing of (Triggering unit)) degrees))
![]() Custom script: set Unit X/Y thingy here...4. If the two above methods work, do they leak? That's it for now, and thanks ahead! |
| 08-17-2007, 06:48 AM | #2 |
1. common.j will answer this question with a quick search. The answer is.. drumroll please... SetUnitX, SetUnitY 2. Yes 3. Yes 4. Yes. Convert to custom script. Look up the type of each function called. Does it return a handle? If so, you probably have to clean up after it. In this case you need to destroy the locations you create with "Position of" |
| 08-17-2007, 06:53 AM | #3 |
I'm not good with finding things... where's the common.j? ![]() So... if I use the small method I am using now, I can remove the memory leaks by setting a point, then extracting the X/Y off it? |
| 08-17-2007, 07:21 AM | #4 | ||
The polar projection leaks 2 points, the position of the unit, and then the projected point. Quote:
Its one of the main map scripts and is located in the main mpqs as well as on some websites ( http://www.wc3jass.com/viewforum.php?f=20 ) Quote:
yes. It would be more efficient to only get the point once and then use the x and y value of the same point, without recreating the point. |
| 08-17-2007, 07:32 AM | #5 |
JASS:native SetUnitY takes unit whichUnit, real newY returns nothing native SetUnitX takes unit whichUnit, real newX returns nothing EDIT! I just realised... would I swap out whichUnit with udg_MyUnitVariable and newX and newY with my real variables? |
| 08-17-2007, 04:43 PM | #6 |
ya, your newx newy variables are the new x and y that you want the unit to be at. And whichunit can be the global variable udg_myguy . |
| 08-17-2007, 05:22 PM | #7 |
Wait, so you use SetUnitX like this? Trigger: Custom Script - native SetUnitX takes unit udg_TempProjectile, real udg_TempX returns nothingTrigger: Custom Script - call SetUnitX(udg_TempProjectile, udg_TempX)Edit: Nope, I figured out the hard way that using it like that doesn't work either. |
| 08-17-2007, 08:11 PM | #8 |
umm I think I heard somewhere if the unit has no movespeed only the shadow will move. |
| 08-17-2007, 08:18 PM | #9 | |
Quote:
The unit needs at least 1MS. Trigger: Custom Script - call SetUnitX(udg_TempProjectile, udg_TempX) |
| 08-17-2007, 10:25 PM | #10 |
I'll be using this for spells, so mostly it will be effecting heroes 'n' units, not missiles 'n' stuff. +Rep for all (who helped)! |
| 09-26-2007, 03:16 PM | #11 |
Hm can anybody help me? I'm trying to use that function, to creat different things like a waterslide, or wind ect... So I want that all units that enter a certain area are constantly moved to the right, but not interrupted. (I also tried to do it with other ways (bit more in jass) but never managed to get no error... and i also happened to delete those tries...(stupid me)) Trigger: If I try this, it says variablename expected (at the setunitx-function) Help would be really appreciated ;-D |
| 09-26-2007, 03:36 PM | #12 |
A, Dont hijack threads when the problem has been solved. B, Your problem would be solved by using Handle Vars (easy way), or caster system, read a tutorial about it. |
