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. PC
      2. Gameplay
      3. Missions
      4. Help & Support
    2. Red Dead Online

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

      1. Recruitment
    2. Events

    1. GTA Online

      1. Diamond Casino & Resort
      2. DLC
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Grand Theft Auto Series

    3. GTA 6

    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 IV 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 SA Mods
    10. GTA Vice City

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

      1. Guides & Strategies
      2. Help & Support
      3. GTA III 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

Sign in to follow this  
roby65

Launch a missile?

Recommended Posts

ZAZ

 

is there a way to make the missile move but without being affected by the gravity?  confused.gif

Shure. Search for move object code and replace it with throw object.

034E must be set in a loop

 

Then look what happens.

Share this post


Link to post
Share on other sites
roby65

last thing....how can i add the smoke created by the missile?

should i use particles? smile.gif

Share this post


Link to post
Share on other sites
ZAZ

 

last thing....how can i add the smoke created by the missile?

should i use particles?  smile.gif

Theres a code to attach particle to object, but its not very effectiv with smoke:

0392: object [email protected] toggle_in_moving_list 1

0381: throw_object [email protected] distance [email protected] [email protected] [email protected]

066D: [email protected] = attach_particle "riot_smoke" to_object [email protected] with_offset 0.0 0.0 0.1 flag 1

064C: make_particle [email protected] visible

[email protected] = 0 // floating-point values

 

Other way is to get the coords of object and use 095C in a loop:

 

:Missile_050001: wait  0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @Missile_050400: create_coordinate [email protected] [email protected] [email protected] from_object [email protected] offset  0.0  0.0  0.0095C: create_smoke_at [email protected] [email protected] [email protected] velocity 0.0 0.0 0.0 RGBA 1.0 0.5 0.5 1.0 size 3.0 last_factor 0.100D6: if  2104DA:   has_object [email protected] collided0019:   [email protected] >  2800  // integer values004D: jump_if_false @Missile_05

 

 

Share this post


Link to post
Share on other sites
pinky

Easier way to do it, not advisable for fast moving vehicles though (especially planes, helis are ok wink.gif ) as you will crash into them.

Code an ped armed with launcher or stinger, set ped/peds to shoot at offset coordinates when specific fire button is pressed. No collision checks required as you have just made a ped shoot an allready exe coded rocket.

Just set ped and weapon as not visible and set all their immunities. Note that they will still drown if you dunk them in the water.

You can use the heatseek if you want the peds to attack a specific vehicle like a SAM site attacks your aircraft.

This method also prevents the ovespawn of rockets without resorting to timed intervals as well, thus preventing a crash when your GPU becomes full of rocket data.

Also very short code compared to other method.

 

Bingo.

 

:NONAME_20001: wait 0 ms 00D6: if 0256:   player $PLAYER_CHAR defined 004D: jump_if_false @NONAME_2 00D6: if and00DD:   actor $PLAYER_ACTOR driving_car_with_model #SPARROW004D: jump_if_false @NONAME_25003C0: [email protected] = actor $PLAYER_ACTOR car0247: load_model #ROCKETLA 0247: load_model #BFORI00D6: if  and0248:   model #ROCKETLA available 0248:   model #BFORI available004D: jump_if_false @NONAME_2009A: [email protected] = create_actor_pedtype 25 model #BFORI at 0.0 0.0 0.0 009A: [email protected] = create_actor_pedtype 25 model #BFORI at 0.0 0.0 0.001B2: give_actor [email protected] weapon 35 ammo 999999 // Load the weapon model before using this 01B9: set_actor [email protected] armed_weapon_to 35 01B2: give_actor [email protected] weapon 35 ammo 999999 // Load the weapon model before using this 01B9: set_actor [email protected] armed_weapon_to 350337: toggle_actor [email protected] visibility 0 0337: toggle_actor [email protected] visibility 002AB: set_actor [email protected] immunities BP 1 FP 1 EP 1 CP 1 MP 102AB: set_actor [email protected] immunities BP 1 FP 1 EP 1 CP 1 MP 10619: toggle_actor [email protected] collision_detection 0 0619: toggle_actor [email protected] collision_detection 006A7: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 0.4 2.9 -1.2 position 3 shooting_angle 0.0 0.0 with_weapon 3506A7: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -2.4 2.9 -1.2 position 3 shooting_angle 0.0 0.0 with_weapon 35  :NONAME_30001: wait 0 ms00D6: if and0256:   player $PLAYER_CHAR defined 00DD:   actor $PLAYER_ACTOR driving_car_with_model #SPARROW004D: jump_if_false @NONAME_25000D6: if   80E1:   not player 0 pressed_key 6 004D: jump_if_false @NONAME_4 0002: jump @NONAME_3:NONAME_40001: wait 0 ms0208: [email protected] = random_float_in_ranges -2.0 2.0 0208: [email protected] = random_float_in_ranges -2.0 2.0 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset [email protected] 1000.0 [email protected]   0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 50 ms0001: wait 50 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 50 ms 0002: jump @NONAME_3:NONAME_25000D6: if 056E:   car [email protected] defined 004D: jump_if_false @NONAME_2 01C3: remove_references_to_car [email protected] // Like turning a car into any random car009B: destroy_actor [email protected] 009B: destroy_actor [email protected] 0249: release_model #BMORI 0249: release_model #ROCKETLA  0002: jump @NONAME_2 

 

 

This is what I use for my attack heli in Gostown.

Edited by pinky

Share this post


Link to post
Share on other sites
ZAZ

 

Easier way to do it, not advisable for fast moving vehicles though (especially planes, helis are ok wink.gif ) as you will crash into them.

Code an ped armed with launcher or stinger, set ped/peds to shoot at offset coordinates when specific fire button is pressed. No collision checks required as you have just made a ped shoot an allready exe coded rocket.

Just set ped and weapon as not visible and set all their immunities. Note that they will still drown if you dunk them in the water.

You can use the heatseek if you want the peds to attack a specific vehicle like a SAM site attacks your aircraft.

This method also prevents the ovespawn of rockets without resorting to timed intervals as well, thus preventing a crash when your GPU becomes full of rocket data.

Also very short code compared to other method.

 

Bingo.

 

:NONAME_40001: wait 0 ms0208: [email protected] = random_float_in_ranges -2.0 2.0 0208: [email protected] = random_float_in_ranges -2.0 2.0 0407: store_coords_to [email protected] [email protected] [email protected] from_car 0@ with_offset [email protected] 1000.0 [email protected]   0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 50 ms0001: wait 50 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 50 ms 0002: jump @NONAME_3 

 

 

This is what I use for my attack heli in Gostown.

Nice and tricky cookie.gif

 

but please correct your post because "if and" is wrong

 

00D6: if and

00DD:  actor $PLAYER_ACTOR driving_car_with_model #SPARROW

004D: jump_if_false @NONAME_250

Share this post


Link to post
Share on other sites
pinky

 

Easier way to do it, not advisable for fast moving vehicles though (especially planes, helis are ok wink.gif ) as you will crash into them.

Code an ped armed with launcher or stinger, set ped/peds to shoot at offset coordinates when specific fire button is pressed. No collision checks required as you have just made a ped shoot an allready exe coded rocket.

Just set ped and weapon as not visible and set all their immunities. Note that they will still drown if you dunk them in the water.

You can use the heatseek if you want the peds to attack a specific vehicle like a SAM site attacks your aircraft.

This method also prevents the ovespawn of rockets without resorting to timed intervals as well, thus preventing a crash when your GPU becomes full of rocket data.

Also very short code compared to other method.

 

Bingo.

 

:NONAME_40001: wait 0 ms0208: [email protected] = random_float_in_ranges -2.0 2.0 0208: [email protected] = random_float_in_ranges -2.0 2.0 0407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset [email protected] 1000.0 [email protected]   0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 50 ms0001: wait 50 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 50 ms 0002: jump @NONAME_3 

 

 

This is what I use for my attack heli in Gostown.

Nice and tricky cookie.gif

 

but please correct your post because "if and" is wrong

 

00D6: if and

00DD:  actor $PLAYER_ACTOR driving_car_with_model #SPARROW

004D: jump_if_false @NONAME_250

Still works nicely though Zaz. tounge.gif

Thanks for the input though, I will check it out. icon14.gif

The only thing you have to beware of is vehicle speed like I said and make sure they fire a few meters from the moving vehicle to give you a chance.

Edited by pinky

Share this post


Link to post
Share on other sites
GaryRoachSanderson

nice! so this can be added to the shamal as well? (Offtopic: I still cant find the cleo version of yangster's shamal missile mod)

Share this post


Link to post
Share on other sites
pinky
nice! so this can be added to the shamal as well? (Offtopic: I still cant find the cleo version of yangster's shamal missile mod)

It doesn't work with cleo thanks to using global variables.

I had already tried before I decided to do it my own way. wink.gif

Share this post


Link to post
Share on other sites
james227uk

zaz, in your third script, where in object.dat do i have to put that line of code?

Share this post


Link to post
Share on other sites
ZAZ

 

zaz, in your third script, where in object.dat do i have to put that line of code?

I modified the script again. Now its not nessesary to modify the object.dat because it uses both objects, bball_col and attaches the missile to the ball.

And it uses the the ID numbers of the objects to make it possible for cleo

0247: request_model 3065//bball_col

0247: request_model 3786//missile_05_SFXR

 

 

:Missile_0003A4: name_thread 'JPR':Missile_010001: wait  0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @Missile_0100D6: if  000E1:   key_pressed  0  10  004D: jump_if_false @Missile_010247: request_model 3065	0247: request_model 3786:Missile_020001: wait  0 ms00D6: if  10248:   model 3065  available0248:   model 3786  available004D: jump_if_false @Missile_020172: [email protected] = actor $PLAYER_ACTOR z_angle04C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset 1.0 -0.5  1.30107: [email protected] = create_object 3065  at  [email protected] [email protected] [email protected]: [email protected] +=  270.0  // floating-point values0177: set_object [email protected] z_angle_to  [email protected]: toggle_object [email protected] visibility 00107: [email protected] = create_object 3786  at  0.0  0.0  0.00177: set_object [email protected] z_angle_to  [email protected]: object [email protected] set_scripted_collision_check  10382: set_object [email protected] collision_detection  10906: [email protected]  30000.0//set_object mass0908: [email protected]  30000.0//set_object turn_mass069A: attach_object [email protected] to_object [email protected] with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.00382: set_object [email protected] collision_detection  00001: wait  250 ms0172: [email protected] = actor $PLAYER_ACTOR z_angle0819: [email protected] = actor $PLAYER_ACTOR distance_from_ground0007: [email protected] =  80.1  // floating-point values 02F6: [email protected] = cosine [email protected]  // sinus swapped with cosine02F7: [email protected] = sinus [email protected] // cosine swapped with sinus 006B: [email protected] *= [email protected]  // floating-point values006B: [email protected] *= [email protected]  // floating-point values0013: [email protected] *=  -1.0  // floating-point values000B: [email protected] +=  1.0  // floating-point values0392: object [email protected] toggle_in_moving_list  10381: throw_object [email protected] distance [email protected] [email protected] [email protected][email protected] =  0  // floating-point values:Missile_050001: wait  0 ms00D6: if 00256: player $PLAYER_CHAR defined004D: jump_if_false @Missile_050400: create_coordinate [email protected] [email protected] [email protected] from_object [email protected] offset  0.0  0.0  0.0095C: create_smoke_at [email protected] [email protected] [email protected] velocity 0.0 0.0 0.0 RGBA 1.0  1.0  1.0 1.0 size 0.5 last_factor 0.100D6: if  2104DA:   has_object [email protected] collided0019:   [email protected] >  7000  // integer values004D: jump_if_false @Missile_050400: create_coordinate [email protected] [email protected] [email protected] from_object [email protected] offset  0.0  0.0  0.0020C: create_explosion_with_radius 3 at [email protected] [email protected] [email protected]: create_temporary_explosion_fire [email protected] [email protected] [email protected]  50400: create_coordinate [email protected] [email protected] [email protected] from_object [email protected] offset  5.0  0.0  0.0020C: create_explosion_with_radius 3 at [email protected] [email protected] [email protected]: create_temporary_explosion_fire [email protected] [email protected] [email protected]  50400: create_coordinate [email protected] [email protected] [email protected] from_object [email protected] offset  -5.0  0.0  0.0020C: create_explosion_with_radius 3 at [email protected] [email protected] [email protected]: create_temporary_explosion_fire [email protected] [email protected] [email protected]  50400: create_coordinate [email protected] [email protected] [email protected] from_object [email protected] offset  0.0  5.0  0.0020C: create_explosion_with_radius 3 at [email protected] [email protected] [email protected]: create_temporary_explosion_fire [email protected] [email protected] [email protected]  50400: create_coordinate [email protected] [email protected] [email protected] from_object [email protected] offset  0.0  -5.0  0.0020C: create_explosion_with_radius 3 at [email protected] [email protected] [email protected]: create_temporary_explosion_fire [email protected] [email protected] [email protected]  50249: release_model 3065	0249: release_model 3786095C: create_smoke_at [email protected] [email protected] [email protected] velocity 0.0 0.0 0.0 RGBA 0.0 0.0 0.0 0.2 size 3.0 last_factor 0.10001: wait  100 ms0682: detach_object [email protected] 0.0 0.0 0.0 collision_detection 10001: wait  100 msObject.Destroy([email protected])Object.Destroy([email protected])0002: jump @Missile_01

 

Share this post


Link to post
Share on other sites
gtasbigfoot

thats great ZAZ cookie.gifcookie.gif

 

i got one question is the rockets power the same as a rocket from the hydra?

Share this post


Link to post
Share on other sites
ZAZ

 

thats great ZAZ cookie.gif  cookie.gif

 

i got one question is the rockets power the same as a rocket from the hydra?

It have more power as normal rockets

Share this post


Link to post
Share on other sites
james227uk

how do i fire the rocket and what weapon do i have to get?

Share this post


Link to post
Share on other sites
pinky
how do i fire the rocket and what weapon do i have to get?

Off hand it looks like one of the horn or submission buttons and no weapon pickup is required for this to work.

 

Nice code ZAZ, do you mind if I adapt it for some of my aircraft?

Share this post


Link to post
Share on other sites
Great Saiyaman

to use this the key is "N"

Share this post


Link to post
Share on other sites
ZAZ

 

how do i fire the rocket and what weapon do i have to get?

Off hand it looks like one of the horn or submission buttons and no weapon pickup is required for this to work.

 

Nice code ZAZ, do you mind if I adapt it for some of my aircraft?

Yes, do it and I adapt yours.

I made a script because of a request of a german fan.

"Press M in Hydra to fire gun and N to throw bomb" merges both variations. I will modifiy a little more and post it then here.

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.
Note: Your post will require moderator approval before it will be visible.

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.

Sign in to follow this  

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