Jump to content
🛡️FORUMS ARE IN READ-ONLY MODE Read more... ×
Sign in to follow this  
Meatball0311

Adding Waypoints?

Recommended Posts

My script is nearly perfect (or as good as I can get it for now), however I am having problems with the last waypoint. This is a helo extract script which helo (UH1) is called to my location and picks me and my subordinate unit up. It flies back to base, but it is not landing (TR UNLOAD). This is my waypoints:

; creating helo waypoints

_wp1 = UH1group addWaypoint [markerPos "APPROACHmarker", 0]

[uH1group, 1] setWPPos markerPos "APPROACHmarker"

[uH1group, 1] setWaypointType "MOVE"

[uH1group, 1] setWaypointSpeed "FULL"

_wp2 = UH1group addWaypoint [markerPos "EXLZ1marker", 0]

[uH1group, 2] setWPPos markerPos "EXLZ1marker"

[uH1group, 2] setWaypointType "MOVE"

[uH1group, 2] setWaypointSpeed "FULL"

_wp3 = UH1group addWaypoint [getPos EXLZ1, 0]

[uH1group, 3] setWPPos getPos EXLZ1

[uH1group, 3] setWaypointType "LOAD"

[uH1group, 3] setWaypointSpeed "LIMITED"

_wp4 = UH1group addWaypoint [markerPos "Camp Chesty Puller", 0]

[uH1group, 4] setWPPos markerPos "Camp Chesty Puller"

[uH1group, 4] setWaypointType "MOVE"

[uH1group, 4] setWaypointSpeed "FULL"

_wp5 = UH1group addWaypoint [getPos UH1home, 0]

[uH1group, 5] setWPPos getPos UH1home

[uH1group, 5] setWaypointType "TR UNLOAD"

[uH1group, 5] setWaypointSpeed "LIMITED"

_teamwp = Team1 addWaypoint [markerPos "EXLZ1marker", 20]

[Team1, 1] setWPPos markerPos "EXLZ1marker"

[Team1, 1] setWaypointType "GETIN"

[Team1, 1] setWaypointSpeed "FULL"

[Team1, 1] setWaypointFormation "COLUMN"

[Team1, 1] synchronizeWaypoint [ [uH1group, 3] ]

_teamwp2 = Team1 addWaypoint [getPos UH1home, 0]

[Team1, 2] setWPPos getPos UH1home

[Team1, 2] setWaypointType "GETOUT"

[Team1, 2] setWaypointSpeed "FULL"

[Team1, 2] setWaypointFormation "COLUMN"

[Team1, 2] synchronizeWaypoint [ [uH1group, 5] ]

#DistanceCheck1

? (P1 distance EXLZ1) < 200 : goto "DROP"

goto "DistanceCheck1"

#DROP

_home = getPos UH1home

UH1 doWatch EXLZ1

P1 sideChat "(VULCAN ONE): 30 seconds... Over"

#assign

deleteMarker "EXLZ1marker"

EXLZ1 setPos _home

{_x assignAsCargo UH1} forEach units Team1

(units Team1) orderGetIn true

waituntil {{_x in UH1} count units Team1 == count units Team1} : goto "wp4"

#DistanceCheck2

? (SPT_R1 distance UH1home) < 200 : goto "GETOUT"

goto "DistanceCheck2"

#GETOUT

{unassignVehicle _x} forEach units Team1

(units Team1) orderGetIn false

exit

---------- Post added at 11:14 PM ---------- Previous post was at 10:01 PM ----------

oops... fixed problem. Now helo will come to where ever position I onMapSingleClick on, then my subordinate unit will mount and the helo will fly back to base and land and unit will GETOUT.

If anyone sees any script errors I may have made, would you be kind enough to tell me. Thanks for your time.

; ****************************************************************

; Script file for Armed Assault

; Created by: TODO: Author Name

; ****************************************************************

; Calling for EXTRACTION

; Must place 4 Empty Helo LZ

; this exec "helo_extract.sqs"

; create LZ map markers

_exlz1 = createMarker["EXLZ1marker",getPos CARNAGE]

_exlz1 setMarkerShape "ICON"

"EXLZ1marker" setMarkerType "mil_triangle"

"EXLZ1marker" setMarkerSize [.5, .5]

"EXLZ1marker" setMarkerColor "ColorOrange"

"EXLZ1marker" setMarkerText "1"

_approach = createMarker["APPROACHmarker",getPos CARNAGE]

_approach setMarkerShape "ICON"

"APPROACHmarker" setMarkerType "Pickup"

"APPROACHmarker" setMarkerSize [.5, .5]

"APPROACHmarker" setMarkerColor "ColorGreen"

~0.5

player sideChat ": Carnage this is Spartan.... Over."

setfire=true

~3

CARNAGE sideChat "(CARNAGE): This is Carnage... send your traffic. Over."

~2

titleText ["CLICK ON MAP TO SET HELO EXTRACT GRID","plain down"]

~1

; set extaction LZ

onMapSingleClick "EXLZ1 setPosATL _pos; setfire=false; onMapSingleClick ''; true"

@!setfire

~1

; set H (invisible) objects in Y formation

_pos = position EXLZ1

_posx = _pos select 0

_posy = _pos select 1

_posz = _pos select 2

_ang1 = -((wind select 0) atan2 (wind select 1))

~0.01

_ang2 = -((wind select 0) atan2 (wind select 1))

~0.01

_ang3 = -((wind select 0) atan2 (wind select 1))

~0.01

_avgang = (_ang1 + _ang2 + _ang3) / 3

APPROACH setPosATL [_posx + sin(_avgang)* 0,_posy + cos(_avgang)* - 2000,0]

EXLZ1 setDir _avgang

APPROACH setDir _avgang

; moving LZ markers to H (invisible) positions

;

"EXLZ1marker" setmarkerpos getPos EXLZ1

"APPROACHmarker" setmarkerpos getPos APPROACH

"EXLZ1marker" setMarkerDir _avgang

"APPROACHmarker" setMarkerDir _avgang

onMapSingleClick "";

titleText ["", "plain down"]

~3

player sideChat "- Request Helo Extract... grid 3.. 7.. 4.. 8.. 9'er.. 2. Over"

~2

CARNAGE sideChat "(CARNAGE)- We copy grid 3 7 4 8 9'er 2... Helo's on the way. Out"

~0.1

; setting spawning locations for pilots

_UH1spawn = getMarkerPos "UH1tent"

; create pilots type createUnit [ position, group, init, skill, rank]

UH1group = createGroup WEST

_p1 = "USMC_Soldier_Pilot" createUnit [_UH1spawn, UH1group, "P1=this", 1, "MAJOR"]

_n1 = "USMC_Soldier_Pilot" createUnit [_UH1spawn, UH1group, "N1=this", 1, "LIEUTENANT"]

_gunner1 = "USMC_Soldier_Crew" createUnit [_UH1spawn, UH1group, "G1=this", 1, "PRIVATE"]

_gunner2 = "USMC_Soldier_Crew" createUnit [_UH1spawn, UH1group, "G2=this", 1, "PRIVATE"]

P1 = leader UH1group

P1 setFace "face12"

N1 setFace "face54"

G1 setFace "face13"

G2 setFace "face14"

P1 assignAsDriver UH1

P1 moveInDriver UH1

N1 assignAsGunner UH1

N1 moveInTurret [uH1, [2]]

G1 assignAsGunner UH1

G1 moveInTurret [uH1,[0]]

G2 assignAsGunner UH1

G2 moveInTurret [uH1,[1]]

~1

; creating helo waypoints

_wp1 = UH1group addWaypoint [markerPos "APPROACHmarker", 0]

[uH1group, 1] setWPPos markerPos "APPROACHmarker"

[uH1group, 1] setWaypointType "MOVE"

[uH1group, 1] setWaypointSpeed "FULL"

_wp2 = UH1group addWaypoint [markerPos "EXLZ1marker", 0]

[uH1group, 2] setWPPos markerPos "EXLZ1marker"

[uH1group, 2] setWaypointType "MOVE"

[uH1group, 2] setWaypointSpeed "FULL"

_wp3 = UH1group addWaypoint [getPos EXLZ1, 0]

[uH1group, 3] setWPPos getPos EXLZ1

[uH1group, 3] setWaypointType "LOAD"

[uH1group, 3] setWaypointSpeed "LIMITED"

_wp4 = UH1group addWaypoint [markerPos "Camp Chesty Puller", 0]

[uH1group, 4] setWPPos markerPos "Camp Chesty Puller"

[uH1group, 4] setWaypointType "MOVE"

[uH1group, 4] setWaypointSpeed "FULL"

_wp5 = UH1group addWaypoint [getPos UH1home, 0]

[uH1group, 5] setWPPos getPos UH1home

[uH1group, 5] setWaypointType "GETOUT"

[uH1group, 5] setWaypointSpeed "LIMITED"

_teamwp = Team1 addWaypoint [markerPos "EXLZ1marker", 20]

[Team1, 1] setWPPos markerPos "EXLZ1marker"

[Team1, 1] setWaypointType "GETIN"

[Team1, 1] setWaypointSpeed "FULL"

[Team1, 1] setWaypointFormation "COLUMN"

[Team1, 1] synchronizeWaypoint [ [uH1group, 3] ]

_teamwp2 = Team1 addWaypoint [getPos UH1home, 0]

[Team1, 2] setWPPos getPos UH1home

[Team1, 2] setWaypointType "GETOUT"

[Team1, 2] setWaypointSpeed "FULL"

[Team1, 2] setWaypointFormation "COLUMN"

[Team1, 2] synchronizeWaypoint [ [uH1group, 5] ]

#DistanceCheck1

? (P1 distance EXLZ1) < 200 : goto "DROP"

goto "DistanceCheck1"

#DROP

_home = getPos UH1home

UH1 doWatch EXLZ1

P1 sideChat "(VULCAN ONE): 30 seconds... Over"

#assign

deleteMarker "EXLZ1marker"

EXLZ1 setPos _home

{_x assignAsCargo UH1} forEach units Team1

(units Team1) orderGetIn true

waituntil {{_x in UH1} count units Team1 == count units Team1} : goto "DistanceCheck2"

#DistanceCheck2

? (SPT_R1 distance UH1home) < 200 : goto "GETOUT"

goto "DistanceCheck2"

#GETOUT

{unassignVehicle _x} forEach units Team1

exit

Edited by Meatball0311

Share this post


Link to post
Share on other sites
Sign in to follow this  

×