Jump to content
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Drug Wars
      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

Dogfight mod


archey
 Share

Recommended Posts

Title should be WWII Dogfight mod

 

I am making a dogfight mod. but first i have to make the spawns before i make the mission.

 

This is my code(its in cleo)

 

 

0000:{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------wait 0014B: [email protected] = init_parked_car_generator #HYDRA 15 15 1 alarm 0 door_lock 0 0 0 1949.9075 -2468.5159 14.4507 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1941.3899 -2464.4365 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #HUNTER 15 15 1 alarm 0 door_lock 0 0 0 1932.2135 -2466.2974 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #MAVERICK 15 15 1 alarm 0 door_lock 0 0 0 1920.3357 -2464.6162 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #HYDRA 15 15 1 alarm 0 door_lock 0 0 0 1909.7432 -2464.8621 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1900.1609 -2465.8313 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1891.2594 -2466.3926 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #HUNTER 15 15 1 alarm 0 door_lock 0 0 0 1882.1078 -2464.728 13.5547 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #RHINO 15 15 1 alarm 0 door_lock 0 0 0 1873.197 -2466.0081 13.5547 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101:gunswait 0032B: [email protected] = create_weapon_pickup #M4  15 ammo  30000 at 1949.61 -2472.6 13.5391032B: [email protected] = create_weapon_pickup #AK47  15 ammo  30000 at 1946.83 -2472.6 13.5391032B: [email protected] = create_weapon_pickup #COLT45  15 ammo  2000 at 1943.74 -2472.6 13.5391032B: [email protected] = create_weapon_pickup #SATCHEL  15 ammo  300 at 1940.07 -2472.6 13.5391032B: [email protected] = create_weapon_pickup #GRENADE  15 ammo  200 at 1938.88 -2472.4 13.5391032B: [email protected] = create_weapon_pickup #TEC9  15 ammo  20000 at 1935.51 -2472.7 13.5391032B: [email protected] = create_weapon_pickup #MP5LNG  15 ammo  25000 at 1933.47 -2473.6 13.5391004E: end_custom_thread

 

help me please?

this mod will take me awhile to make since I am planning on doing most of the coding myself.

 

how would will i make the mission starter and and how will i make an NPC fly around in a hydra and try to kill CJ?

Edited by archey
Link to comment
Share on other sites

Title should be WWII Dogfight mod

 

I am making a dogfight mod. but first i have to make the spawns before i make the mission.

 

This is my code(its in cleo)

 

 

0000:{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------:cars004f: create_thread @Cars014B: $mycarx00 = init_parked_car_generator #HYDRA 15 15 1 alarm 0 door_lock 0 0 0 1949.9075 -2468.5159 14.4507 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1941.3899 -2464.4365 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #HUNTER 15 15 1 alarm 0 door_lock 0 0 0 1932.2135 -2466.2974 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #MAVERICK 15 15 1 alarm 0 door_lock 0 0 0 1920.3357 -2464.6162 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #HYDRA 15 15 1 alarm 0 door_lock 0 0 0 1909.7432 -2464.8621 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1900.1609 -2465.8313 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1891.2594 -2466.3926 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #HUNTER 15 15 1 alarm 0 door_lock 0 0 0 1882.1078 -2464.728 13.5547 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #RHINO 15 15 1 alarm 0 door_lock 0 0 0 1873.197 -2466.0081 13.5547 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101004E: end_custom_thread:guns004f: create_thread @Guns032B: $M4 = create_weapon_pickup #M4  15 ammo  30000 at 1949.61 -2472.6 13.5391032B: $ak = create_weapon_pickup #AK47  15 ammo  30000 at 1946.83 -2472.6 13.5391032B: $Deagle = create_weapon_pickup #COLT45  15 ammo  2000 at 1943.74 -2472.6 13.5391032B: $satchel = create_weapon_pickup #SATCHEL  15 ammo  300 at 1940.07 -2472.6 13.5391032B: $Gernade = create_weapon_pickup #GRENADE  15 ammo  200 at 1938.88 -2472.4 13.5391032B: $Tec9 = create_weapon_pickup #TEC9  15 ammo  20000 at 1935.51 -2472.7 13.5391032B: $SMG = create_weapon_pickup #MP5LNG  15 ammo  25000 at 1933.47 -2473.6 13.5391004E: end_custom_thread

 

help me please?

this mod will take me awhile to make since I am planning on doing most of the coding myself.

 

how would will i make the mission starter and and how will i make an NPC fly around in a hydra and try to kill CJ?

Newbie coders should not try missions. Besides, all these generators can be done in the mission

Link to comment
Share on other sites

Correct me if im wrong, but doesnt it cause problem because you use the same variables for every spawn?

 

You use $mycarx00 for every spawn.

 

And if it works you only have to use the 014B once as it will let all those cars spawn in one opcode then, reducing the amount of lines

Link to comment
Share on other sites

 

Title should be WWII Dogfight mod

 

I am making a dogfight mod. but first i have to make the spawns before i make the mission.

 

This is my code(its in cleo)

 

 

0000:{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------:cars004f: create_thread @Cars014B: $mycarx00 = init_parked_car_generator #HYDRA 15 15 1 alarm 0 door_lock 0 0 0 1949.9075 -2468.5159 14.4507 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1941.3899 -2464.4365 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #HUNTER 15 15 1 alarm 0 door_lock 0 0 0 1932.2135 -2466.2974 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #MAVERICK 15 15 1 alarm 0 door_lock 0 0 0 1920.3357 -2464.6162 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #HYDRA 15 15 1 alarm 0 door_lock 0 0 0 1909.7432 -2464.8621 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1900.1609 -2465.8313 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1891.2594 -2466.3926 13.5391 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #HUNTER 15 15 1 alarm 0 door_lock 0 0 0 1882.1078 -2464.728 13.5547 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101014B: $mycarx00 = init_parked_car_generator #RHINO 15 15 1 alarm 0 door_lock 0 0 0 1873.197 -2466.0081 13.5547 angle 0.0014C: set_parked_car_generator $mycarx00 cars_to_generate_to 101004E: end_custom_thread:guns004f: create_thread @Guns032B: $M4 = create_weapon_pickup #M4  15 ammo  30000 at 1949.61 -2472.6 13.5391032B: $ak = create_weapon_pickup #AK47  15 ammo  30000 at 1946.83 -2472.6 13.5391032B: $Deagle = create_weapon_pickup #COLT45  15 ammo  2000 at 1943.74 -2472.6 13.5391032B: $satchel = create_weapon_pickup #SATCHEL  15 ammo  300 at 1940.07 -2472.6 13.5391032B: $Gernade = create_weapon_pickup #GRENADE  15 ammo  200 at 1938.88 -2472.4 13.5391032B: $Tec9 = create_weapon_pickup #TEC9  15 ammo  20000 at 1935.51 -2472.7 13.5391032B: $SMG = create_weapon_pickup #MP5LNG  15 ammo  25000 at 1933.47 -2473.6 13.5391004E: end_custom_thread

 

help me please?

this mod will take me awhile to make since I am planning on doing most of the coding myself.

 

how would will i make the mission starter and and how will i make an NPC fly around in a hydra and try to kill CJ?

Newbie coders should not try missions. Besides, all these generators can be done in the mission

awe okay, well ill still try every now and then

Link to comment
Share on other sites

Correct me if im wrong, but doesnt it cause problem because you use the same variables for every spawn?

 

You use $mycarx00 for every spawn.

 

And if it works you only have to use the 014B once as it will let all those cars spawn in one opcode then, reducing the amount of lines

Using the same variable for each generator isn't a problem.... or is it just my game???

Link to comment
Share on other sites

i guess i have to use locals in CLEO not globals so my code is now

0000:{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------wait 0014B: [email protected] = init_parked_car_generator #HYDRA 15 15 1 alarm 0 door_lock 0 0 0 1949.9075 -2468.5159 14.4507 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1941.3899 -2464.4365 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #HUNTER 15 15 1 alarm 0 door_lock 0 0 0 1932.2135 -2466.2974 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #MAVERICK 15 15 1 alarm 0 door_lock 0 0 0 1920.3357 -2464.6162 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #HYDRA 15 15 1 alarm 0 door_lock 0 0 0 1909.7432 -2464.8621 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1900.1609 -2465.8313 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #PATRIOT 15 15 1 alarm 0 door_lock 0 0 0 1891.2594 -2466.3926 13.5391 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #HUNTER 15 15 1 alarm 0 door_lock 0 0 0 1882.1078 -2464.728 13.5547 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101014B: [email protected] = init_parked_car_generator #RHINO 15 15 1 alarm 0 door_lock 0 0 0 1873.197 -2466.0081 13.5547 angle 0.0014C: set_parked_car_generator [email protected] cars_to_generate_to 101:gunswait 0032B: [email protected] = create_weapon_pickup #M4  15 ammo  30000 at 1949.61 -2472.6 13.5391032B: [email protected] = create_weapon_pickup #AK47  15 ammo  30000 at 1946.83 -2472.6 13.5391032B: [email protected] = create_weapon_pickup #COLT45  15 ammo  2000 at 1943.74 -2472.6 13.5391032B: [email protected] = create_weapon_pickup #SATCHEL  15 ammo  300 at 1940.07 -2472.6 13.5391032B: [email protected] = create_weapon_pickup #GRENADE  15 ammo  200 at 1938.88 -2472.4 13.5391032B: [email protected] = create_weapon_pickup #TEC9  15 ammo  20000 at 1935.51 -2472.7 13.5391032B: [email protected] = create_weapon_pickup #MP5LNG  15 ammo  25000 at 1933.47 -2473.6 13.5391004E: end_custom_thread

 

Link to comment
Share on other sites

 

Newbie coders should not try missions. Besides, all these generators can be done in the mission

That shows a poor attitude. I started this sh1t back in late August and never touched on CLEO yet. I have been working directly with the main.scm and I am almost done with my conversion... I wonder what you base you "noobish" opinion on? So people with little or no knowledge have no rights to learn to swim in the big boys pool?

 

Archey, decompile the main.scm using Sanny Builder and review the *missions line by line. Take your time, and I will get back with you on this subject. Also read my tutorial on how things work. My Tutorial Here I don't work with CLEO yet but you can convert my codes to CLEO.

 

*Missions that resemble what you are trying to accomplish:

 

  • @DESERT6 -- N.O.E.
  • @MANSIO2 -- Vertical Bird

Both of these missions will give you the tools you need to create your own.

 

JAB

Link to comment
Share on other sites

 

Newbie coders should not try missions. Besides, all these generators can be done in the mission

That shows a poor attitude. I started this sh1t back in late August and never touched on CLEO yet. I have been working directly with the main.scm and I am almost done with my conversion... I wonder what you base you "noobish" opinion on? So people with little or no knowledge have no rights to learn to swim in the big boys pool?

 

Archey, decompile the main.scm using Sanny Builder and review the *missions line by line. Take your time, and I will get back with you on this subject. Also read my tutorial on how things work. My Tutorial Here I don't work with CLEO yet but you can convert my codes to CLEO.

 

*Missions that resemble what you are trying to accomplish:

 

 

@DESERT6 -- N.O.E.

 

 

@MANSIO2 -- Vertical Bird

 

 

Both of these missions will give you the tools you need to create your own.

 

JAB

ZAZ, one of the best coders ever said that new coders should not try missions in his cleo mods topic I think

 

Oh, the way you say it, it's like learning to ride a bike, then straight jumping to ride a unicycle

 

You work your way up, not jump your way up

Link to comment
Share on other sites

Correct me if im wrong, but doesnt it cause problem because you use the same variables for every spawn?

 

You use $mycarx00 for every spawn.

 

And if it works you only have to use the 014B once as it will let all those cars spawn in one opcode then, reducing the amount of lines

Using the same variable for each generator isn't a problem.... or is it just my game???

Ok, but why then using the opcode that does the same thing is added more then once?

 

That is useless as it is only one time needed

Link to comment
Share on other sites

Correct me if im wrong, but doesnt it cause problem because you use the same variables for every spawn?

 

You use $mycarx00 for every spawn.

 

And if it works you only have to use the 014B once as it will let all those cars spawn in one opcode then, reducing the amount of lines

Using the same variable for each generator isn't a problem.... or is it just my game???

Ok, but why then using the opcode that does the same thing is added more then once?

 

That is useless as it is only one time needed

It's called rewritting variables...

 

I did exactly the same as archey did. As long as your not gonna do something with the car later, you can do what archey did

 

 

 

You probably know that, but... well...

 

 

Link to comment
Share on other sites

 

ZAZ, one of the best coders ever said that new coders should not try missions in his cleo mods topic I think

 

Oh, the way you say it, it's like learning to ride a bike, then straight jumping to ride a unicycle

 

You work your way up, not jump your way up

Yes, Zaz is a great mod coder and so is spaceeinstein, illspirit, odie, pdescobar, Steve M, among others. While I can respect their talent, I cannot condone any modder telling a noob they shouldn't try their best. I am not trying to put words in your mouth. I just happen to be a noob at coding and I personally do jump on the unicycle (if that is what I desire to learn). I admire archey's posting for the following reasons:

 

1. He is not coming in empty handed, he shows his code.

2. He is willing to learn, even if it takes long time.

 

this mod will take me awhile to make since I am planning on doing most of the coding myself.

3. He is not asking us to do this for him as he stated he desires to "do it himself".

4. He is direct and to the point.

 

how would will i make the mission starter and and how will i make an NPC fly around in a hydra and try to kill CJ?

 

I have nothing but respect for you (james227uk) as modder, I dropped by your site once to see what you have accomplished. I am just asking why would you write a one line stinger to a person who is asking for our help? I hope, I have made my point and wish to get back on topic and help archey. Thanks.

 

Archey,

 

I hope you have checked out the main.scm and here are some things I wanted to point out yesterday. Unfortunately I was full of turkey and passed out watching the game on TV.

 

If you examine NOE aka mission 79, you will see these lines that call to create the airplanes. They are roughly 70 lines down past the mission thread.

 

 

[email protected] = Car.Create(#RUSTLER, 0.0, 0.0, 0.0):[email protected]([email protected],2i) = Car.Create(#HYDRA, 0.0, 0.0, 0.0)[email protected] += 1  [email protected] >= 2 else_jump @DESERT6_463 [email protected] = 0 

 

 

The first code calls up 1 Rustler which is of course your plane and then 2 Hydra that chase you. After that the next few lines of code create pilots and ammo capsules. It just creates them it doesn't actually park them you will find the parking coord of your plane down at :DESERT6_4103.

 

About 200 lines in we see this:

 

 

:DESERT6_1162if  [email protected] == 0 else_jump @DESERT6_1228 00BC: show_text_highpriority GXT 'DES6_00' time 7000 flag 1  // ~s~The ~b~plane~s~ is all loaded up and ready to go.gosub @DESERT6_6258 [email protected] = 1 gosub @DESERT6_7633 041E: set_radio_station 11 [email protected] += 1 

 

 

This code sends the text out to the screen. If you want to change the text you will need another program to change the GXT file. Then it sets your radio station on 11 and I think that might be K-Dust? Not sure.

 

 

[email protected] = -2135.59 [email protected] = -2488.454 [email protected] = 55.895 018A: [email protected] = create_checkpoint_at [email protected] [email protected] [email protected] 0087: [email protected] = [email protected] // (float) [email protected] += 1.0 06D5: [email protected] = create_racing_checkpoint_at [email protected] [email protected] [email protected] point_to [email protected] [email protected] [email protected] type 3 radius 25.0

 

 

I really don't know why but the main.scm always seems bloated with unused variables. Why not just say this:

 

 

018A: [email protected] = create_checkpoint_at -2135.59  -2488.454 55.895  06D5: [email protected] = create_racing_checkpoint_at -2135.59  -2488.454 55.895  point_to -2135.59  -2487.454 55.895  type 3 radius 25.0

 

 

This sets up racing check points for your mission. And as we all know this mission is tough for most players due to the fact if you get above radar those hydras attack without mercy.

 

 

$7499 *= 60000 03C3: set_timer_to $7499 type 1 GXT 'DES6_51' // global_variable  // Timer0819: [email protected] = actor $PLAYER_ACTOR distance_from_ground 

 

 

This sets the mission timer and shoves the altitude into the variable [email protected]

 

Now for the meat of this mission, this is the routine you will want to really tear into:

 

 

:DESERT6_5600Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])[email protected] = 0 :DESERT6_5621if  [email protected]([email protected],2i) == 0 else_jump @DESERT6_6008 0209: [email protected] = random_int_in_ranges 150 200 0093: [email protected] = integer [email protected] to_float 0209: [email protected] = random_int_in_ranges 0 2 if  [email protected] == 0 else_jump @DESERT6_5704 005B: [email protected] += [email protected] // (float) jump @DESERT6_5712 :DESERT6_57040063: [email protected] -= [email protected] // (float) :DESERT6_57120209: [email protected] = random_int_in_ranges 150 200 0093: [email protected] = integer [email protected] to_float 0209: [email protected] = random_int_in_ranges 0 2 if  [email protected] == 0 else_jump @DESERT6_5773 005B: [email protected] += [email protected] // (float) jump @DESERT6_5781 :DESERT6_57730063: [email protected] -= [email protected] // (float) :DESERT6_578102CE: [email protected] = ground_z_at [email protected] [email protected] [email protected] 092E: get_water_height_at [email protected] [email protected] flag 0 store_to [email protected] if 0025:   [email protected] > [email protected] // (float) else_jump @DESERT6_5835 0087: [email protected] = [email protected] // (float) :DESERT6_58350087: [email protected] = [email protected] // (float) [email protected] += 200.0 [email protected]([email protected],2i) = Car.Create(#HYDRA, [email protected], [email protected], [email protected])0745: set_hydra [email protected]([email protected],2i) thrust_to_horizontal 070E: hydra [email protected]([email protected],2i) attack_player_car $PLAYER_CHAR radius 10.0 [email protected]([email protected],2i) = Marker.CreateAboveCar([email protected]([email protected],2i))018B: set_marker [email protected]([email protected],2i) radar_mode 2 0129: [email protected]([email protected],2i) = create_actor_pedtype 4 model #HMORI in_car [email protected]([email protected],2i) driverseat 060B: set_actor [email protected]([email protected],2i) decision_maker_to [email protected] [email protected]([email protected],2i) = 0 [email protected]([email protected],2i) = 0 [email protected]([email protected],2i) = 1 [email protected] = 0 [email protected] = 1 return 

 

 

The first thing this does is store the player's x,y,z coords to variables [email protected], [email protected], [email protected]

Next it creates those hydra at random coords based on your location. As a personal note if I were creating this code I would have them take off from the nearest airport for a more realistic mission.

 

Opcode 070E tells the hydra to attack the player's car (should be vehicle) biggrin.gif

Opcode 060B tells the AI to make decisions based on the variables of the mission.

 

Now if I haven't frightened you off, I will stop back in here and see if you need more assistance. Be sure to post any code you are working on or post any questions you need help with. I don't have all the answers but there is a large friendly community here willing to help those who help themselves.

 

Keep Cool,

JAB

Link to comment
Share on other sites

ZAZ, one of the best coders ever said that new coders should not try missions in his cleo mods topic I think

 

Oh, the way you say it, it's like learning to ride a bike, then straight jumping to ride a unicycle

 

You work your way up, not jump your way up

Yes, Zaz is a great mod coder and so is spaceeinstein, illspirit, odie, pdescobar, Steve M, among others. While I can respect their talent, I cannot condone any modder telling a noob they shouldn't try their best. I am not trying to put words in your mouth. I just happen to be a noob at coding and I personally do jump on the unicycle (if that is what I desire to learn). I admire archey's posting for the following reasons:

 

1. He is not coming in empty handed, he shows his code.

2. He is willing to learn, even if it takes long time.

 

this mod will take me awhile to make since I am planning on doing most of the coding myself.

3. He is not asking us to do this for him as he stated he desires to "do it himself".

4. He is direct and to the point.

 

how would will i make the mission starter and and how will i make an NPC fly around in a hydra and try to kill CJ?

 

I have nothing but respect for you (james227uk) as modder, I dropped by your site once to see what you have accomplished. I am just asking why would you write a one line stinger to a person who is asking for our help? I hope, I have made my point and wish to get back on topic and help archey. Thanks.

 

Archey,

 

I hope you have checked out the main.scm and here are some things I wanted to point out yesterday. Unfortunately I was full of turkey and passed out watching the game on TV.

 

If you examine NOE aka mission 79, you will see these lines that call to create the airplanes. They are roughly 70 lines down past the mission thread.

 

 

[email protected] = Car.Create(#RUSTLER, 0.0, 0.0, 0.0):[email protected]([email protected],2i) = Car.Create(#HYDRA, 0.0, 0.0, 0.0)[email protected] += 1  [email protected] >= 2 else_jump @DESERT6_463 [email protected] = 0 

 

 

The first code calls up 1 Rustler which is of course your plane and then 2 Hydra that chase you. After that the next few lines of code create pilots and ammo capsules. It just creates them it doesn't actually park them you will find the parking coord of your plane down at :DESERT6_4103.

 

About 200 lines in we see this:

 

 

:DESERT6_1162if  [email protected] == 0 else_jump @DESERT6_1228 00BC: show_text_highpriority GXT 'DES6_00' time 7000 flag 1  // ~s~The ~b~plane~s~ is all loaded up and ready to go.gosub @DESERT6_6258 [email protected] = 1 gosub @DESERT6_7633 041E: set_radio_station 11 [email protected] += 1 

 

 

This code sends the text out to the screen. If you want to change the text you will need another program to change the GXT file. Then it sets your radio station on 11 and I think that might be K-Dust? Not sure.

 

 

[email protected] = -2135.59 [email protected] = -2488.454 [email protected] = 55.895 018A: [email protected] = create_checkpoint_at [email protected] [email protected] [email protected] 0087: [email protected] = [email protected] // (float) [email protected] += 1.0 06D5: [email protected] = create_racing_checkpoint_at [email protected] [email protected] [email protected] point_to [email protected] [email protected] [email protected] type 3 radius 25.0

 

 

I really don't know why but the main.scm always seems bloated with unused variables. Why not just say this:

 

 

018A: [email protected] = create_checkpoint_at -2135.59  -2488.454 55.895  06D5: [email protected] = create_racing_checkpoint_at -2135.59  -2488.454 55.895  point_to -2135.59  -2487.454 55.895  type 3 radius 25.0

 

 

This sets up racing check points for your mission. And as we all know this mission is tough for most players due to the fact if you get above radar those hydras attack without mercy.

 

 

$7499 *= 60000 03C3: set_timer_to $7499 type 1 GXT 'DES6_51' // global_variable  // Timer0819: [email protected] = actor $PLAYER_ACTOR distance_from_ground 

 

 

This sets the mission timer and shoves the altitude into the variable [email protected]

 

Now for the meat of this mission, this is the routine you will want to really tear into:

 

 

:DESERT6_5600Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])[email protected] = 0 :DESERT6_5621if  [email protected]([email protected],2i) == 0 else_jump @DESERT6_6008 0209: [email protected] = random_int_in_ranges 150 200 0093: [email protected] = integer [email protected] to_float 0209: [email protected] = random_int_in_ranges 0 2 if  [email protected] == 0 else_jump @DESERT6_5704 005B: [email protected] += [email protected] // (float) jump @DESERT6_5712 :DESERT6_57040063: [email protected] -= [email protected] // (float) :DESERT6_57120209: [email protected] = random_int_in_ranges 150 200 0093: [email protected] = integer [email protected] to_float 0209: [email protected] = random_int_in_ranges 0 2 if  [email protected] == 0 else_jump @DESERT6_5773 005B: [email protected] += [email protected] // (float) jump @DESERT6_5781 :DESERT6_57730063: [email protected] -= [email protected] // (float) :DESERT6_578102CE: [email protected] = ground_z_at [email protected] [email protected] [email protected] 092E: get_water_height_at [email protected] [email protected] flag 0 store_to [email protected] if 0025:   [email protected] > [email protected] // (float) else_jump @DESERT6_5835 0087: [email protected] = [email protected] // (float) :DESERT6_58350087: [email protected] = [email protected] // (float) [email protected] += 200.0 [email protected]([email protected],2i) = Car.Create(#HYDRA, [email protected], [email protected], [email protected])0745: set_hydra [email protected]([email protected],2i) thrust_to_horizontal 070E: hydra [email protected]([email protected],2i) attack_player_car $PLAYER_CHAR radius 10.0 [email protected]([email protected],2i) = Marker.CreateAboveCar([email protected]([email protected],2i))018B: set_marker [email protected]([email protected],2i) radar_mode 2 0129: [email protected]([email protected],2i) = create_actor_pedtype 4 model #HMORI in_car [email protected]([email protected],2i) driverseat 060B: set_actor [email protected]([email protected],2i) decision_maker_to [email protected] [email protected]([email protected],2i) = 0 [email protected]([email protected],2i) = 0 [email protected]([email protected],2i) = 1 [email protected] = 0 [email protected] = 1 return 

 

 

The first thing this does is store the player's x,y,z coords to variables [email protected], [email protected], [email protected]

Next it creates those hydra at random coords based on your location. As a personal note if I were creating this code I would have them take off from the nearest airport for a more realistic mission.

 

Opcode 070E tells the hydra to attack the player's car (should be vehicle) biggrin.gif

Opcode 060B tells the AI to make decisions based on the variables of the mission.

 

Now if I haven't frightened you off, I will stop back in here and see if you need more assistance. Be sure to post any code you are working on or post any questions you need help with. I don't have all the answers but there is a large friendly community here willing to help those who help themselves.

 

Keep Cool,

JAB

Thanks Jab, so do i put

:DESERT6_5600Actor.StorePos($PLAYER_ACTOR, [email protected], [email protected], [email protected])[email protected] = 0:[email protected]([email protected],2i) == 0else_jump @DESERT6_60080209: [email protected] = random_int_in_ranges 150 2000093: [email protected] = integer [email protected] to_float0209: [email protected] = random_int_in_ranges 0 [email protected] == 0else_jump @DESERT6_5704005B: [email protected] += [email protected] // (float)jump @DESERT6_5712:DESERT6_57040063: [email protected] -= [email protected] // (float):DESERT6_57120209: [email protected] = random_int_in_ranges 150 2000093: [email protected] = integer [email protected] to_float0209: [email protected] = random_int_in_ranges 0 [email protected] == 0else_jump @DESERT6_5773005B: [email protected] += [email protected] // (float)jump @DESERT6_5781:DESERT6_57730063: [email protected] -= [email protected] // (float):DESERT6_578102CE: [email protected] = ground_z_at [email protected] [email protected] [email protected]: get_water_height_at [email protected] [email protected] flag 0 store_to [email protected]:   [email protected] > [email protected] // (float)else_jump @DESERT6_58350087: [email protected] = [email protected] // (float):DESERT6_58350087: [email protected] = [email protected] // (float)[email protected] += [email protected]([email protected],2i) = Car.Create(#HYDRA, [email protected], [email protected], [email protected])0745: set_hydra [email protected]([email protected],2i) thrust_to_horizontal070E: hydra [email protected]([email protected],2i) attack_player_car $PLAYER_CHAR radius [email protected]([email protected],2i) = Marker.CreateAboveCar([email protected]([email protected],2i))018B: set_marker [email protected]([email protected],2i) radar_mode 20129: [email protected]([email protected],2i) = create_actor_pedtype 4 model #HMORI in_car [email protected]([email protected],2i) driverseat060B: set_actor [email protected]([email protected],2i) decision_maker_to [email protected]@([email protected],2i) = [email protected]([email protected],2i) = [email protected]([email protected],2i) = [email protected] = [email protected] = 1return 

into my script?

Link to comment
Share on other sites

 

...

Your right...

 

Why do you think your a noob at coding? Your not, trust me

Link to comment
Share on other sites

whats is this supposed to mean?

His comment was directed to me. Thanks for the complement James.

 

 

Thanks Jab, so do i put

....

into my script?

 

I'm afraid it is not quite that simple. You will need to break down which actions you wish to preform first. Of course you being a Cleo modder have the benefit of certain functions I do not. I do plan to start into Cleo mods after I have tackled the main.scm.

 

If you want a WWII dogfight, Hydras would not be a part of it since WWII did not have jets. I will make a small example for you using the Rustler as the planes in the dog fight.

 

I will get back with you on this in awhile.

 

JAB

Link to comment
Share on other sites

whats is this supposed to mean?

His comment was directed to me. Thanks for the complement James.

 

 

Thanks Jab, so do i put

....

into my script?

 

I'm afraid it is not quite that simple. You will need to break down which actions you wish to preform first. Of course you being a Cleo modder have the benefit of certain functions I do not. I do plan to start into Cleo mods after I have tackled the main.scm.

 

If you want a WWII dogfight, Hydras would not be a part of it since WWII did not have jets. I will make a small example for you using the Rustler as the planes in the dog fight.

 

I will get back with you on this in awhile.

 

JAB

i said WWII cause i didn't think a lot of people knew what dogfight's were. So it's really just a plane fight kind of thing.

Link to comment
Share on other sites

This is an entire mission code, meaning if you cut and paste this into the Sanny Builder it will compile the MAIN.SCM so make a back up! I have you as CJ at the desert runway when you press Y the mission will start a 3 planes will appear like magic. At this point, if jog down the runway you can see your pilots wearing black "STAFF" shirts. Once you get in your plane the ladies take off first. They won't attack you unless you remove the {braces} where shown below.

 

Don't stray over the military base they will still shoot you down. To win you need to shoot down both planes. Good luck!!

 

This mission is NOT finished here are some of the tasks ahead of you.

  • Get the planes to use attack patterns.
  • Make them use their guns not hydra missiles or rockets.
  • Make an indicator that displays damage to each plane.
  • See if you can figure out how to make a third plane or more.
  • Give your pilots parachutes and make them bail if they get scared.
DEFINE MISSIONS 1       DEFINE MISSION 0 AT @DOGFIGHTDEFINE EXTERNAL_SCRIPTS 0DEFINE UNKNOWN_EMPTY_SEGMENT 0DEFINE UNKNOWN_THREADS_MEMORY 500{$VERSION 3.1.0027}var$PLAYER_CHAR: Playerend // var //Main thread starts here03A4: name_thread 'MAIN' //Set the screen BLACK immediately016A: fade 0 time 0           01F0: set_max_wanted_level_to 6 0111: toggle_wasted_busted_check 0 00C0: set_current_time_hours_to 8 minutes_to 0 //Create Player at Runway in Desert04E4: unknown_refresh_game_renderer_at 323.5454 2540.254 Camera.SetAtPos(323.5454, 2540.254, 15.8085)$PLAYER_CHAR = Player.Create(#NULL, 323.5454, 2535.254, 15.8085)Player.SetClothes($PLAYER_CHAR, "VEST", "VEST", Torso)Player.SetClothes($PLAYER_CHAR, "JEANSDENIM", "JEANS", Legs)Player.SetClothes($PLAYER_CHAR, "SNEAKERBINCBLK", "SNEAKER", Shoes)Player.SetClothes($PLAYER_CHAR, "PLAYER_FACE", "HEAD", Head)  Player.Build($PLAYER_CHAR)01F5: $PLAYER_ACTOR = create_player_actor $PLAYER_CHAR 07AF: $PLAYER_GROUP = player $PLAYER_CHAR group 01B6: set_weather 1 0001: wait 0 ms 01B4: toggle_player $PLAYER_CHAR can_move false 04BB: select_interior 0 0629: change_integer_stat 181 to 4  //Unlocks ALL cities and ZONES!016C: restart_if_wasted_at 323.5454 2535.254 15.8085 angle 90.0 town_number 0 016D: restart_if_busted_at 323.5454 2535.254 15.8085 angle 90.0 town_number 0 // Note: your missions have to use the variable defined here0180: set_on_mission_flag_to $ONMISSION  0004: $DEFAULT_WAIT_TIME = 25003E6: remove_text_box // START GAME$ONMISSION = 0   //Free the players movements016A: fade 1 time 5000001: wait 1000 ms Player.CanMove($PLAYER_CHAR) = TrueCamera.Restore_WithJumpCutCamera.SetBehindPlayer   :MAIN_LOOP0001: wait $DEFAULT_WAIT_TIME ms00BF: $TIME_HOURS = current_time_hours, $TIME_MINS = current_time_minutesif and$ONMISSION == 000E1:   player 0 pressed_key 11jf @MAIN_LOOPstart_mission 00002: jump @MAIN_LOOP :DOGFIGHTthread 'DOGFIGHT' gosub @DOGFIGHT_100if wasted_or_busted else_jump @DOGFIGHT_8000 end_thread :DOGFIGHT_100// Locks your player so you can't move just yetPlayer.CanMove($PLAYER_CHAR) = [email protected] = 0$ONMISSION = 1//Load Models 0395: clear_area 1 at 323.5454 2540.254 15.8085 radius 50.0 Model.Load(#RUSTLER)Model.Load(#WFYCLOT)    // Cool Female Pilots!!038B: load_requested_models //Check for Models Loading:DOGFIGHT_110wait 0if orModel.Available(#RUSTLER)Model.Available(#WFYCLOT)jf @DOGFIGHT_110 //Place my plane on the [email protected] = Car.Create(#RUSTLER, 323.5454, 2540.254, 15.8085 )Car.Angle([email protected]) = 180.0//[email protected] is an array of 2 integers [email protected] is the index [email protected] = 0   //Place Plane #000A5: [email protected]([email protected],2i) = create_car #RUSTLER at 421.3578 2515.6172 16.7772Car.Angle([email protected]([email protected],2i)) = 90.0009A: [email protected]([email protected],2i) = create_actor_pedtype 5 model #WFYCLOT at 424.3162 2509.3926 16.4844Actor.Angle([email protected]([email protected],2i)) = [email protected] = 1   //Place Plane #100A5: [email protected]([email protected],2i) = create_car #RUSTLER at 421.3578 2496.7336 16.7842Car.Angle([email protected]([email protected],2i)) = 90.0009A: [email protected]([email protected],2i) = create_actor_pedtype 5 model #WFYCLOT at 424.3162 2488.623 16.4922Actor.Angle([email protected]([email protected],2i)) = 90.0//Let's get into the air!Player.CanMove($PLAYER_CHAR) = True :DOGFIGHT_120wait 0//Wait loop for CJ to get into the cockpit... heh heh... I said cock.;)ifActor.DrivingPlane($PLAYER_ACTOR)jf @DOGFIGHT_120//Ladies to your [email protected] = 005CB: AS_actor [email protected]([email protected],2i) enter_car [email protected]([email protected],2i) as_driver -1 ms [email protected] = 105CB: AS_actor [email protected]([email protected],2i) enter_car [email protected]([email protected],2i) as_driver -1 ms //Dramatic cut away shot 067C: put_camera_on_actor [email protected]([email protected],2i) with_offset 12.0 -6.0 6.0 rotation 0.0 0.0 0.0 0.0 2 wait 7000 [email protected] = 004D2: set_plane [email protected]([email protected],2i) fly_autopilot_around_point 328.9085 2503.646 200.0 altitude_between 0.0 and 250.0 [email protected] = Marker.CreateAboveCar([email protected]([email protected],2i))07E0: set_marker [email protected] type_to 00165: set_marker [email protected] color_to 0 [email protected] = 104D2: set_plane [email protected]([email protected],2i) fly_autopilot_around_point -228.9085 2503.646 300.0 altitude_between 0.0 and 250.0 [email protected] = Marker.CreateAboveCar([email protected]([email protected],2i))07E0: set_marker [email protected] type_to 00165: set_marker [email protected] color_to 0 :DOGFIGHT_160wait 0if00E1:   player 0 pressed_key 10  //Wait until the player presses N To begin the dogfightjf @DOGFIGHT_160{ //This code will have them launching missiles at you from their planes. Just remove the [email protected] = 0070E: hydra [email protected]([email protected],2i) attack_player_car $PLAYER_CHAR radius 10.0 [email protected] = 1070E: hydra [email protected]([email protected],2i) attack_player_car $PLAYER_CHAR radius 10.0 }:DOGFIGHT_900wait [email protected] = 0 ifCar.Wrecked([email protected]([email protected],2i)) jf @DOGFIGHT_900:DOGFIGHT_910wait [email protected] = 1 ifCar.Wrecked([email protected]([email protected],2i)) jf @DOGFIGHT_910return//If you can win this mission you get $2000!:DOGFIGHT_8000 030C: progress_made += 1 0394: play_music 1 Player.ClearWantedLevel($PLAYER_CHAR)//01E3: show_text_1number_styled GXT 'M_PASSR' number 7 time 5000 style 1  // MISSION PASSED!~n~~w~RESPECT +//0998: add_respect 1 //When money is given you should use these lines.01E3: show_text_1number_styled GXT 'M_PASS' number 2000 time 5000 style 1  // MISSION PASSED!~n~~w~$~1~Player.Money($PLAYER_CHAR) += 2000$ONMISSION = 0 01BD: $CURRENT_TIME_IN_MS = current_time_in_msModel.Destroy(#RUSTLER)Model.Destroy(#WFYCLOT)mission_cleanup end_thread

 

Edited by Jabhacksoul
Link to comment
Share on other sites

This is an entire mission code, meaning if you cut and paste this into the Sanny Builder it will compile the MAIN.SCM so make a back up! I have you as CJ at the desert runway when you press Y the mission will start a 3 planes will appear like magic. At this point, if jog down the runway you can see your pilots wearing black "STAFF" shirts. Once you get in your plane the ladies take off first. They won't attack you unless you remove the {braces} where shown below.

 

Don't stray over the military base they will still shoot you down. To win you need to shoot down both planes. Good luck!!

 

This mission is NOT finished here are some of the tasks ahead of you.

  • Get the planes to use attack patterns.
  • Make them use their guns not hydra missiles or rockets.
  • Make an indicator that displays damage to each plane.
  • See if you can figure out how to make a third plane or more.
  • Give your pilots parachutes and make them bail if they get scared.
...

 

 

 

so this will be in my MAIN.SCM? can i try make it into cleo?

Link to comment
Share on other sites

 

so this will be in my MAIN.SCM?

 

This would replace the entire main.scm and would be the only mission you could play.

 

 

can i try make it into cleo?

 

That's is your objective. It shouldn't be too hard. But I had a hell of a time just getting those planes off the ground. They kept crashing into ground structures. If anyone knows how to get a plane to "taxi" down a runway I would like to know, because I tried scmpath, drive to point, etc.. Originally I place the two planes heading north across the strip by the windsock. It wasn't until I positioned them in takeoff position that they could actually fly.

 

JAB

Link to comment
Share on other sites

 

so this will be in my MAIN.SCM?

 

This would replace the entire main.scm and would be the only mission you could play.

 

 

can i try make it into cleo?

 

That's is your objective. It shouldn't be too hard. But I had a hell of a time just getting those planes off the ground. They kept crashing into ground structures. If anyone knows how to get a plane to "taxi" down a runway I would like to know, because I tried scmpath, drive to point, etc.. Originally I place the two planes heading north across the strip by the windsock. It wasn't until I positioned them in takeoff position that they could actually fly.

 

JAB

Okay ill try make it into cleo. not right now though, my Game won't run because my sound drivers aren't updated, and i can't figure out how to update them

Link to comment
Share on other sites

Sorry for the double post. But yeah im just not gonna go ahead with this mod until i learn more. and there is too many local vars in the script.

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.