ok, heres a script ive been working on with lots of help from people a long time ago, but i dusted it off and wanted to use it again...
now, the script consists of 2 scripts, one for user defined marker (clicking on the map) and the actual barrage...
now first u call for arty - they ask you to send co-ordinates - you click on map - they send red smoke round - you either confirm or cancel fire mission - fire mission begins.
problem is, that the script is very inaccurate - where the player clicks and the smoke comes down is generally off by 100m or so - in any direction - and the rounds that come after that are another 50m or so off from the smoke - not good.
could some1 check out my scripts to see how to make them more accurate? cheers.
Usermarker script:
; user defined marker detection script v1
; by snYpir for the OFP editing center
;---------------------------------------------
; this script will constantly monitor for new user-defined markers
; it is designed to be called right at the start of a mission
; every time a new user defined marker is created:
; the global variable 'userMarker' will equal the latest marker
; the global variable 'userMarkerPos' will equal the position of the latest marker
; the global variable 'userMarkerX' will equal the X coord of latest marker
; the global variable 'userMarkerY' will equal the Y coord of latest marker
; the global variable 'userMarkerSet' will equal true.
; it is YOUR responsibility to set userMarkerSet back to false! ie in your artillery script or wherever. If you don't it doesn't matter, if the user enters a new marker then the new marker information will override the global variables
; it does not matter how many markers already exist on the map, this script will just hunt for the first user defined marker the player places, then the next etc.
; WARNING!!!! THE DELETE BUTTON IS THE ACHILE'S HEEL OF THIS SCRIPT!!!!!
; PARAMETERS: takes the number of pre-defined markers you have already set in the editor
;----------------------------------------------
; BEGIN BITS U CAN EDIT
;----------------------
; set the time between marker checks - should be between 0.25 and 1
_pause = 0.5
; time in seconds to show 'destroy' icon before the marker will disappear, default is 1
; careful, you don't want the player adding new markers while we are waiting for the
; destroy icon to disappear, so don't make this value too high
_hidedelay = 3
; the icon to display for user-defined markers
_icon = "destroy"
; END BITS U CAN EDIT
;--------------------
userMarkerPause = false
userMarkerSet = false
_nEditorMarkers = _this select 0
; this loop will run until the end of the mission
#missionLooop
;wait for a marker to be added
#loop2
;halt the script if requested
@NOT(userMarkerPause)
; find the id of what will be the next user-defined marker
_counter = _nEditorMarkers
#loop1
_markerposn = getMarkerPos format["_USER_DEFINED #0/%1",_counter]
? ((_markerposn select 0) == 0 AND (_markerposn select 1) == 0) : goto "nextmarkerspotfound"
_counter = _counter + 1
goto "loop1"
; ok so now _counter will equal the position of where a new marker will go.
#nextmarkerspotfound
; make sure another marker has not been added during the loop above
? ((_markerposn select 0) != 0 AND (_markerposn select 1) != 0) : _counter = _counter + 1
~_pause
_markerposn = getMarkerPos format["_USER_DEFINED #0/%1",_counter]
? (_markerposn select 0) == 0 AND (_markerposn select 1) == 0 : goto "loop2"
; remember the new marker information in userMarker, userMarkerPos, userMarkerPosX, userMarkerPosY
userMarker = format["_USER_DEFINED #0/%1",_counter]
userMarkerPos = _markerposn
userMarkerX = (_markerposn select 0)
userMarkerY = (_markerposn select 1)
; change markers icon
userMarker SetMarkerType _icon
; switch the userMarkerSet flag to true - it is your responsibility to switch it back to false
userMarkerSet = true
; uncomment for information about new marker to be printed to screen
;hint format["Marker %1 placed at position: (%2,%3)",_counter,userMarkerX,userMarkerY]
; short pause to allow icon to change
~_hidedelay
; hide the marker (so the player will not intentionally delete it)
userMarker SetMarkerType "empty"
; loop back up to wait for the next marker
goto "missionLooop"
Smoke/arty script:
colour = "SmokeShellRed"
_startmsg = "Send coordinates for fire mission, over"
_inboundmsg = "Acknowledged, smoke rounds inbound, out"
_endmsg = "Rounds complete, out"
_smokecalledmsg = "Fire mission in progress, wait out"
_confirmMsg= "Confirm correct target. Out. "
_inboundArtmsg = "Acknowledged, live rounds imbound. Take cover. Out."
shelllimit= 30
? smokecalled : (_this select 0) SideChat _smokecalledmsg; exit
smokecalled = true
_smokeArr = units group (_this select 0)
"RemoveAllWeapons _x" foreach _smokeArr
_tmp = 0
#for3
(_smokeArr select _tmp) disableAI "move"
? _tmp < count _smokeArr : _tmp = _tmp + 1; goto "for3"
? _startmsg != "null" : (_this select 0) SideChat _startmsg
; wait until the player has set a user marker
userMarkerSet = false
@userMarkerSet
? _inboundmsg != "null" : (_this select 0) SideChat _inboundmsg
_salvos = _this select 1
? _salvos == 0 : hint "Invalid number of salvos. Must be greater than 1."; exit
_startPos = GetPos (_this select 0)
userMarkerY = userMarkerY + 150
_salvocount = 1
#salvoloop
~4
_tmp = 0
#for2
_randx = RANDOM 100
_tmprndx = RANDOM 10
_randy = RANDOM 100
_tmprndy = RANDOM 10
? _tmprndy < 5 : _randy = _randy * -1
? _tmprndx < 5 : _randx = _randx * -1
_smokey= "SmokeShellRed" camCreate [userMarkerX + _randx,userMarkerY + _randy,500]
;? _tmp < count _smokeArr : _tmp = _tmp + 1; goto "for2"
~9
;? _salvocount <= _salvos : _salvocount = _salvocount + 1; goto "salvoloop"
? _endmsg != "null" : (_this select 0) SideChat _Confirmmsg
2 setradiomsg "Affirmative"
3 setradiomsg "Negative"
#for5
? confirmed==1:goto "Barrage"
? confirmed==2:goto "Retry"
~0.5
goto "for5"
#retry
player sidechat "Negative base, attempting to relay new co-ordinates to you."
Confirmed=0
2 setradiomsg "null"
3 setradiomsg "null"
smokecalled=false
exit
;AT THIS POINT RE-MARK THE MAP AND RADIO AGAIN!
#Barrage
(_this select 0) SideChat _inboundArtmsg
2 setradiomsg "null"
3 setradiomsg "null"
shellssofar=0
#for6
_shel= "laserguidedbomb" CamCreate [(getpos _smokey select 0) +(random 100), (getpos _smokey select 1) + (random 100), 200]
shellssofar=shellssofar + 1
?shellssofar>=shelllimit: (_this select 0) SideChat _Endmsg;goto "delay"
~Random 5
goto "for6"
#delay
~120
smokecalled=false
and another thing - the actual barrage works great on flat areas - but on hills the number of explosions goes from about 15 to 4 - for some reason it doesnt like hills - can that be sorted?
and, just if it cud be done, is there anyway of adding that arty noise just before the shell strikes? that kinda of ripping through the air noise that scares the craphola outa every1
hope u can help :thumbsup: