ok - i downloaded snYpirs user defined marker script which also came with a smoke mission....
now - i want to convert it slightly to do the following:
1. Player asks for fire missions - mission accepted
2. Player selects user defined marker (double clicks on map)
3. Naval Artilery fires 1 red smoke shell - range finding - (at the moment its like 15)
4. Naval Artilery asks for confirmation on live rounds fire mission - to check if red smoke is in correct place to player or if any allies have wandered into fire zone.
5. Player can answer AFFIRMATIVE or NEGATIVE - available through the radio - only visible when Naval asks for confirmation.
6. Fire missions goes out - BAMN BAMN BAMN - wide spread of artilery fire
7. 2 Minute reload period - no new fire mission untill 2 mins is up
8. If radio man is killed - radio option for fire mission dissapears.
thats the jist of it.. Now looking at snYpirs script confuses me - i have a bit of scripting knowledge but this is out of my league - i dont know where to start.
the user defined marker script is this:
; 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"
and this is the smoke mission:
; smoke fire mission script version 1.0
; by snYpir
; paramters:
; ----------
; 1 - name of the leader of a US infantry squad soley for the use of this script
; 2 - number of salvos of smoke to fire
; REQUIRES usermarker.sqs to be called PRIOR to calling this script
; values u can adjust
; radius of the circle in which smoke will fall
_smokeradius = 100
; colour of smoke, can be "SmokeShell" (white smoke), "SmokeShellGreen" or "SmokeShellRed"
_colour = "SmokeShellRed"
; radio msg for when script starts ("null" for none)
_startmsg = "Send coordinates for fire mission, over"
; radio msg for when rounds are inbound ("null" for none)
_inboundmsg = "Acknowledged, smoke rounds inbound, out"
; radio msg for when fire mission is complete ("null" for none)
_endmsg = "Rounds complete, out"
; radio msg for if a smoke mission is already in progress
_smokecalledmsg = "Fire mission in progress, wait out"
; end values u can adjust
; edit beyond here at own risk
; is a script already running?
? smokecalled : (_this select 0) SideChat _smokecalledmsg; exit
smokecalled = true
; make an array of the incoming group
_smokeArr = units group (_this select 0)
; set up squad that will be throwing smoke
"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
; number of smoke salvos to fire
_salvos = _this select 1
? _salvos == 0 : hint "Invalid number of salvos. Must be greater than 1."; exit
; remember the starting loc of the group
_startPos = GetPos (_this select 0)
; Y offset - needs to be increased if u put the shooters higher
userMarkerY = userMarkerY + 150
_salvocount = 1
#salvoloop
; slight pause
~2
"_x SetDammage 0" foreach _smokeArr
; throw smoke
_tmp = 0
#for1
(_smokeArr select _tmp) addmagazine _colour
(_smokeArr select _tmp) fire ["throw",_colour,_colour]
? _tmp < count _smokeArr : _tmp = _tmp + 1; goto "for1"
~2
_tmp = 0
#for2
; get random position in relation to userMarkerY
_randx = RANDOM 100
_tmprndx = RANDOM 10
_randy = RANDOM 100
_tmprndy = RANDOM 10
? _tmprndy < 5 : _randy = _randy * -1
? _tmprndx < 5 : _randx = _randx * -1
; set above firing point
(_smokeArr select _tmp) SetPos [userMarkerX+_randx,userMarkerY+_randy,1000]
; set random direction
(_smokeArr select _tmp) SetDir 180
? _tmp < count _smokeArr : _tmp = _tmp + 1; goto "for2"
; pause to throw smoke
~3
; BACK TO ORIGINAL LOCATION
_tmp = 0
#for4
(_smokeArr select _tmp) SetPos [(_startPos select 0),(_startPos select 1),0]
? _tmp < count _smokeArr : _tmp = _tmp + 1; goto "for4"
? _salvocount < _salvos : _salvocount = _salvocount + 1; goto "salvoloop"
? _endmsg != "null" : (_this select 0) SideChat _endmsg
smokecalled = false
its activated using an init field exec:
[0] exec "usermarker.sqs"
and a trigger radio exec (request fire mission):
[smoke,3] exec "smoke.sqs"
pleeeeeeeeeeeasse help... :help:
cheers
:thumbsup: