Anurag_Anmol Posted October 4, 2010 Share Posted October 4, 2010 (edited) 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 ) I want to make missiles, like Ryosuke's Missile mods and ZAZ's Pimp my Car mod. So tell me how to do that Thanks! Edited October 17, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/ Share on other sites More sharing options...
yair1221 Posted October 4, 2010 Share Posted October 4, 2010 i can only help with the minigun: 10@ = car.angle(0@) actor.angle(4@) = 10@ actor.angle(5@) = 10@ Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060150533 Share on other sites More sharing options...
BnB Posted October 4, 2010 Share Posted October 4, 2010 Missile Thats an example 0172: 9@ = actor $PLAYER_ACTOR Z_angle 02F6: 7@ = sine 9@ // (float) 02F7: @ = cosine 9@ // (float) 006B: 7@ *= 50.0 // (float)006B: 8@ *= 50.0 // (float) 0013: 7@ *= -1.0 0392: make_object 1@ moveable 1 0381: throw_object 1@ velocity_in_direction7@ 18@ 3.0 Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060150599 Share on other sites More sharing options...
Anurag_Anmol Posted October 5, 2010 Author Share Posted October 5, 2010 (edited) I don't understand sine and cosine stuff.. Whats the model of the missile of Ryosuke's and ZAZ's CLEO missiles? Heres the code - CODE DELETED Sorry if I'm asking for too much Edited October 17, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060151445 Share on other sites More sharing options...
yair1221 Posted October 5, 2010 Share Posted October 5, 2010 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 @rockets8@ = Car.Angle(0@)Actor.Angle(4@) = [email protected](5@) = 8@0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 100.0 0.00668: AS_actor 4@ rotate_and_shoot_at 1@ 2@ 3@ 100 ms0668: AS_actor 5@ rotate_and_shoot_at 1@ 2@ 3@ 100 ms:rocketswait 0if00E1: player 0 pressed_key 4jf @minigun8@ = Car.Angle(0@)Actor.Angle(6@) = [email protected](7@) = 8@0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 100.0 0.00668: AS_actor 6@ rotate_and_shoot_at 1@ 2@ 3@ 100 ms0668: AS_actor 7@ rotate_and_shoot_at 1@ 2@ 3@ 100 msjump @minigun that way you can press them both, without that other option you added ("MinigunsAndRocketsCheck") Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060151731 Share on other sites More sharing options...
Silent Posted October 5, 2010 Share Posted October 5, 2010 Sine and cosine function converts angle to offset. http://gtag.gtagaming.com/forums/index.php?showtopic=197 But that tuto has a mistake, cause 02F6 == sine and 02F7 == cosine. Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060151789 Share on other sites More sharing options...
Anurag_Anmol Posted October 5, 2010 Author Share Posted October 5, 2010 (edited) 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 ) And found it! ID is 3786 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 October 5, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060152085 Share on other sites More sharing options...
Silent Posted October 5, 2010 Share Posted October 5, 2010 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 Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060152088 Share on other sites More sharing options...
Anurag_Anmol Posted October 5, 2010 Author Share Posted October 5, 2010 I got the right offsets for the miniguns and rockets so it shouldn't be a problem lol lemme see what happens Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060152092 Share on other sites More sharing options...
ZAZ Posted October 5, 2010 Share Posted October 5, 2010 I don't understand sine and cosine stuff.. Whats the model of the missile of Ryosuke's and ZAZ's CLEO missiles? Heres the code - :MinigunsCheck_15wait 0if and00E1: player 0 pressed_key 1780E1: not player 0 pressed_key 4jf @RocketsCheck_258@ = Car.Angle(0@)Actor.Angle(4@) = [email protected](5@) = 8@0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 100.0 0.00668: AS_actor 4@ rotate_and_shoot_at 1@ 2@ 3@ 100 ms0668: AS_actor 5@ rotate_and_shoot_at 1@ 2@ 3@ 100 msjump @MinigunsCheck_15:RocketsCheck_25 wait 0if and00E1: player 0 pressed_key 480E1: not player 0 pressed_key 17jf @MinigunsAndRocketsCheck_358@ = Car.Angle(0@)Actor.Angle(6@) = [email protected](7@) = 8@0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 100.0 0.00668: AS_actor 6@ rotate_and_shoot_at 1@ 2@ 3@ 100 ms0668: AS_actor 7@ rotate_and_shoot_at 1@ 2@ 3@ 100 msjump @RocketsCheck_25:MinigunsAndRocketsCheck_35wait 0if and00E1: player 0 pressed_key 400E1: player 0 pressed_key 17jf @NotDrivingCheck_108@ = Car.Angle(0@)Actor.Angle(4@) = [email protected](5@) = [email protected](6@) = [email protected](7@) = 8@0407: store_coords_to 1@ 2@ 3@ from_car 0@ with_offset 0.0 100.0 0.00668: AS_actor 4@ rotate_and_shoot_at 1@ 2@ 3@ 100 ms0668: AS_actor 5@ rotate_and_shoot_at 1@ 2@ 3@ 100 ms0668: AS_actor 6@ rotate_and_shoot_at 1@ 2@ 3@ 100 ms0668: AS_actor 7@ rotate_and_shoot_at 1@ 2@ 3@ 100 msjump @MinigunsAndRocketsCheck_35 Sorry if I'm asking for too much try this 0668: AS_actor 4@ rotate_and_shoot_at 1@ 2@ 3@ 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 Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060152104 Share on other sites More sharing options...
Anurag_Anmol Posted October 5, 2010 Author Share Posted October 5, 2010 (edited) 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 EDIT : Well the game crashed.. and I don't really see the need for sine and cosine for a missile. Dammit this is hard! EDIT 2 : Apparently I did some things wrong, fixed, now trying. EDIT 3 : Game Crash again Heres the code, still has problems with it (which I can't find) - CODE DELETED Edited October 17, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060152124 Share on other sites More sharing options...
ZAZ Posted October 6, 2010 Share Posted October 6, 2010 {$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 11@ 12@ 13@ from_actor $PLAYER_ACTOR offset 0.0 5.0 0.00107: 1@ = create_object 3054 at 11@ 12@ 13@04D9: object 1@ set_scripted_collision_check 10382: set_object 1@ collision_detection 1wait 20000392: object 1@ toggle_in_moving_list 10381: throw_object 1@ distance 0.0 5.0 15.0wait 5000Object.Destroy(1@)0249: release_model 30540002: jump @Objectthrow_1 Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060153062 Share on other sites More sharing options...
Anurag_Anmol Posted October 6, 2010 Author Share Posted October 6, 2010 (edited) 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 October 17, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060153259 Share on other sites More sharing options...
TheSiggi Posted October 6, 2010 Share Posted October 6, 2010 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 1@ 2@ 3@ from_car 0@ with_offset 1.4 1.0 -1.49@ = Object.Create(3786, 1@, 2@, 3@)10@ = Car.Angle(0@)Object.Angle(9@) = 10@0392: make_object 9@ moveable 104D9: object 9@ set_scripted_collision_check 1Object.CollisionDetection(9@) = True06A2: get_car 0@ velocity_in_direction_XYZ 1@ 2@ 3@2@ += 50.00381: throw_object 0@ velocity_in_direction 0.0 2@ 10.00392: object 9@ toggle_in_moving_list 1:CollisionDetection_32wait 0if04DA: has_object 9@ collidedjf @CollisionDetection_3201BB: store_object 9@ position_to 1@ 2@ 3@ 0948: create_explosion_at 1@ 2@ 3@ type 11 camera_shake 5.0 Object.Destroy(9@)if or80E1: not player 0 pressed_key 400E1: player 0 pressed_key 17jf @RocketsFiring_30 yeah go ahead 08D2: object 347@(39@,10i) scale_model 0.3 066D: 100@ = attach_particle "SMOKE_FLARE" to_object 94@ with_offset 0.0 0.0 0.1 flag 1 and you know the coord opcodes Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060153263 Share on other sites More sharing options...
Anurag_Anmol Posted October 6, 2010 Author Share Posted October 6, 2010 (edited) 1 prob, velocity in direction makes missiles go north, not front of vehicle Lol tho it works nice when vehicle is facing north Edited October 6, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060153313 Share on other sites More sharing options...
Deji Posted October 7, 2010 Share Posted October 7, 2010 (edited) That's because you're not using sine/cosine... "Green blob" and "red car" is all I have to say I fixed the opcode mixups. Edited October 7, 2010 by Deji Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060153580 Share on other sites More sharing options...
Anurag_Anmol Posted October 7, 2010 Author Share Posted October 7, 2010 (edited) Gaaaaaaaaaah I still have to learn sine and cosine T_T Wait getting the hang of it EDIT : Something is wrong here - CODE DELETED Edited October 17, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060153956 Share on other sites More sharing options...
Deji Posted October 7, 2010 Share Posted October 7, 2010 What's wrong, exactly? Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060154154 Share on other sites More sharing options...
TheSiggi Posted October 7, 2010 Share Posted October 7, 2010 :RocketsCheck_25if and00E1: player 0 pressed_key 480E1: not player 0 pressed_key 17jf @MinigunsAndRocketsCheck_35 there is no label ..._35 and if it should be 25 you need to add a wait under the Label Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060154174 Share on other sites More sharing options...
ZAZ Posted October 7, 2010 Share Posted October 7, 2010 (edited) 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 October 7, 2010 by ZAZ Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060154208 Share on other sites More sharing options...
Anurag_Anmol Posted October 7, 2010 Author Share Posted October 7, 2010 (edited) @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 Here is the full script - CODE DELETED Edited October 17, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060154418 Share on other sites More sharing options...
Deji Posted October 8, 2010 Share Posted October 8, 2010 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? 8@ = Car.Angle(0@)8@ += 270.0Object.Angle(9@) = 8@069A: attach_object 9@ to_object 10@ with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.002F6: 16@ = sine 8@ // (float)02F7: 17@ = cosine 8@ // (float)16@ *= 10.017@ *= 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: 8@ = Car.Angle(0@)8@ += 270.0Object.Angle(9@) = 8@069A: attach_object 9@ to_object 10@ with_offset 0.0 0.0 0.0 rotation 0.0 0.0 0.08@ = Car.Angle(0@) // this line is in case your problem is that the missile flies sideways02F6: 16@ = sine 8@ // (float)02F7: 17@ = cosine 8@ // (float)// bigger value == greater distance && greater speed16@ *= 40.017@ *= 40.0 Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060154821 Share on other sites More sharing options...
Anurag_Anmol Posted October 8, 2010 Author Share Posted October 8, 2010 (edited) Thanks Deji! I forgot that 270.0 addition, it was to make the missile face the front. Thanks, trying 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 October 17, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060154914 Share on other sites More sharing options...
Anurag_Anmol Posted October 9, 2010 Author Share Posted October 9, 2010 Bump bump bump bump bump! Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060156325 Share on other sites More sharing options...
Anurag_Anmol Posted October 15, 2010 Author Share Posted October 15, 2010 (edited) 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 October 17, 2010 by Anurag_Anmol Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060162685 Share on other sites More sharing options...
ZAZ Posted October 15, 2010 Share Posted October 15, 2010 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 Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060162694 Share on other sites More sharing options...
BnB Posted October 15, 2010 Share Posted October 15, 2010 3. If your are using this code then remove 0013: 7@ *= -1.0 0172: 9@ = actor $PLAYER_ACTOR Z_angle 02F6: 7@ = sine 9@ // (float) 02F7: @ = cosine 9@ // (float) 006B: 7@ *= 50.0 // (float)006B: 8@ *= 50.0 // (float) 0013: 7@ *= -1.0 0392: make_object 1@ moveable 1 0381: throw_object 1@ velocity_in_direction7@ 18@ 3.0 Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060162771 Share on other sites More sharing options...
Anurag_Anmol Posted October 15, 2010 Author Share Posted October 15, 2010 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 7@ *= -1.0. Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060162848 Share on other sites More sharing options...
BnB Posted October 15, 2010 Share Posted October 15, 2010 3 - I tried that, but the angle is (strangely) opposite of the actual angle. And there's no 7@ *= -1.0. Then put it! Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060163088 Share on other sites More sharing options...
TheSiggi Posted October 15, 2010 Share Posted October 15, 2010 use 0012: 22@ *= -1 then a float multiplied with an int should give you a float (don't think SBs compiler is strict here) Link to comment https://gtaforums.com/topic/460415-minigun-and-missiles-help/#findComment-1060163093 Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now