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

    1. GTANet.com

    1. GTA Online

      1. The Contract
      2. Updates
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Blood Money
      2. Frontier Pursuits
      3. Find Lobbies & Outlaws
      4. Help & Support
    3. Crews

    1. Grand Theft Auto Series

      1. Bugs*
      2. St. Andrews Cathedral
    2. GTA VI

    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Classic GTA SA
      2. Guides & Strategies
      3. Help & Support
    6. GTA Vice City

      1. Classic GTA VC
      2. Guides & Strategies
      3. Help & Support
    7. GTA III

      1. Classic GTA III
      2. Guides & Strategies
      3. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

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

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

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

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

    2. Support

    3. Suggestions

AI::TASK_PLANE_MISSION experiments


S1C88
 Share

Recommended Posts

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?

Link to comment
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
Link to comment
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)




Link to comment
Share on other sites

  • 1 month later...

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
Link to comment
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
Link to comment
Share on other sites

 

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);
Link to comment
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)

 

Link to comment
Share on other sites

  • 4 weeks later...
  • 6 years later...

Hate to resurrect an old topic from the grave, but ghat damn, there's not much research out there for these natives.  I'm playing around with it, and apparently there's a p13 argument from what I've seen around.  Anyone able to throw some additional findings on? I'm more than willing to be a ginnea pig, but as of rn, it all just seems all to unpredictable from the args I'm using atm.  :(

 

 

HELPZ PLEASEEE!

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • 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.