HomeUser Control Panel (unavailable in archive)ForumsTutorialsArt GalleryResourcesMaps

Straight line movement

03-05-2005, 09:46 PM#1
Tim.
Alright, for my First Person Shooter system Im using the bullet as a unit that is created at the firing unit, and then moves to the order of where you right-clicked. What I now wish to do is make the unit move passed the point you right-clicked. The easiest way I thought to do this is meerly to add 99999 to the X and Y values of the point. However in order to do this, I need to make the position where you right-clicked the origin of the equation. How can I do this other than making 16 If/Then/Else statments saying 'If Value of X is > 0 then + 99999' or 'If Value of X is < 0 then - 99999' etc.

Note: Offset wont seem to work.
03-05-2005, 11:09 PM#2
Raptor--
when you're dealing with directions its much easier to use trigonometry or adopt a polar coordinate system

er, i'll answer u more when i get back, i have to go out now
03-05-2005, 11:22 PM#3
Guest
Hey I'd recommend getting the WEU and using the advanced special effect, it has a selection for straight line and offset, alonth with half curve, circle, and more.
03-06-2005, 10:07 AM#4
Raptor--
anyways, i'm back now, so i'll give u the just of it

tempfloat = direction between (position of ordered unit) and (target point of issued order)
create unit at (position of ordered unit offset by 32 towards tempfloat degrees)
order last created unit to move to (position of last created unit offset by 9999 towards tempfloat degrees)
03-06-2005, 12:09 PM#5
Tim.
Hmm, I understand that, however the units dont go in the correct direction, at first I thought perhaps they were going in the oposite direction, but I later noticed there is no obvious pattern to the wrong direction from the right direction. As such I thought perhaps they are going mainly to the 4 corners due to the long offset (99999) in hope of getting the farthest. So I changed it to 1000, and they still do it. Im stumped.

NOTE: Attached a demo map showing the issue.
03-06-2005, 07:42 PM#6
Anitarf
It's erratic because you set your fire angle to distance between two points instead of angle.
03-06-2005, 11:50 PM#7
Tim.
Hahahah!!! I must have missclicked on the one just below angle and not relised it!! Wow cant believe I missed that. Yup that did it, thanks.
03-07-2005, 12:57 AM#8
Ponzini
Quote:
Originally Posted by Tim.
Hahahah!!! I must have missclicked on the one just below angle and not relised it!! Wow cant believe I missed that. Yup that did it, thanks.

ya even if u fix that angle problem you cant have it at 9999999... that sucks does that mean if you got close to the edge of the map even with 1000 will it shoot off in some other direction?
03-07-2005, 06:19 AM#9
Raptor--
Quote:
Originally Posted by Ponzini
ya even if u fix that angle problem you cant have it at 9999999... that sucks does that mean if you got close to the edge of the map even with 1000 will it shoot off in some other direction?

actually even though a map has map bounds, its possible for a unit to know where a point outside of the playable map area is

but thats irrelevent