IPB


Welcome Guest ( Log In | Register )

 Forum Rules Forum Rules
 
Reply to this topicStart new topic
> How to make an 'Approachin Vector'?, I've seen this already in the 'airlift' script.
SGJackson
post Jun 14 2010, 23:42
Post #1


Member
***

Group: Members
Posts: 131
Joined: 22-May 10
Member No.: 7,651



Hallo all!!

I'm making a mission in the one that you have Airstrikes avaible...

Here's the deal.. i'm now using the airstike script from the Mr. Murray's editing guide.. That script, like others in the guide, are wrong... i fixed all problems in that script and even added more ammo to the plane 'cause the ammo spreaded too much and caused hardly some damage on enemies...

Now, i want to add an approachin vector to the plane.. I wanna do it by making the player to click on map (after he selected the target) and an arrow to be created pointing to the marker that marks the player's target... the plane must approach the target from behind the arrow pointing to the target...

I'll leave ya my script and check it out... see what you can do :S

CODE
setfire=true;
titleText ["Click on the map to set your firedirection","plain down"];
onMapSingleClick "ASTarget setPos _pos; setfire=false";
@!setfire;
"Firedirection" setmarkerpos getPos ASTarget;
onMapSingleClick "";
titleText ["", "plain down"];
;=========DEFINE=======================
_dropPosition = getpos ASTarget;
~0.5
_dropPosX = _dropPosition select 0;
_dropPosY = _dropPosition select 1;
_dropPosZ = _dropPosition select 2;
~0.1
_planespawnpos = [_dropPosX + 3000, _dropPosY, _dropPosZ + 1000];
;=========CREATE=======================
_PlaneG = creategroupWEST;
_plane = createVehicle ["AV8B",_planespawnpos,[], 0, "FLY"];
p1 moveindriver _plane
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),1500];
_Plane setVelocity [100,0,30];
~0.4
_plane flyinHeight 100;
_plane addmagazine "6Rnd_GBU12_AV8B"
#CHECK
P1 doMove getPos ASTarget;
P1 doTarget ASTarget;
P1 doWatch ASTarget;
? (_plane distance ASTarget) < 3000 : goto "DROP"
goto "CHECK"
;=========FIRE=======================
#DROP
_i = 0
_plane flyInHeight 100;
_plane setPos [(getPos _plane select 0),(getPos _plane select 1),100];
~13
#FIRE
_i=_i+1
_plane fire "BombLauncher";
~0.2
? _i <= 12 : goto "FIRE"
;=========FLY AWAY=======================
ASTarget setPos [0,0,0];
"Firedirection" setMarkerPos [0,0];
_plane setSpeedMode "Full"
~4
_plane flyInHeight 300;
P1 doMove getPos ASTarget;
#Check2
_plane setDamage 0;
P1 setDamage 0;
? (_plane distance Player) > 1500 : goto "ENDE";
goto "Check2"
;=========DELETE========================
#ENDE;
deleteVehicle _plane;
deleteGroup _PlaneG
exit


Best Regards, SGJackson!



EDIT: i also need to know how to create the marker by script when i click on the map and how to set it to point to the target :S

This post has been edited by SGJackson: Jun 15 2010, 00:04
 
Quote Post

Fast ReplyReply to this topicStart new topic
3 User(s) are reading this topic (3 Guests and 0 Anonymous Users)
0 Members:

 



Lo-Fi Version Time is now: 25th April 2024 - 14:38