OFPEC Forum
Editors Depot - Mission Editing and Scripting => OFP - Editing/Scripting General => Topic started by: The_argyll on 14 May 2004, 06:18:13
-
How do I find out the last position a shell has landed for a each tube in a platoon of 4 mortars where TubeID is the number of the tube, 1 through 4. X is the X Coord. Y is the Y Coord. I dont need to know the Z Coord though.
Thanks,
RS
-
This added to the fired event will allow you to track the shells, just put the following line in each of your Mortars init fields:
this addeventhandler ["Fired","_this exec {Track.sqs}"]
Track.sqs
_sh=_this Select 0
_aT=_this Select 4
_ts=ObjNull
@(Call {_ts=NearestObject [_sh,_aT];!IsNull _ts})
~1
#Loop
_LastPos=GetPos _ts
~0.1
If !(IsNull _ts) Then {goto "Loop"}
_X= _LastPos Select 0
_Y= _LastPos Select 1
You can get away with this because the muzzle velocity its quite low for mortars. Although it might miss rounds when things get really busy on screen.
Probably worth checking out this thread as well:
http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=16544;start=0 (http://www.ofpec.com/yabbse/index.php?board=8;action=display;threadid=16544;start=0)
But you might want to check out CoC's UA:
http://www.main.thechainofcommand.net/ (http://www.main.thechainofcommand.net/)
Or even my humble efforts:
http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=12343 (http://www.ofpec.com/yabbse/index.php?board=27;action=display;threadid=12343)
http://www.ofpec.com/yabbse/index.php?board=43;action=display;threadid=17018 (http://www.ofpec.com/yabbse/index.php?board=43;action=display;threadid=17018)