Hi you scripting guru's
i'm still fooling around with a createunit script.....no no, creating units works fine....the setgroupid makes me some troubles.
afaik you can have 12 soldiers in one group, Group ID's are GroupAlpha to GroupKilo and theres also a possibility to create 8 different colors, say GroupAlpha Groupcolor0, GroupAlpha GroupColor1 and so on......but when i try to use this on my script created units, it wont work...may some of you scripting god's take a look on this and tell me what i'm doing wrong....oh, and i also tried with variations of "" () [] {}
here comes the script:
; InfPatrol.sqs
;*******************************************************************************************
; Script to insert East Patrols during mission
; written by [sT]-Myke-[CO]
;*******************************************************************************************
; Insert a single Unit and put the following in it's INIT box:
; GroupAlpha=group this; deletevehicle this
; valid group names are: ALPHA, BRAVO, CHARLIE, DELTA, ECHO, FOXTROT, GOLF, HOTEL, KILO
; Valid group Colors are: Groupcolor0 to Groupcolor7
;*******************************************************************************************
; Two markers are needed:
; Creating point (marker1)
; Moving point (marker2)
;*******************************************************************************************
; 3 Different Patrols are supported
; Standard Infantry (INF)
; Anti Tank Infantry (AT)
; Anti Air Infantry (AA)
;*******************************************************************************************
; ["INF", "marker1", "marker2", GroupAlpha, "GroupColor0"] exec "InfPatrol.sqs" <-----do not take this as you see it....tried with and without "" at groupcolor
; check if script runs on Server (create a GL named "Server")
?!local Server: exit
; getting the settings
_type = _this select 0
_pos = _this select 1
_target = _this select 2
_group = _this select 3
_color = _this select 4
; jump to the corresponding patrol
?(_type == "INF"): Goto "inf"
?(_type == "AT"): Goto "at"
?(_type == "AA"): Goto "aa"
; No type was found so alert creator theres a typo
_errorText = Format["ERROR: INVALID TYPE %0", _type]
Hint _errorText
Exit
; Creating the standard Infantry Patrol
#inf
"OfficerE" CreateUnit [[GetMarkerPos _pos select 0, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 1, "LIEUTENANT"]
"SoldierEMG" CreateUnit [[(GetMarkerPos _pos select 0) +3, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.9, "SERGEANT"]
"SoldierELAW" CreateUnit [[(GetMarkerPos _pos select 0) +6, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "CORPORAL"]
"SoldierEMedic" CreateUnit [[(GetMarkerPos _pos select 0) +9, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEB" CreateUnit [[(GetMarkerPos _pos select 0) +12, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEB" CreateUnit [[(GetMarkerPos _pos select 0) +15, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEMG" CreateUnit [[(GetMarkerPos _pos select 0) +18, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierELAW" CreateUnit [[(GetMarkerPos _pos select 0) +21, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEB" CreateUnit [[(GetMarkerPos _pos select 0) +24, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEB" CreateUnit [[(GetMarkerPos _pos select 0) +27, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEMG" CreateUnit [[(GetMarkerPos _pos select 0) +30, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEB" CreateUnit [[(GetMarkerPos _pos select 0) +33, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
goto "target"
; Creating AT Infantry Patrol
#at
"OfficerE" CreateUnit [[GetMarkerPos _pos select 0, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 1, "LIEUTENANT"]
"SoldierEMG" CreateUnit [[(GetMarkerPos _pos select 0) +3, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.9, "SERGEANT"]
"SoldierELAW" CreateUnit [[(GetMarkerPos _pos select 0) +6, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "CORPORAL"]
"SoldierEMedic" CreateUnit [[(GetMarkerPos _pos select 0) +9, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEAT" CreateUnit [[(GetMarkerPos _pos select 0) +12, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierELAW" CreateUnit [[(GetMarkerPos _pos select 0) +15, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEMG" CreateUnit [[(GetMarkerPos _pos select 0) +18, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierELAW" CreateUnit [[(GetMarkerPos _pos select 0) +21, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEB" CreateUnit [[(GetMarkerPos _pos select 0) +24, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierELAW" CreateUnit [[(GetMarkerPos _pos select 0) +27, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEAT" CreateUnit [[(GetMarkerPos _pos select 0) +30, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierELAW" CreateUnit [[(GetMarkerPos _pos select 0) +33, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
goto "target"
; Creating AA Infantry Patrol
#aa
"OfficerE" CreateUnit [[GetMarkerPos _pos select 0, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 1, "LIEUTENANT"]
"SoldierEMG" CreateUnit [[(GetMarkerPos _pos select 0) +3, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.9, "SERGEANT"]
"SoldierELAW" CreateUnit [[(GetMarkerPos _pos select 0) +6, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "CORPORAL"]
"SoldierEMedic" CreateUnit [[(GetMarkerPos _pos select 0) +9, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEAA" CreateUnit [[(GetMarkerPos _pos select 0) +12, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEAA" CreateUnit [[(GetMarkerPos _pos select 0) +15, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEMG" CreateUnit [[(GetMarkerPos _pos select 0) +18, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierELAW" CreateUnit [[(GetMarkerPos _pos select 0) +21, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEAA" CreateUnit [[(GetMarkerPos _pos select 0) +24, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEAA" CreateUnit [[(GetMarkerPos _pos select 0) +27, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEMG" CreateUnit [[(GetMarkerPos _pos select 0) +30, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
"SoldierEAA" CreateUnit [[(GetMarkerPos _pos select 0) +33, getmarkerpos _pos select 1], _group, "this setgroupid [_group, _color]", 0.8, "PRIVATE"]
goto "target"
; Set Group Settings
#target
_group setBehaviour "COMBAT"
_group setCombatMode "RED"
_group move getMarkerPos _target
exit
End of Script
And just to have it said....i use 1.46....no asking why, i have my reasons