Jump to content
Sign in to follow this  
domcho

Waypoint problem

Recommended Posts

Hi guys. I made a blackhawk which has to come when I kill 4 squad of enemy infrantry but there is a problem. What he has to do is fly over me and my squad and drop black ops with parachutes. The problem is that he doesn't follow the waypoint as he should. The waypoint passes through the center of the trigger but he always flies away from the center and drops the black ops too far away. The helicopter has 0 ammunition, careless behaviour and I also set him to fly in height 100. I deleted everything and just left the heli. I put myself as 1 of the black ops in the helicopter and then started the mission. He follows the waypoint correctly. But when I play the mission normally, he flies too far away. I don't know why is this happening. He just doesn't want to follow the waypoint. His behaviour is careless and no one is shooting at him. I have never encountered that kind of a problem before and I find this waypoint problem very frustrating. Can you please tell me how to fix it. Thanks.

Share this post


Link to post
Share on other sites

Look it's a big problem I don't really know to do for it, but I'll try. The Followin script I've not tried.

#start

? heli1 distance player <6 : goto "Eject" 
heli flyinheight 100
[heli1, 1] setWppos getpos player
goto "Start"
#Eject
;Exec the parachute script so Black ops can eject
[] exec "scriptforparachute"
heli setVelocity [0,0,0] 
#wait
;Now add a name to last black op soldier for example put a name to blac op soldier numer 8, well if they're 8, if they are 9 or 10, so you put 10 or 9
;Let's say balck op has as name "aP"
? !(aP in heli) : goto "Moveup"
goto "wait"
#Moveup"
heli setWPpos getpos "Anypos"
;Anypos = Any pos what you want add
exit

I hope it helps

Edited by Aldo15

Share this post


Link to post
Share on other sites

hi,

Hi guys. I made a blackhawk which has to come when I kill 4 squad of enemy infrantry but there is a problem. What he has to do is fly over me and my squad and drop black ops with parachutes. The problem is that he doesn't follow the waypoint as he should. The waypoint passes through the center of the trigger but he always flies away from the center and drops the black ops too far away. The helicopter has 0 ammunition, careless behaviour and I also set him to fly in height 100. I deleted everything and just left the heli. I put myself as 1 of the black ops in the helicopter and then started the mission. He follows the waypoint correctly. But when I play the mission normally, he flies too far away. I don't know why is this happening. He just doesn't want to follow the waypoint. His behaviour is careless and no one is shooting at him. I have never encountered that kind of a problem before and I find this waypoint problem very frustrating. Can you please tell me how to fix it. Thanks.

Choppers in ofp are really pain in the ass. They never do what you want especially with waypoints. Better to use doMove command it wroks better and they are more precise.

Here's a script I wrote quickly before I go drink with friends.

spawn_blackop_chop.sqs

;*****************************************************************************************
;BlackOp Chopper Reinforcement Script by Nikiller v0.9b
;Note: Place a game logic named server on the map
;contact: nikillerofp@hotmail.fr
;;[playerName,blackOpGroupName,pilotGroupName,_spawnPosName] exec "spawn_blackop_chop.sqs"
;*****************************************************************************************

if nik_host then {} else {goto "ende"}

_player     = _this select 0
_grpblackop = _this select 1
_grppilot   = _this select 2
_pos        = _this select 3

_spawnpos=getPos _pos
_initblackop={}
_initpilot={this setCaptive true; this setCombatMode "BLUE"; this setBehaviour "CARELESS"; {this disableAI _x} forEach ["TARGET","AUTOTARGET"]}
_sk=1
_ra="CORPORAL"
_blackop="SoldierWSaboteurXMS"
_pilot="SoldierWPilot"

#spawnblackop
~0.5
_blackop createUnit [_spawnpos,_grpblackop,_initblackop,_sk,_ra]
if (({alive _x} count (units _grpblackop))<12) then {goto "spawnblackop"}

#spawncrew
~0.5
_pilot createUnit [_spawnpos,_grppilot,_initpilot,_sk,_ra]
if (({alive _x} count (units _grppilot))<2) then {goto "spawncrew"}

#spawnveh
~0.5
_ac="ENGINE ON"
_chop="UH60MG" createVehicle [0,0,0]
_chop lock true
_chop setPos [_spawnpos select 0 ,_spawnpos select 1, 1000]
_choppilot=(units _grppilot) select 0
_chopgunner=(units _grppilot) select 1
_choppilot assignAsDriver _chop
_choppilot moveInDriver _chop
_choppilot action [_ac,_chop]
_chopgunner assignAsGunner _chop
_chopgunner moveInGunner _chop
_chop setVelocity [0,0,0]
_chop flyInHeight 100
~15
_pu=getPos _player
_diru=getDir _player
_dist=750
_napchop setPos [(_pu select 0)+_dist*sin _diru,(_pu select 1)+_dist*cos _diru,+150]
{_x assignAsCargo _chop} forEach units _grpblackop
{_x moveInCargo _chop} forEach units _grpblackop

_dist=200
#movechop
~5
_chop doMove getPos _player
if ((_chop distance _player>_dist) && (canMove _chop) && (alive _player)) then {goto "movechop"}

if ((canMove _chop) && (alive _player)) then {} else {goto "ende"}

_cr=crew _chop
_cargo=_cr-[driver _chop,gunner _chop]
_i=0
_j=count _cargo
_ac="EJECT"

#next
(_cargo select _i) action [_ac,_chop]
unassignVehicle (_cargo select _i)
_i=_i+1
~0.5
?_j>_i: goto "next"

_grpblackop move getPos _player
_chop doMove [0,0,0]

#ende

exit

I have to go then I have no time to explain but it works I tested it. Study it, it is a good way to learn. You may have to tweak values in the script to obtain exactly what you want but the big part of job is done.

Here's a demo to show how it works: DEMO LINK

ps: damn it seems they even closed multiupload :eek:. Uploaded the demo on mediafire.

cya.

Nikiller.

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×