james227uk Posted April 3, 2010 Share Posted April 3, 2010 {$CLEO .cs}thread 'CHPGUNNA':1wait 00ADC: test_cheat "GUNNER"jf @104C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 56.0 60.004C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 56.0 60.00AB6: store_target_marker_coords_to [email protected] [email protected] [email protected] // IF and SETModel.Load(#raindanc)Model.Load(#MALE01):2wait 0if and Model.Available(#RAINDANC) Model.Available(#MALE01)jf @2Car.Create([email protected], #RAINDANC, [email protected], [email protected], [email protected])Marker.CreateAboveCar([email protected], [email protected])0129: [email protected] create_actor_pedtype 23 model #MALE01 in_car [email protected] driverseat0825: set_helicopter [email protected] instant_rotor_startwait 10000464: put_actor $PLAYER_ACTOR into_turret_on_car [email protected] at_car_offset 0.0 3.0 -3.0 position 0 shooting_angle_limit 360.0 with_weapon 3804A2: set_heli [email protected] fly_to [email protected] [email protected] [email protected] altitude_between 60.0 and 70.0//:3//wait 0//if// 00E1: 0 11//jf @3//0AB6: store_target_marker_coords_to [email protected] [email protected] [email protected] // IF and SET//04A2: set_heli [email protected] fly_to [email protected] [email protected] [email protected] altitude_between 30.0 and 40.0//jump @4:4wait 0if 00E1: 0 15jf @40465: remove_actor $PLAYER_ACTOR from_turret_mode Actor.PutAt($PLAYER_ACTOR, [email protected], [email protected], [email protected])04A2: set_heli [email protected] fly_to 0.0 0.0 0.0 altitude_between 60.0 and 70.0wait 5000Car.Destroy([email protected])Car.RemoveReferences([email protected])Actor.DestroyInstantly([email protected])Actor.RemoveReferences([email protected])Marker.Disable([email protected])Model.Destroy(#RAINDANC)jump @1 Can anyone see what's wrong with this? I had it working once, but I changed a few values and the game crashes BEFORE I get into the turret mode. As you can see in the script, I commented out my new part and changed the value back to what they were before but still, crash Thanks in advance Link to comment Share on other sites More sharing options...
NTAuthority Posted April 3, 2010 Share Posted April 3, 2010 (edited) Could you at least provide more information? Just saying 'this crashes' and coming with an unreadable script is sure to give you an answer. Try to get at least the crash address. Also, this appears to be wrong: Car.Create([email protected], #RAINDANC, [email protected], [email protected], [email protected]) The return value is always as last parameter in the commands used in GTA, or since IV in the specific 'result' field. EDIT: forgot that due to Sanny attempting to be 'friendly' the parameters are switched there for many commands. Edited April 3, 2010 by NTAuthority Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
james227uk Posted April 3, 2010 Author Share Posted April 3, 2010 Dunno what "more information" there is to provide. It crashed before I got onto the turret, as I said in OP And, /thread Forgot to load Minigun model, something I didn't do on Jeep Gunner yet it worked perfect Link to comment Share on other sites More sharing options...
NTAuthority Posted April 3, 2010 Share Posted April 3, 2010 Dunno what "more information" there is to provide. It crashed before I got onto the turret, as I said in OP Something like SALA's 'Exception At Address' value, in most cases it helps to find the cause near immediately. Inactive in GTA/R* title modification indefinitely pursuant to a court order obtained by TTWO. Good job acting against modding! Link to comment Share on other sites More sharing options...
Dutchy3010 Posted April 3, 2010 Share Posted April 3, 2010 You know that you don't have to load Male01, right? Do you mean that the problem is solved after loading the minigun? DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
Deji Posted April 3, 2010 Share Posted April 3, 2010 The troublesome line is here: 0464: put_actor $PLAYER_ACTOR into_turret_on_car [email protected] at_car_offset 0.0 3.0 -3.0 position 0 shooting_angle_limit 360.0 with_weapon 38 ... By looking at it for a while you may guess what the problem is. Load the weapon model first And for the line to even be valid, you need to give the player some ammo with that gun before putting him into turret mode. Also, you may have some problems with this later: Car.Destroy([email protected])Car.RemoveReferences([email protected])Actor.DestroyInstantly([email protected])Actor.RemoveReferences([email protected])Marker.Disable([email protected]) Destroying the car is the same as removing the reference and vice versa. No references means that it wanders off. Destroying it means that it dissapears. If you do both, you may get errors since you don't have any references to remove. And I'd disable the marker before destroying the car, since destroying the car may do both. Link to comment Share on other sites More sharing options...
james227uk Posted April 3, 2010 Author Share Posted April 3, 2010 (edited) @Dutchy3010 Yeah, I was just picking at straws. Trying everything @Deji I already solved it /thread Forgot to load Minigun model, something I didn't do on Jeep Gunner yet it worked perfect NEXT QUESTION Next highly request mod on my list is Emergency Air Drop and Care Package. Does anyone know the ID of a reasonable-sized moveable box? Does anyone know how I can improve the targetting system of this? It only shoots sometimes. {$CLEO .cs}thread 'PAVELOW':1wait 00ADC: "PAVELOW"jf @1Model.Load(#RAINDANC)Model.Load(#MINIGUN)04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 70.0 40.0 :2wait 0if and Model.Available(#RAINDANC) Model.Available(#MINIGUN)jf @2Car.Create([email protected], #RAINDANC, [email protected], [email protected] [email protected])0825: set_helicopter [email protected] instant_rotor_start Marker.CreateAboveCar([email protected], [email protected])0129: [email protected] = create_actor_pedtype 23 model #MALE01 in_car [email protected] driverseat0726: heli [email protected] follow_actor $PLAYER_ACTOR follow_car -1 radius [email protected] = Actor.Create(CivMale, #male01, 0.0, 0.0, 0.0)01B2: give_actor [email protected] weapon 35 ammo 99999 // Load the weapon model before using this 01B9: set_actor [email protected] armed_weapon_to 38 Actor.WeaponAccuracy([email protected]) = 1000337: set_actor [email protected] visibility 0 Actor.SetImmunities([email protected], 1, 1, 1, 1, 1)0619: enable_actor [email protected] collision_detection 0 //06A7: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.1 0.5 -5.2 position 1 shooting_angle 1.0 1.0 with_weapon 380464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 2.0 0.0 -0.5 position 1 shooting_angle_limit 360.0 with_weapon 38:3wait 004C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 0.0 0.0073E: get_car_in_sphere [email protected] [email protected] [email protected] radius 30.0 model -1 handle_as [email protected]:4wait 0if 00E1: 0 15then jump @7elseif [email protected] == -1then jump @5else 00AA: store_car [email protected] position_to [email protected] [email protected] [email protected] 0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 3000 ms wait 100 jump @5endend :5wait 0 089E: get_actor_in_sphere [email protected] [email protected] [email protected] radius 50.0 handle_as [email protected] // versionB:6wait 0if 00E1: 0 15then jump @7elseif [email protected] == -1 then jump @3else 00A0: store_actor [email protected] position_to [email protected] [email protected] [email protected] 0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 3000 ms wait 100 jump @3endend:7wait 0Marker.Disable([email protected])Actor.DestroyInstantly([email protected])Actor.RemoveReferences([email protected])04A2: set_heli [email protected] fly_to 0.0 0.0 180.0 altitude_between 30.0 and 40.0wait 10000Car.Destroy([email protected])Car.RemoveReferences([email protected])Actor.DestroyInstantly([email protected])Actor.RemoveReferences([email protected])Model.Destroy(#MINIGUN)Model.Destroy(#RAINDANC)jump @1 Edited April 3, 2010 by james227uk Link to comment Share on other sites More sharing options...
Dutchy3010 Posted April 4, 2010 Share Posted April 4, 2010 The first thing I see is that you don't change the values of "[email protected]" and "[email protected]" into -1. So after the first time, it won't get to -1 anymore. When the script starts again, it will have the same value as that it was the previous time the game went through the code. This will mean that it will shoot at the same actor/car. Perhaps a check to see if it is the same car/actor too? So, you have to put [email protected] = -1 and [email protected] = -1 into the code. [email protected] = -1 just before you make [email protected] a car, and [email protected] just before you make [email protected] an actor. At least you can give it a try? DYOM - Create, play, share! Link to comment Share on other sites More sharing options...
james227uk Posted April 4, 2010 Author Share Posted April 4, 2010 (edited) Thanks Dutchy, I'll try it now. If I can perfect this, I can use in in 4 other scripts EDIT: I don't quite get it. I made so that it scans for a vehicles, and if -1 is returned, it jumps to find a ped. If that returns -1, it jumps to find a vehicle again. It continues that until a ped/vehicle is found. When a ped or vehicle is found, it shoots at that position, then returns to the check Edited April 4, 2010 by james227uk Link to comment Share on other sites More sharing options...
JohnPro Posted April 4, 2010 Share Posted April 4, 2010 Thanks Dutchy, I'll try it now. If I can perfect this, I can use in in 4 other scripts EDIT: I don't quite get it. I made so that it scans for a vehicles, and if -1 is returned, it jumps to find a ped. If that returns -1, it jumps to find a vehicle again. It continues that until a ped/vehicle is found. When a ped or vehicle is found, it shoots at that position, then returns to the check Sounds like fun. Oops, am I interrupting something Link to comment Share on other sites More sharing options...
james227uk Posted April 4, 2010 Author Share Posted April 4, 2010 What? And, wow. After reading my last post, only now do I realise that it's grammar is so full of fail Link to comment Share on other sites More sharing options...
ZAZ Posted April 5, 2010 Share Posted April 5, 2010 @Dutchy3010 Yeah, I was just picking at straws. Trying everything @Deji I already solved it /thread Forgot to load Minigun model, something I didn't do on Jeep Gunner yet it worked perfect NEXT QUESTION Next highly request mod on my list is Emergency Air Drop and Care Package. Does anyone know the ID of a reasonable-sized moveable box? Does anyone know how I can improve the targetting system of this? It only shoots sometimes. Did you noticed that the game often select the same random car again, also wrecked cars. I made a script using arrays to get multible cars to keep the found cars defined in the script. look to FlipTraffic script I used get_random_actor and got the car of a driving ped and let it explode Cars of get_random_car are unstable in some cases, crash by several opcodes which affects the car so i decided to work only with get_random _actor A request in my showroom was to work out a choopergun: read here Another way is Wessers method CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
james227uk Posted April 5, 2010 Author Share Posted April 5, 2010 Thanks ZAZ. Given up on the target system for a while, instead trying to fix the target Lazing {$CLEO .cs}thread 'LAZE':1wait 0if 0ADC: "LAZE"jf @1Model.Load(#SWATVAN)Model.Load(#MINIGUN)04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset -6.0 0.0 0.0:2wait 0if and Model.Available(#SWATVAN) Model.Available(#MINIGUN)jf @2Car.Create([email protected], #SWATVAN, [email protected], [email protected], [email protected])0129: [email protected] = create_actor_pedtype 23 model #MALE01 in_car [email protected] driverseatCar.SetImmunities([email protected], 1, 1, 1, 1, 1)[email protected] = Actor.Create(CivMale, #male01, 0.0, 0.0, 0.0)01B2: give_actor [email protected] weapon 38 ammo 99999 // Load the weapon model before using this 01B9: set_actor [email protected] armed_weapon_to 38 Actor.WeaponAccuracy([email protected]) = 1000337: set_actor [email protected] visibility 0 Actor.SetImmunities([email protected], 1, 1, 1, 1, 1)0619: enable_actor [email protected] collision_detection 0 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 0.0 0.0 2.0 position 1 shooting_angle_limit 360.0 with_weapon 380726: heli [email protected] follow_actor $PLAYER_ACTOR follow_car -1 radius 20.0:2_1wait 004C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 1.0 6.0 0.0Car.DriveTo([email protected], [email protected], [email protected] , [email protected]):3wait 0if and 00E1: 0 11 00E1: 0 6jf @2_104C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 2.0 0.00172: [email protected] = actor $PLAYER_ACTOR Z_angleObject.Create([email protected], 1220, [email protected], [email protected], [email protected])0750: set_object [email protected] visibility 10382: set_object [email protected] collision_detection 10392: make_object [email protected] moveable 10381: throw_object [email protected] velocity_in_direction [email protected] [email protected] [email protected]:4wait 0if 05A3: object [email protected] stopped jf @40400: store_coords_to [email protected] [email protected] [email protected] from_object [email protected] with_offset 0.0 0.0 0.0 0668: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 2000 mswait 2000Object.Destroy([email protected])Object.RemoveReferences([email protected]):5wait 0if0ADC: "LAZE"jf @3Car.Destroy([email protected])Car.RemoveReferences([email protected])Actor.DestroyInstantly([email protected])Actor.DestroyInstantly([email protected])Actor.RemoveReferences([email protected])Actor.RemoveReferences([email protected])Model.Destroy(#SWATVAN)Model.Destroy(#MINIGUN)wait 1000jump @1 {[email protected] - Object Spawn [email protected] - Object Spawn [email protected] - Object Spawn [email protected] - Player [email protected] - [email protected] - Stryker Spawn [email protected] - Stryker Spawn [email protected] - Stryker Spawn [email protected] - [email protected] - Stryker [email protected] - Stryker [email protected] - Object End Position [email protected] - Object End Position [email protected] - Object End Position [email protected] - Player [email protected] - Player [email protected] - PLayer Z } It spawn the Stryker, which does follow me. However, the box it fires gets the target. However, it doesn't always work. Sometimes the box doesn't fire correct, and I can only fire the box once (The box hits the target, then the game records it's coords and makes the gunner fire there) Anyone got a working work around to the lack of a "get actor/object/car in aim" opcode? Link to comment Share on other sites More sharing options...
james227uk Posted April 5, 2010 Author Share Posted April 5, 2010 Double Posting Post will be miles long if I edited Can someone also tell me why this crashes? {$CLEO .cs}thread 'PAVELOW':1 wait 00ADC: "PAVELOW"jf @1Model.Load(#RAINDANC)Model.Load(#MINIGUN)04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 70.0 40.004C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 30.0 0.0 02CE: [email protected] = ground_z_at [email protected] [email protected] [email protected]:2wait 0if and Model.Available(#RAINDANC) Model.Available(#MINIGUN)jf @2Car.Create([email protected], #RAINDANC, [email protected], [email protected], [email protected])0825: set_helicopter [email protected] instant_rotor_start Marker.CreateAboveCar([email protected], [email protected])Marker.SetColor([email protected], 2)Car.SetImmunities([email protected], 1, 1, 1, 1, 1)0129: [email protected] = create_actor_pedtype 23 model #MALE01 in_car [email protected] driverseat0726: heli [email protected] follow_actor $PLAYER_ACTOR follow_car -1 radius [email protected] = Actor.Create(CivMale, #male01, 0.0, 0.0, 0.0)01B2: give_actor [email protected] weapon 38 ammo 99999 // Load the weapon model before using this 01B9: set_actor [email protected] armed_weapon_to 38 Actor.WeaponAccuracy([email protected]) = 1000337: set_actor [email protected] visibility 0 Actor.SetImmunities([email protected], 1, 1, 1, 1, 1)0619: enable_actor [email protected] collision_detection 0 //06A7: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.1 0.5 -5.2 position 1 shooting_angle 1.0 1.0 with_weapon 380464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 2.0 0.0 -0.5 position 1 shooting_angle_limit 360.0 with_weapon 3806D5: [email protected] = create_racing_checkpoint_at [email protected] [email protected] [email protected] point_to [email protected] [email protected] [email protected] type 2 radius 6.0wait 200006D6: disable_racing_checkpoint [email protected] 2000 :3wait 0089E: get_actor_in_sphere [email protected] [email protected] [email protected] radius 6.0 handle_as [email protected] // versionB if and not [email protected] == -1 00DF: actor [email protected] driving 8118: not actor [email protected] dead jf @303C0: [email protected] = actor [email protected] carActor.RemoveReferences([email protected]):4wait 000AA: store_car [email protected] position_to [email protected] [email protected] [email protected]: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 1500 msif or 8185: not car [email protected] health >= 0 81AD: not car [email protected] sphere 0 near_point [email protected] [email protected] radius 6.0 6.0jf @4Car.RemoveReferences([email protected]) :5wait 0if 00E1: 0 10jf @3jump @6:6wait 0Marker.Disable([email protected])Actor.DestroyInstantly([email protected])Actor.RemoveReferences([email protected])04A2: set_heli [email protected] fly_to 0.0 0.0 180.0 altitude_between 30.0 and 40.0wait 20000Car.Destroy([email protected])Car.RemoveReferences([email protected])Actor.DestroyInstantly([email protected])Actor.RemoveReferences([email protected])Model.Destroy(#MINIGUN)Model.Destroy(#RAINDANC)jump @1 Link to comment Share on other sites More sharing options...
Deji Posted April 6, 2010 Share Posted April 6, 2010 if and not [email protected] == -1 00DF: actor [email protected] driving 8118: not actor [email protected] deadjf @1 If the actor isn't defined, 00DF and 0118 cannot be used, or else a crash will occur. You should check if the actor is defined, THEN perform any other action that involves that actor. I pretty much guessed that one, but I did test that code on it's own so I'm pretty sure this is the problem. There may be other errors but it's 5:30am (watching Dark Angel yet again ) and I should go to bed (to continue watching Dark Angel.. gotta love Jessica Alba). EDIT: Oh yeah: Actor.RemoveReferences([email protected]):4wait 000AA: store_car [email protected] position_to [email protected] [email protected] [email protected]: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 1500 ms Definitely no references there Link to comment Share on other sites More sharing options...
james227uk Posted April 6, 2010 Author Share Posted April 6, 2010 Thanks, but why not remove references? From that point on, the script uses opcodes relating to his car Link to comment Share on other sites More sharing options...
Deji Posted April 6, 2010 Share Posted April 6, 2010 After removing the references, the value of [email protected] is set to -1. So you can't use 0668 or any other opcodes unless you turn [email protected] into a handle of some other entity. Actor.RemoveReferences([email protected]) // <<<:4wait 000AA: store_car [email protected] position_to [email protected] [email protected] [email protected]: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 1500 ms // <<< Link to comment Share on other sites More sharing options...
james227uk Posted April 6, 2010 Author Share Posted April 6, 2010 You nailed one of the errors in that block of code. I told the random actor to gun at that position, not the gunner. But to no avail, it still crashes {$CLEO .cs}thread 'PAVELOW':1 wait 00ADC: "PAVELOW"jf @1Model.Load(#RAINDANC)Model.Load(#MINIGUN)04C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 70.0 40.004C4: store_coords_to [email protected] [email protected] [email protected] from_actor $PLAYER_ACTOR with_offset 0.0 30.0 0.0 02CE: [email protected] = ground_z_at [email protected] [email protected] [email protected]:2wait 0if and Model.Available(#RAINDANC) Model.Available(#MINIGUN)jf @2Car.Create([email protected], #RAINDANC, [email protected], [email protected], [email protected])0825: set_helicopter [email protected] instant_rotor_start Marker.CreateAboveCar([email protected], [email protected])Marker.SetColor([email protected], 2)Car.SetImmunities([email protected], 1, 1, 1, 1, 1)0129: [email protected] = create_actor_pedtype 23 model #MALE01 in_car [email protected] driverseat0726: heli [email protected] follow_actor $PLAYER_ACTOR follow_car -1 radius [email protected] = Actor.Create(CivMale, #male01, 0.0, 0.0, 0.0)01B2: give_actor [email protected] weapon 38 ammo 99999 // Load the weapon model before using this 01B9: set_actor [email protected] armed_weapon_to 38 Actor.WeaponAccuracy([email protected]) = 1000337: set_actor [email protected] visibility 0 Actor.SetImmunities([email protected], 1, 1, 1, 1, 1)0619: enable_actor [email protected] collision_detection 0 //06A7: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.1 0.5 -5.2 position 1 shooting_angle 1.0 1.0 with_weapon 380464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 2.0 0.0 -0.5 position 1 shooting_angle_limit 360.0 with_weapon 3806D5: [email protected] = create_racing_checkpoint_at [email protected] [email protected] [email protected] point_to [email protected] [email protected] [email protected] type 2 radius 6.0wait 200006D6: disable_racing_checkpoint [email protected] 2000 :3wait 0089E: get_actor_in_sphere [email protected] [email protected] [email protected] radius 6.0 handle_as [email protected] // versionB if and not [email protected] == -1 00DF: actor [email protected] driving 8118: not actor [email protected] dead jf @303C0: [email protected] = actor [email protected] carActor.RemoveReferences([email protected]):4wait 000AA: store_car [email protected] position_to [email protected] [email protected] [email protected]: AS_actor [email protected] rotate_and_shoot_at [email protected] [email protected] [email protected] 1500 msif or 8185: not car [email protected] health >= 0 81AD: not car [email protected] sphere 0 near_point [email protected] [email protected] radius 6.0 6.0jf @4Car.RemoveReferences([email protected]) :5wait 0if 00E1: 0 10jf @3jump @6:6wait 0Marker.Disable([email protected])Actor.DestroyInstantly([email protected])Actor.RemoveReferences([email protected])04A2: set_heli [email protected] fly_to 0.0 0.0 180.0 altitude_between 30.0 and 40.0wait 20000Car.Destroy([email protected])Car.RemoveReferences([email protected])Actor.DestroyInstantly([email protected])Actor.RemoveReferences([email protected])Model.Destroy(#MINIGUN)Model.Destroy(#RAINDANC)jump @1 Thanks for spotting that error Link to comment 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