Hello again, Friendly community!
I have a 1vs1 CTI-type mission set up, and want to know how to get a group spawned and move to a specified marker with the onsinglemapclick command.
I have the fort set up, and a script that has everything else set up, such as creating single units, vehicles and squads that all start out in the player's group (the player that activates the action)
Averything else works fine, I just need to know how to set it up so a squad spawns that is outside the players group, then moves to a location specified by the map click.
My script starts out like this:
_base = _this select 0
?! (local server) : exit
#Start
_player = s1
Purchase = 0
publicvariable "Purchase"
~1
@Purchase > 0
_player = s1
_location = getpos _base
_x = _location select 0
_y = _location select 1
?Purchase == 10 : goto "Attack"
hint "Invalid selection"
goto "Start"
#Attack
hint format["Points Available: %1",Eastcash]
? (Westcash < 12) : goto "Start"
publicvariable "Westcash"
~0.1
_x = _x + (random 20)
_y = _y + (random 20)
_location = [_x,_y,0]
"wgl_soldierWTL" createUnit [_location, geast, "Newunit = this"]
[Newunit] join GrpNull
_Newgroup = group Newunit
"wgl_SoldierWMG" createUnit [_location, _Newgroup]
"wgl_SoldierWG" createUnit [_location, _Newgroup]
"wgl_SoldierWMAT" createUnit [_location, _Newgroup]
"wgl_SoldierWB" createUnit [_location, _Newgroup]
"wgl_SoldierWB" createUnit [_location, _Newgroup]
"wgl_SoldierWG" createUnit [_location, _Newgroup]
"wgl_SoldierWMAT" createUnit [_location, _Newgroup]
"wgl_SoldierWB" createUnit [_location, _Newgroup]
"wgl_SoldierWB" createUnit [_location, _Newgroup]
"wgl_SoldierWAR" createUnit [_location, _Newgroup]
"wgl_SoldierWMedic" createUnit [_location, _Newgroup]
_Newgroup setCombatMode "RED"
_Newgroup setskill "0.8"
Westcash = Westcash - 12
s1 Sidechat "Attack sent to Marker position."
goto "start"
What more do I have to add? (besides the actual comand to move.) Do I have to make the new squad named something? Please help me out on this guys, thanks!
Please use code tags for large slabs of code (fixed) - Planck