I'm using the origional OFP game, with all updates installed (1.42). I want to know how can I obtain the position of the LaserTarget of the Laser Designator so that I can use it in an artillery mission, this is what I have so far:
;Artillery with Laster Designator
;May 9th, 2004
_Laser = _this select 0
_area = _this select 1
_shells = _this select 2
_ArtyPiece = _this select 3
_LaserPos = [GetPos _Laser select 0, GetPos _Laser select 1]
_xcoor = _LaserPos select 0
_ycoor = _LaserPos select 1
_zcoor = 0
_areaX2 = _area * 2
~2
_ArtyPiece SideChat "Artillery Incoming, stand your ground."
~4
_ammo = _shells
#fire
_shot1 = "mortar" camCreate [_xcoor + Random(_areaX2) - _area,_ycoor + Random(_areaX2) - _area,_zcoor + 150]
~3
_shot2 = "mortar" camCreate [_xcoor + Random(_areaX2) - _area,_ycoor + Random(_areaX2) - _area,_zcoor + 150]
_ammo = _shells - 2
?(_ammo > 0) : goto "fire"
_ArtyPiece SideChat "Rounds complete, I repeat, rounds complete."
Exit
I got most of the code from the beginners guide to scripting. I have it setup so that, when you have your laser designator targeted on something, u call the radio and it will enable the trigger with the following activation:
["LaserTarget",20,6,arty1] exec "artillery.sqs"
When that is called to run, I get the following error message at the top of my screen:
'_LaserPos = [GetPos _Laser select |#| 0, GetPos _Laser select 1]': Error type String, expected Object.
I may (most likely) have all of this code wrong or jumbled up. Could you tell me either how to get the coordinates of the LaserTarget, or how to fix my mess? (which ever is easier) thanks in advance, Frosty.