G'day All,
Well I'm having trouble making up a script and decided to turn to the forums. Anyone who has some constructive advice is welcome to add their $0.02 worth!
The situation: making a 'psuedo ops' mission on BAS Tonal 1 along the lines of Rhodesian SAS or Selous Scouts. I plan to make a long 'behind enemy lines' SP mission and populate the whole island with spawn scripts so that groups can be created with random unit members (for replay value). So far I have looked at other people's spawn scripts and have found they (a) do not work at all, (b) are more suitable to MP, or (c) are helpful for ideas but do not quite do what I want. Therefore I've attempted to write my own script (first time) picking the best bits out of other people's.
First, thanks to: Snypir, doolittle, TJ and Dr Strangelove cause I've been pulling your scripts apart and using bits I thought might work.
The script:
;[0,1,2,3,4,5] exec "spawnreb.sqs"
;0 name of team: "teamx"
;1 x,y,z (getMarkerpos "m") marker position where troops are spawned
;2 from 2 - 12 how many soldiers are in group ?
;3 1 - 500 (whatever) patrol radius around marker position in m
;4 1 - 99999 (whatever) how many seconds group will pause between patrols
;=================GET PARAMETERS========================
;get parameters
_team = _this select 0
_base = _this select 1
_scale = _this select 2
_radius = _this select 3
_pause = _this select 4
;============INIT VALUES================================
_cycle = 0
_types=["BAS_RebelOfficerHD","BAS_RebelSoldierHD","BAS_RebelSoldier2HD","BAS_RebelSoldier3HD","BAS_RebelSoldier4HD","BAS_RebelSoldier5HD","BAS_RebelMGunnerHD","BAS_RebelRPGSoldierHD","BAS_RebelRTOHD","BAS_RebelMedicHD","BAS_MilitiaAKMHD", "BAS_MilitiaSKSHD","BAS_MilitiaFALHD","BAS_MilitiaG3HD","BAS_MilitiaRPDHD","BAS_MilitiaPKMHD","BAS_MilitiaRPGHD", "BAS_MilitiaRPGAAHD","BAS_MilitiaRPGAPHD","BAS_MilitiaWAKMHD","BAS_MilitiaWSKSHD","BAS_MilitiaWFALHD","BAS_MilitiaWG3HD","BAS_MilitiaWRPDHD","BAS_MilitiaWPKMHD","BAS_MilitiaWRPGHD","BAS_MilitiaWRPGAAHD","BAS_MilitiaWRPGAPHD"]
;=============================SPAWN TEAM=====================
#spawnteam
_z = (random (count _types))
_z = (_z -(_z mod 1))
_guy = _types select _z
_guy createUnit [_base,_team]
_cycle = _cycle + 1
?(_cycle < _scale):goto "spawnteam"
;====================START PATROLSCRIPT===================
[_team,_radius,_pause,_base] exec "randpatrol.sqs"
In the mission I set up a trigger and a marker.
Its a detection trigger for a given radius that runs [0,1,2,3,4,5] exec "spawnreb.sqs".
The group is supposed to spawn around the marker.
The spawn script then runs the patrol script.
The spawn script is not working - can anyone see where I've gone wrong?