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

Sign in to follow this  
Anurag_Anmol

Minigun and missiles help

Recommended Posts

Anurag_Anmol

I need help with a WIP CLEO Mod of mine, its an AH-6 mini-gun and rocket mod. Although, I need help with some of it.

 

 

First, the mini-gun.I did this and the rockets thing with actors, like first I made the actors, gave them weapons, set current weapon, set accuracy, invisibility, immunities, collision detection to false then put them on turret mode. Then used -

 

 

CODE DELETED

 

 

that to make them shoot. Problem is, when u turn right or left fast, they slowly turn front, but I want it to fire straight always, now how do I do that?

 

 

Second, the missiles. I again used actors, then when I shot the missiles, they looked like crap lol (No offence to Rockstar devil.gif ) I want to make missiles, like Ryosuke's Missile mods and ZAZ's Pimp my Car mod. So tell me how to do that tounge.gif

 

Thanks!

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
BnB

Missile

 

Thats an example

 

0172: [email protected] = actor $PLAYER_ACTOR Z_angle 02F6: [email protected] = sine [email protected] // (float) 02F7: @ = cosine [email protected] // (float) 006B: [email protected] *= 50.0 // (float)006B: [email protected] *= 50.0 // (float) 0013: [email protected] *= -1.0 0392: make_object [email protected] moveable 1 0381: throw_object [email protected] [email protected] [email protected] 3.0

 

Share this post


Link to post
Share on other sites
Anurag_Anmol

I don't understand sine and cosine stuff.. Whats the model of the missile of Ryosuke's and ZAZ's CLEO missiles? wow.gif Heres the code -

 

 

CODE DELETED

 

 

Sorry if I'm asking for too much sad.gif

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
yair1221

sorry i dont really understand it too

but just another advice:

remove the last part of the code, instead of creating a new option for shooting with both rockets and minigun:

 

:minigunwait 0if00E1:   player 0 pressed_key 17jf @[email protected] = Car.Angle([email protected])Actor.Angle([email protected]) = [email protected]([email protected]) = [email protected]: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 100.0 0.00668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 ms:rocketswait 0if00E1:   player 0 pressed_key 4jf @[email protected] = Car.Angle([email protected])Actor.Angle([email protected]) = [email protected]([email protected]) = [email protected]: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 100.0 0.00668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 msjump @minigun

 

 

that way

you can press them both, without that other option you added ("MinigunsAndRocketsCheck")

Share this post


Link to post
Share on other sites
Anurag_Anmol

I still don't get sine and cosine. Although I tracked down the missile model from Pimp My Car and inspected every one in the path with MEd (lol like a detective tounge.gif) And found it! ID is 3786 smile.gif Well I'm going to finish my mod ^^ And thanks for the tips yair! But the longer the actor shoots in 0668, the worse because then the actor would like stray from the angle the player is but then go to it but slowly. But if its too short, it'll fire in bursts. If I delete MinigunsAndRocketsCheck and Firing, it wouldn't shoot at the same time. I fixed this though by putting conditions at the end of Firing of both Miniguns and Rockets and MinigunsAndRockets (Lol) which if false will go to the other checks.

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
Silent

Sine and cosine helps to get offset from angle, so for example when you need to put object X in car Y at angle 60 relating to that car, then instead of doing 4589678594304 calculations of right offset, you have to just get sine from 60 for x offset and cosine from 60 to y offset. It is simple to imagine smile.gif

Share this post


Link to post
Share on other sites
Anurag_Anmol

I got the right offsets for the miniguns and rockets so it shouldn't be a problem lol lemme see what happens tounge.gif

Share this post


Link to post
Share on other sites
ZAZ

 

I don't understand sine and cosine stuff.. Whats the model of the missile of Ryosuke's and ZAZ's CLEO missiles? wow.gif Heres the code -

 

 

:MinigunsCheck_15wait 0if and00E1:   player 0 pressed_key 1780E1:   not player 0 pressed_key 4jf @[email protected] = Car.Angle([email protected])Actor.Angle([email protected]) = [email protected]([email protected]) = [email protected]: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 100.0 0.00668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 msjump @MinigunsCheck_15:RocketsCheck_25 wait 0if and00E1:   player 0 pressed_key 480E1:   not player 0 pressed_key 17jf @[email protected] = Car.Angle([email protected])Actor.Angle([email protected]) = [email protected]([email protected]) = [email protected]: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 100.0 0.00668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 msjump @RocketsCheck_25:MinigunsAndRocketsCheck_35wait 0if and00E1:   player 0 pressed_key 400E1:   player 0 pressed_key 17jf @[email protected] = Car.Angle([email protected])Actor.Angle([email protected]) = [email protected]([email protected]) = [email protected]([email protected]) = [email protected]([email protected]) = [email protected]: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 0.0 100.0 0.00668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 ms0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 100 msjump @MinigunsAndRocketsCheck_35

 

 

Sorry if I'm asking for too much sad.gif

try this

 

0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 500 mswait 500

 

 

I use the 3054 bball_col to throw and check collision

the pimpmycar missile gets it's target from mousemove-cameraview, that's a difficult calculation

 

BnB posted the kernel script to throw an object

the throw opcode needs to insert offsets, i mean coords relative to the source, in general in relation to player center

you can calculate these with sin-cosin function

sin and cosin of same z-angle calculates a point on a circle of 1.0 unit as radius

imagine the clock circle have 1.0 as radius:

set actor z_angle to 90.0 and you get the x/y point at 3'clock on the clock circle

in coordssystem is it then at x= 0.0, y= 1.0

multiplicate the result of sin/cosin with 5.0 to increase the diameter

in coordssystem is it then at x= 0.0, y= 5.0

as last assigne the unit circle to player as the circles center

then you get throw-coords infront of player no matter which z-angle he has

 

Share this post


Link to post
Share on other sites
Anurag_Anmol

Umm uhhhh... Heres my code so far, and I don't think I'll be using sine and cosine.

 

 

CODE DELETED

 

 

Just added the missile, hopefully it will work. Will edit with results, unless if I blow up tounge.gif

 

EDIT : Well the game crashed.. and I don't really see the need for sine and cosine for a missile. Dammit this is hard! facedesk.gif

EDIT 2 : Apparently I did some things wrong, fixed, now trying.

EDIT 3 : Game Crash again facedesk.gif Heres the code, still has problems with it (which I can't find) -

 

 

CODE DELETED

 

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
ZAZ
{$CLEO .cs}:Objectthrow_003A4: name_thread 'OTHROW':Objectthrow_10001: wait  0 msif0256: player $PLAYER_CHAR defined004D: jump_if_false @Objectthrow_1if0AB0:   key_pressed 8//-----------------------------press backspace  004D: jump_if_false @Objectthrow_10247: request_model 3054:Objectthrow_30001: wait  0 msif0248:   model 3054     available004D: jump_if_false @Objectthrow_304C4: create_coordinate [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR offset  0.0 5.0  0.00107: [email protected] = create_object 3054     at  [email protected] [email protected] [email protected]: object [email protected] set_scripted_collision_check  10382: set_object [email protected] collision_detection  1wait  20000392: object [email protected] toggle_in_moving_list  10381: throw_object [email protected] distance 0.0  5.0  15.0wait  5000Object.Destroy([email protected])0249: release_model 30540002: jump @Objectthrow_1

 

Share this post


Link to post
Share on other sites
Anurag_Anmol

YES! It workz! Thank you ZAZ! Except CJ got destroyed (RIP CJ)

Just need to scale the rocket down a bit, make smoke trail, make missile go in right direction, etc. Heres the script.

 

 

CODE DELETED

 

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
TheSiggi
YES! It workz! Thank you ZAZ! Except CJ got destroyed (RIP CJ)

Just need to scale the rocket down a bit, make smoke trail, make missile go in right direction, etc. Heres the script.

 

 

:RocketsCheck_25if and00E1:   player 0 pressed_key 480E1:   not player 0 pressed_key 17jf @MinigunsAndRocketsCheck_35:RocketsFiring_30wait 00407: store_coords_to [email protected] [email protected] [email protected] from_car [email protected] with_offset 1.4 1.0 [email protected] = Object.Create(3786, [email protected], [email protected], [email protected])[email protected] = Car.Angle([email protected])Object.Angle([email protected]) = [email protected]: make_object [email protected] moveable 104D9: object [email protected] set_scripted_collision_check  1Object.CollisionDetection([email protected]) = True06A2: get_car [email protected] velocity_in_direction_XYZ [email protected] [email protected] [email protected]@ += 50.00381: throw_object [email protected] velocity_in_direction 0.0 [email protected] 10.00392: object [email protected] toggle_in_moving_list  1:CollisionDetection_32wait 0if04DA:   has_object [email protected] collidedjf @CollisionDetection_3201BB: store_object [email protected] position_to [email protected] [email protected] [email protected] 0948: create_explosion_at [email protected] [email protected] [email protected] type 11 camera_shake 5.0 Object.Destroy([email protected])if or80E1:   not player 0 pressed_key 400E1:   player 0 pressed_key 17jf @RocketsFiring_30

 

yeah go ahead smile.gif

 

 

08D2: object [email protected]([email protected],10i) scale_model 0.3 066D: [email protected] = attach_particle "SMOKE_FLARE" to_object [email protected] with_offset 0.0 0.0 0.1 flag 1 

 

 

 

and you know the coord opcodes wink.gif

Share this post


Link to post
Share on other sites
Anurag_Anmol

1 prob, velocity in direction makes missiles go north, not front of vehicle wow.gif Lol tho it works nice when vehicle is facing north wink.gif

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
Deji

That's because you're not using sine/cosine...

 

"Green blob" and "red car" is all I have to say tounge.gif I fixed the opcode mixups.

Edited by Deji

Share this post


Link to post
Share on other sites
Anurag_Anmol

Gaaaaaaaaaah I still have to learn sine and cosine T_T

 

Wait getting the hang of it colgate.gif

 

EDIT : Something is wrong here -

 

 

CODE DELETED

 

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
Deji

What's wrong, exactly?

Share this post


Link to post
Share on other sites
TheSiggi

 

:RocketsCheck_25if and00E1:   player 0 pressed_key 480E1:   not player 0 pressed_key 17jf @MinigunsAndRocketsCheck_35

 

 

there is no label ..._35 confused.gif

 

and if it should be 25 you need to add a wait under the Label

Share this post


Link to post
Share on other sites
ZAZ

 

 

EDIT : Something is wrong here -

 

 

yes, 3786, missile_05_SFXR isn't good for throwing and checking collision

the missile needs the same settings in object.dat like bball_col

open object.dat, go to the line of bball_col and add a line for missile_05_SFXR

 

bball_col        10.0,        10.0        1.00,        0.3,        50.0,        0.0,     0.1,    0,    2,    1,     0,    0,    0.0, 0.0, 0.0,        nonemissile_05_SFXR        10.0,        10.0        1.00,        0.3,        50.0,        0.0,     0.1,    0,    2,    1,     0,    0,    0.0, 0.0, 0.0,        none

 

Edited by ZAZ

Share this post


Link to post
Share on other sites
Anurag_Anmol

@Deji and ZAZ - The problem is that the missile goes the wrong way. Oh yeah and it loses speed fast, so it goes like a few meters then stops in air. And smoke also doesn't work.

@The_Siggi - It isn't the full script, its just the part where the problem is.

 

EDIT : Put the line for the missile in the objects file, does't stop in mid air now smile.gif

 

Here is the full script -

 

 

CODE DELETED

 

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
Deji

Sorry, I never got a chance to finish my post with the mini-tutorial on sine/cosine. Meh...

 

Goes the wrong way? Is that perhaps cause you altered the angle by 270?

 

 

[email protected] = Car.Angle([email protected])[email protected] += 270.0Object.Angle([email protected]) = [email protected]: attach_object [email protected] to_object [email protected] with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.002F6: [email protected] = sine [email protected] // (float)02F7: [email protected] = cosine [email protected] // (float)[email protected] *= [email protected] *= 10.0

 

 

Or is that the way you wanted it to go? I shouldn't be posting and especially coding at this time of the morning... But try this:

 

 

[email protected] = Car.Angle([email protected])[email protected] += 270.0Object.Angle([email protected]) = [email protected]: attach_object [email protected] to_object [email protected] with_offset 0.0 0.0 0.0 rotation 0.0 0.0 [email protected] = Car.Angle([email protected]) // this line is in case your problem is that the missile flies sideways02F6: [email protected] = sine [email protected] // (float)02F7: [email protected] = cosine [email protected] // (float)// bigger value == greater distance && greater [email protected] *= [email protected] *= 40.0

 

Share this post


Link to post
Share on other sites
Anurag_Anmol

Thanks Deji! I forgot that 270.0 addition, it was to make the missile face the front. smile.gif

Thanks, trying smile.gif Will edit the post with the results!

 

Results The missile doesn't move, the smoke doesn't work either. Tried to use 095C, but didn't work either.

 

 

CODE DELETED

 

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
Anurag_Anmol

Bump bump bump bump bump!

Share this post


Link to post
Share on other sites
Anurag_Anmol

Umm sorry for double posting... I mean uhh triple posting but I pretty much done my script and umm have only 3 problems.

 

1 - Muzzle flashes not working, Do I need to load their model or something? Heres the muzzle flash part -

 

 

CODE DELETED

 

 

2 - I need to make the missiles go down and up. Well I dunno how to do that either so umm help meeeeee

 

3 - Missile goes in opposite direction (wtf) like when heli's Z angle is 45.0, missile goes 315, or like if Z angle is 90.0, then missile goes 270.0 and etc. Heres the missile's code -

 

 

CODE DELETED

 

Edited by Anurag_Anmol

Share this post


Link to post
Share on other sites
ZAZ

 

Umm sorry for double posting... I mean uhh triple posting but I pretty much done my script and umm have only 3 problems.

 

 

1. read cleo script tut-theme: Particle Effects

2. throw it again with new offsets

3. add 180.0 to the angle

Share this post


Link to post
Share on other sites
BnB

3. If your are using this code then remove 0013: [email protected] *= -1.0

 

 

0172: [email protected] = actor $PLAYER_ACTOR Z_angle 02F6: [email protected] = sine [email protected] // (float) 02F7: @ = cosine [email protected] // (float) 006B: [email protected] *= 50.0 // (float)006B: [email protected] *= 50.0 // (float) 0013: [email protected] *= -1.0 0392: make_object [email protected] moveable 1 0381: throw_object [email protected] [email protected] [email protected] 3.0

 

Share this post


Link to post
Share on other sites
Anurag_Anmol

1 - OK thanks, I thought particles automatically becomes visible after its made but I was wrong, and I didn't know you could open effects.fxp with notepad.

 

2 - Thats the problem, I don't know how to make it go downwards/upwards. Just getting the x/y angle and using that for the throw directly won't really work. And what offsets do I use for the second throw? (more importantly, how do I get them?)

 

3 - I tried that, but the angle is (strangely) opposite of the actual angle. And there's no [email protected] *= -1.0.

Share this post


Link to post
Share on other sites
BnB
3 - I tried that, but the angle is (strangely) opposite of the actual angle. And there's no [email protected] *= -1.0.

 

 

Then put it!

Share this post


Link to post
Share on other sites
TheSiggi

use

 

0012: [email protected] *= -1 

 

then

 

a float multiplied with an int should give you a float (don't think SBs compiler is strict 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.

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.