HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

[Clarifying] Moving Units + Some Questions

07-28-2007, 10:41 AM#1
Tide-Arc Ephemera
Problem 1!
When moving units to a location to imitate missile effects, they appear to hug contours of the terrain. I think someone said if you use:

Trigger:
Unit - Move My_Unit_Variable instantly to (Point((X of ((Position of My_Unit_Variable) offset by 10.00 towards (Facing of My_Unit_Variable) degrees)), (Y of ((Position of My_Unit_Variable) offset by 10.00 towards (Facing of My_Unit_Variable) degrees))))

Rather than

Trigger:
Unit - Move My_Unit_Variable instantly to ((Position of My_Unit_Variable) offset by 10.00 towards (Facing of My_Unit_Variable) degrees)

It will not hug the contours of the terrain. I would like to clarify if using the X-Y coordinates will ignore contour hugging but still move the unit and possibly if I don't have to clean up a leak using the X-Y coordinates.

Problem 2!
Is there a custom script condition to check for the height of a point in the terrain? I have UMSWE so I can GUI any condition I feel necessary.

Problem 3!
How exactly is missile speed measured? Pixels moved per second?

Problem 4!
Last time I made a *more advanced* laser tag map, I used an artificial missile collision system by giving a set of units something like...

Trigger:
Unit - A unit comes within 100.00 of My_Unit_Variable 0000 <gen>

And I gave the laser units the Damage Upon Death ability... I faced a very peculiar problem that the units would deal damage, but would not have any ownership sources... allied heroes did not gain experience from deaths and my test messages did not have a name to display for "Owner of Killing Unit"

My problem here is do I have to trigger the damage from a more permanent source, or am I using the wrong things? If I'm using the wrong things, what do I use instead?
___

Those are my problems for now, I hope for positive responses, and thanks ahead!
07-28-2007, 11:11 AM#2
DioD
1) you have to use SetUnitX\Y natives, jass only
2) GetLocationZ() - return real jass only
3) Hardcoded range per second, if your unit have 600 attack range - 600 missile move speed == hit after second.
This called patching cells, not pixels.
4) Use damage upon death from goblin mines.
07-28-2007, 11:26 AM#3
Tide-Arc Ephemera
For GetLocationZ... would it be something like...

Collapse JASS:
GetLocationZ(udg_TempPoint)

I don't know, I don't use JASS, I need a condition example of it of something like... Gets the Z of TempPoint and if it's equal to or less than...
___

I have no clue on how to use JASS for things other than memory leak fixing, so I need something like an example of what I'm trying to do... moving a unit in relation to it's facing angle...
07-28-2007, 10:05 PM#4
Pyrogasm
Well, you have to pick apart the PolarProjection stuff to get new x/y coordinates, like so:
Collapse JASS:
NewX = OldX+Distance*Cos(Angle*57.2958)
NewY = OldY+Distance*Sin(Angle*57.2958)
So, in your case, you'd probably do something like this:
Trigger:
Set Your_Unit = However_You_Get_Your_Unit
Set Distance = 5.50
Set Angle = Facing of Your_Unit
Custom script: call SetUnitX(udg_Your_Unit, GetUnitX(udg_Your_Unit)+udg_Distance*Cos(udg_Angle*57.2958))
Custom script: call SetUnitY(udg_Your_Unit, GetUnitY(udg_Your_Unit)+udg_Distance*Sin(udg_Angle*57.2958))

As for GetLocationZ(), you'd probably do this:
Trigger:
Set TempPoint = Center of (Playable Map area)
Custom script: set udg_LocationZ = GetLocationZ(udg_TempPoint)
Collapse If (All conditions are true) then do (Then actions) else do (Else actions)
Collapse If - Conditions
LocationZ > 50.00
Collapse Then - Actions
----- Do something -----
Collapse Else - Actions
----- Do something else -----
Custom script: call RemoveLocation(udg_TempPoint)
07-29-2007, 05:47 AM#5
Tide-Arc Ephemera
I'll be running a trigger 100 times per second, and it needs both of those to be incorporated, so the *code* must be optimal. In UMSWE it allows custom script to be used in comparisons and conditions.

I'll toy around with this for my map... I might be back with some more comments/questions if it's within a week. If this rotates behind the first two pages, I'll start a new topic.
___

This trigger is a decelerated version of what I'm using:
Trigger:
Melee Initialization
Collapse Events
Time - Every 0.03 seconds of game time
Conditions
Collapse Actions
Custom script: set bj_wantDestroyGroup = true
Collapse Unit Group - Pick every unit in (Units of type Wisp Beam) and do (Actions)
Collapse Loop - Actions
Set UniLaser = (Picked unit)
Set ReaDistance = 3.00
Set ReaAngle = (Facing of UniLaser)
Set PntLaserTemp[1] = ((Position of UniLaser) offset by 1.00 towards ReaAngle degrees)
Set PntLaserTemp[2] = (Position of UniLaser)
Custom script: set udg_ReaGetLocationZ[1] = GetLocationZ(udg_PntLaserTemp[1])
Custom script: set udg_ReaGetLocationZ[2] = GetLocationZ(udg_PntLaserTemp[2])
Collapse If (All Conditions are True) then do (Then Actions) else do (Else Actions)
Collapse If - Conditions
(UniLaser is alive) Equal to (==) True
ReaGetLocationZ[2] Greater than or equal to (>=) ReaGetLocationZ[1]
Collapse Then - Actions
Custom script: call SetUnitX(udg_UniLaser, GetUnitX(udg_UniLaser)+udg_ReaDistance*Cos(udg_ReaAngle*57.2958))
Custom script: call SetUnitY(udg_UniLaser, GetUnitY(udg_UniLaser)+udg_ReaDistance*Sin(udg_ReaAngle*57.2958))
Collapse Else - Actions
If ((UniLaser is alive) Equal to (==) True) then do (Unit - Kill UniLaser) else do (Do nothing)
Custom script: call RemoveLocation(udg_PntLaserTemp[1])
Custom script: call RemoveLocation(udg_PntLaserTemp[2])

Hugs terrain contours.
07-29-2007, 05:59 AM#6
Pyrogasm
A 0.01 second repeating timer is completely unnecessary. 0.03 or 0.04 at least will be sufficient.
08-01-2007, 06:30 AM#7
Tide-Arc Ephemera
*apologizes*

The frequency is not exactly the point, it's hugging the terrain contours.
___

I'm having a very f**king weird problem now... I remade the trigger to make HERO units to slide across an area, and so far this is what I have got:

Click image for larger version

Name:	TestProblems.jpg
Views:	7
Size:	395.5 KB
ID:	27700

And here's the trigger with the SPFX bug-debugger attached to it:
Trigger:
GE Sliding
Collapse Events
Time - Every 0.02 seconds of game time
Conditions
Collapse Actions
Custom script: set bj_wantDestroyGroup = true
Collapse Unit Group - Pick every unit in (Units of type Icy Manipulator) and do (Actions)
Collapse Loop - Actions
Set UniMove = (Picked unit)
Set ReaDistance = (((Real((Agility of UniMove (Include bonuses)))) / 20.00) + ReaDistanceBase)
Set ReaAngle = (Facing of UniMove)
Custom script: call SetUnitX(udg_UniMove, GetUnitX(udg_UniMove)+udg_ReaDistance*Cos(udg_ReaAngle*57.2958))
Custom script: call SetUnitY(udg_UniMove, GetUnitY(udg_UniMove)+udg_ReaDistance*Sin(udg_ReaAngle*57.2958))
Special Effect - Create a special effect at (Point((X of UniMove), (Y of UniMove))) using Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
Attached Images
File type: jpgTestProblems.jpg (395.5 KB)
08-01-2007, 09:03 AM#8
substance
[OffTopic]I never understood 'complex GUI', why would someone continue to use GUI when they know jass and know that jass is better?[/OffTopic]
08-01-2007, 09:21 AM#9
Pyrogasm
Because he uses Mac OS X and there's not much motivation to learn JASS because you can't use vJASS or have a decent syntax checker.
08-01-2007, 09:33 AM#10
Tide-Arc Ephemera
Quote:
Originally Posted by substance
[OffTopic]I never understood 'complex GUI', why would someone continue to use GUI when they know jass and know that jass is better?[/OffTopic]

Hahahahahahalolhahahaha did you read the first few posts?

Pyro is very correct about why I don't want/feel like learning JASS. Though it would be very nice if someone could back up onto the topic and tell me why my move system is being retarded...

Oh yeah, on some parts after the curl-glitch is finished, the unit may travel backwards...
08-01-2007, 09:42 AM#11
Pyrogasm
Wow, I didn't even notice that there was a problem; didn't see your edit.

At any rate, there does not appear to be a flaw in your trigger, so I don't know what the error is... You are leaking a location with the SFX, though.

And it would be more optimized if you simply did this:
Trigger:
Set ReaAngle = ((Facing of UniMove) x 57.2958)
Custom script: call SetUnitX(udg_UniMove, GetUnitX(udg_UniMove)+udg_ReaDistance*Cos(udg_ReaAngle))
Custom script: call SetUnitY(udg_UniMove, GetUnitY(udg_UniMove)+udg_ReaDistance*Sin(udg_ReaAngle))

EDIT: You don't have any triggers that set a unit's facing? Anywhere? The fact that there are 2 symmetical curls would suggest that you do.
08-01-2007, 09:44 AM#12
Tide-Arc Ephemera
At your edit, what exactly do you mean triggers that set a unit's facing? Force them to look somewhere? I'm just setting up the main frame of the movement so far...
08-01-2007, 09:48 AM#13
Pyrogasm
Any trigger that set's a unit's facing or orders your dummy units to cast a spell anywhere (which would cause it to face that point). Issuing point orders at places, etc..

Things like that.
08-01-2007, 09:52 AM#14
Tide-Arc Ephemera
Nope, none of that.

I integrated your optimization to the trigger, and now it's like the units are running against a very, very heavy eastward wind and they will try to run west, but keep getting blown west anyway.

The direction does not change, but at least it's a constant, non-loopy-loopy thingimajig.
___

*Begins the tearing out of the hair*
Click image for larger version

Name:	WhatTheFungus.jpg
Views:	4
Size:	352.5 KB
ID:	27701

Trigger:
GE Sliding
Collapse Events
Time - Every 0.03 seconds of game time
Conditions
Collapse Actions
Custom script: set bj_wantDestroyGroup = true
Collapse Unit Group - Pick every unit in (Units of type Icy Manipulator) and do (Actions)
Collapse Loop - Actions
Set UniMove = (Picked unit)
Set ReaDistance = (((Real((Agility of (Picked unit) (Include bonuses)))) / 20.00) + ReaDistanceBase)
Custom script: call SetUnitX(udg_UniMove, GetUnitX(udg_UniMove)+udg_ReaDistance*Cos(udg_ReaAngle))
Custom script: call SetUnitY(udg_UniMove, GetUnitY(udg_UniMove)+udg_ReaDistance*Sin(udg_ReaAngle))
Custom script: set udg_ReaAngle = GetUnitFacing(GetEnumUnit())*57.2958
Set PntTemporary = (Position of UniMove)
Special Effect - Create a special effect at PntTemporary using Abilities\Weapons\SpiritOfVengeanceMissile\SpiritOfVengeanceMissile.mdl
Point - Remove PntTemporary

That has been decelerated...

What is the Icy Manipulator?
The Icy mage is a simple modification off the Archmage with a model of Jaina and a few stats changes. No movement speed changes have been made.

EDIT! - The one on the left started facing 180 degrees, and the one on the right started facing 0 degrees, but it appears there is a 135 degree difference between them.

EDIT! - I messed up the (left) and (right) tips, the one on the right is the curls, the one on the left is arcs.
Attached Images
File type: jpgWhatTheFungus.jpg (352.5 KB)
08-01-2007, 10:47 AM#15
Toadcop
Mac OS X Macs sucking... i dunno who need them. PCs owns. if you are "gamer" never buy a Mac...

Quote:
there's not much motivation to learn JASS because you can't use vJASS or have a decent syntax checker.
words of true lamer ! if you got needed knowledge you can make the same + better than any preprocessor tool can. it's a question of desire.
vJass making people less thinking aka makes them stupid. it's a known fact. but it's makes many things more handly in expirienced hands.