Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. Red Dead Redemption 2

      1. Gameplay
      2. Missions
      3. Help & Support
    2. Red Dead Online

      1. Gameplay
      2. Find Lobbies & Outlaws
      3. Help & Support
    1. Crews & Posses

      1. Recruitment
    2. Events

    1. GTA Online

      1. Arena War
      2. After Hours
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA Next

    4. GTA V

      1. PC
      2. Guides & Strategies
      3. Help & Support
    5. GTA IV

      1. Episodes from Liberty City
      2. Multiplayer
      3. Guides & Strategies
      4. Help & Support
      5. GTA Mods
    6. GTA Chinatown Wars

    7. GTA Vice City Stories

    8. GTA Liberty City Stories

    9. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    10. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    11. GTA III

      1. Guides & Strategies
      2. Help & Support
      3. GTA Mods
    12. Top Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    13. Wiki

      1. Merchandising
    1. GTA Modding

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    3. Featured Mods

      1. DYOM
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Red Dead Redemption

    2. Rockstar Games

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Programming
      5. Movies & TV
      6. Music
      7. Sports
      8. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    1. News

    2. Forum Support

    3. Site Suggestions

S1C88

AI::TASK_PLANE_MISSION experiments

Recommended Posts

S1C88

I wanted to create jets to fly by and bomb a certain area - so I looked closely at the am_airstrike.c4 file. I really don't understand the rPtr and the wPtr and other stuff. I was able to pick apart some things though. What I did was I teleported to McKensie Airfield, I placed a marker on the map and spawned the aircraft. I set up a icon for friendly. Just wish I could set it as an aircraft so i know.

 

However, messing around with the AI::TASK_PLANE_MISSION variables I noticed that some of the values control the flaps, rudder and other components of the plane. It takes off but usually crashes into something. When it does take off - it soars in the sky which is nice!

 

What I've figured out so far is:

AI::TASK_PLANE_MISSION(pedHandle, vehHandle, (???),pedHandle,x,y,z,4(whatever this is), 60.0f - speed, 15.0 - not sure what this is, -1.0f - not sure what this is, SYSTEM::CEIL(50.0 + 5.0), 20);

some parts II'm able to understand the rest I'm not 100% sure. I know when you replace the 4 with the 8 does a roll.

 

Has anyone else messed with this?

Share this post


Link to post
Share on other sites
Amey.Banaye

I got that working by Editing the values :-

 Function.Call(Hash.TASK_PLANE_MISSION, pilot, selectedAirplane, 0, 0, Target.X, Target.Y, Target.Z, 4, 30f, 50f, -1f, 100, 20);

This will make the pilot fly the plane to the coordinates.

 

100 stands for the Max Speed whereas 20 stands for the minimum speed.

 

Maybe 30f,50f,-1f are the minimum distance between the target and the plane ?

 

Beware if you use this scripts on heli's the game will crash.


 Function.Call(Hash.TASK_PLANE_LAND, pilot, selectedAirplane, runwayStartPoint.X, runwayStartPoint.Y, runwayStartPoint.Z, runwayEndPoint.X, runwayEndPoint.Y, runwayEndPoint.Z); 

To land a plane.

Edited by Amey.Banaye

Share this post


Link to post
Share on other sites
Vrock_wave

I use this method for airplane it works well

AI.TASK_VEHICLE_DRIVE_TO_COORD(ped, car, hop.coodrp.x,hop.coodrp.y,hop.coodrp.z, 150, 1,ENTITY.GET_ENTITY_MODEL( car), 262144, -1.0, -1.0)




Share this post


Link to post
Share on other sites
whorse

Does anyone know how to get a plane spawned in the air (already at a high velocity) to retract its landing gear? I'd done it before somehow but now I cannot seem to get it to work. When I picked up planes with the gravity gun and tossed them a little, they would kind-of auto-recover, and they would ascend and put their landing gear away. Is there any way to check to see if the landing gear is deployed?

 

Using AI::TASK_PLANE_MISSION and AI::TASK_HELI_MISSION natives on spawned planes makes them behave much more naturally if you later command them to do something else. The Harrier (Hydra), for example, will hover-fly in its distinct way after you use TASK_PLANE_MISSION.

Edited by whorse

Share this post


Link to post
Share on other sites
fwiskalicious

Does anyone know how to get a plane spawned in the air (already at a high velocity) to retract its landing gear? I'd done it before somehow but now I cannot seem to get it to work. When I picked up planes with the gravity gun and tossed them a little, they would kind-of auto-recover, and they would ascend and put their landing gear away. Is there any way to check to see if the landing gear is deployed?

 

Using AI::TASK_PLANE_MISSION and AI::TASK_HELI_MISSION natives on spawned planes makes them behave much more naturally if you later command them to do something else. The Harrier (Hydra), for example, will hover-fly in its distinct way after you use TASK_PLANE_MISSION.

 

These work for me:

VEHICLE::_SET_VEHICLE_LANDING_GEAR(Vehicle vehicle, int state)

and

VEHICLE::_GET_VEHICLE_LANDING_GEAR(Vehicle vehicle)

 

Landing gear states:

0: Deployed

1: Closing

2: Opening

3: Retracted

 

You could try ENTITY::APPLY_FORCE_TO_ENTITY(Entity entity, int forceType, float x, float y, float z, float xRot, float yRot, float zRot, BOOL p8, BOOL isRel, BOOL ignoreUpVec, BOOL p11, BOOL p12, BOOL p13) to make the plane go forward(You'll have to look elsewhere for parameters relating to this native.)

Edited by blah265

Share this post


Link to post
Share on other sites
whorse

 

Does anyone know how to get a plane spawned in the air (already at a high velocity) to retract its landing gear? I'd done it before somehow but now I cannot seem to get it to work. When I picked up planes with the gravity gun and tossed them a little, they would kind-of auto-recover, and they would ascend and put their landing gear away. Is there any way to check to see if the landing gear is deployed?

 

Using AI::TASK_PLANE_MISSION and AI::TASK_HELI_MISSION natives on spawned planes makes them behave much more naturally if you later command them to do something else. The Harrier (Hydra), for example, will hover-fly in its distinct way after you use TASK_PLANE_MISSION.

 

These work for me:

VEHICLE::_SET_VEHICLE_LANDING_GEAR(Vehicle vehicle, int state)

and

VEHICLE::_GET_VEHICLE_LANDING_GEAR(Vehicle vehicle)

 

Landing gear states:

0: Deployed

1: Closing

2: Opening

3: Retracted

 

You could try ENTITY::APPLY_FORCE_TO_ENTITY(Entity entity, int forceType, float x, float y, float z, float xRot, float yRot, float zRot, BOOL p8, BOOL isRel, BOOL ignoreUpVec, BOOL p11, BOOL p12, BOOL p13) to make the plane go forward(You'll have to look elsewhere for parameters relating to this native.)

 

thanks so much! Those natives must have just been named recently, because there is nothing about landing gear in my natives.h file (so I just used it as "VEHICLE::_0xCFC8BE9A5E1FE575()" in my code).

 

Sorry to ask more, but do you or does anyone here know how to get a vehicle that is not usually armed to shoot missiles? I've seen mods as old as Angry Planes do it, with biplanes launching missiles out of each wingtip, but I cant seem to find much info about it online.

I've tried using these commands (below) and they work sufficiently for all vehicles that already have the hashed weapons, but planes/helis that don't have those exact weapons wont use them:

WEAPON::SET_CURRENT_PED_VEHICLE_WEAPON(pilot,GAMEPLAY::GET_HASH_KEY("VEHICLE_WEAPON_PLANE_ROCKET")); VEHICLE::SET_VEHICLE_SHOOT_AT_TARGET(pilot, target, targPos.x, targPos.y, targPos.z);

Share this post


Link to post
Share on other sites
fwiskalicious

thanks so much! Those natives must have just been named recently, because there is nothing about landing gear in my natives.h file (so I just used it as "VEHICLE::_0xCFC8BE9A5E1FE575()" in my code).

 

Sorry to ask more, but do you or does anyone here know how to get a vehicle that is not usually armed to shoot missiles? I've seen mods as old as Angry Planes do it, with biplanes launching missiles out of each wingtip, but I cant seem to find much info about it online.

I've tried using these commands (below) and they work sufficiently for all vehicles that already have the hashed weapons, but planes/helis that don't have those exact weapons wont use them:

WEAPON::SET_CURRENT_PED_VEHICLE_WEAPON(pilot,GAMEPLAY::GET_HASH_KEY("VEHICLE_WEAPON_PLANE_ROCKET"));
VEHICLE::SET_VEHICLE_SHOOT_AT_TARGET(pilot, target, targPos.x, targPos.y, targPos.z);

 

 

I'm not exactly sure if this will work, since I've never tried it, but you can try finding the vehicle's coords, then use that with GAMEPLAY::SHOOT_SINGLE_BULLET_BETWEEN_COORDS(float x1, float y1, float z1, float x2, float y2, float z2, int damage, BOOL p7, Hash weaponHash, Ped ownerPed, BOOL isAudible, BOOL p11, float speed).

 

You can play around with the values.

I have not tried this, it is a suggestion, that might work.

Here is an example of the SHOOT_SINGLE_BULLET_BETWEEN_COORDS native used to fire five airstrike rockets in front of the player:

if (callairstrike){		Vector3 coords = GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(PLAYER_PED_ID(), 0.0, 10.0, 0.0);		SHOOT_SINGLE_BULLET_BETWEEN_COORDS(coords.x + 2, coords.y + 2, coords.z + 100, coords.x, coords.y, coords.z, 200, 1, GET_HASH_KEY("WEAPON_AIRSTRIKE_ROCKET"), -1, 1, 0, 3.21283686E+09f);		WAIT(250);		SHOOT_SINGLE_BULLET_BETWEEN_COORDS(coords.x - 2, coords.y - 2, coords.z + 100, coords.x, coords.y, coords.z, 200, 1, GET_HASH_KEY("WEAPON_AIRSTRIKE_ROCKET"), -1, 1, 0, 3.21283686E+09f);		WAIT(250);		SHOOT_SINGLE_BULLET_BETWEEN_COORDS(coords.x + 2, coords.y + 2, coords.z + 100, coords.x, coords.y, coords.z, 200, 1, GET_HASH_KEY("WEAPON_AIRSTRIKE_ROCKET"), -1, 1, 0, 3.21283686E+09f);		WAIT(250);		SHOOT_SINGLE_BULLET_BETWEEN_COORDS(coords.x - 2, coords.y - 2, coords.z + 100, coords.x, coords.y, coords.z, 200, 1, GET_HASH_KEY("WEAPON_AIRSTRIKE_ROCKET"), -1, 1, 0, 3.21283686E+09f);		WAIT(250);		SHOOT_SINGLE_BULLET_BETWEEN_COORDS(coords.x + 2, coords.y + 2, coords.z + 100, coords.x, coords.y, coords.z, 200, 1, GET_HASH_KEY("WEAPON_AIRSTRIKE_ROCKET"), -1, 1, 0, 3.21283686E+09f);		}

Note: -1 is airstrike owner

3.21283686E+09f is the speed, not sure why I went with that.

You'll have to add namespaces(GAMEPLAY:: etc)

 

Share this post


Link to post
Share on other sites
gtaVmod

delete this

Edited by gtaVmod

Share this post


Link to post
Share on other sites
gtaVmod

Does anybody managed to land a plane?

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.