vlads Posted April 19, 2019 Share Posted April 19, 2019 The mod seems to be working fine except everytime i got hit by the hydra/jet homing missile directly in the center body of my helicopter were my left and right door gunner stand the game crushes. {$CLEO .cs} 0000: "Helicopter Gunner" :GUNNER wait 0 if Player.Defined($PLAYER_CHAR) jf @GUNNER if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @GUNNER [email protected] = Actor.CurrentCar($PLAYER_ACTOR) 092B: [email protected] = group $PLAYER_GROUP member 2 092B: [email protected] = group $PLAYER_GROUP member 3 0470: [email protected] = actor [email protected] current_weapon 0470: [email protected] = actor [email protected] current_weapon if and 056D: actor [email protected] defined 056D: actor [email protected] defined jf @GUNNER if 056E: car [email protected] defined jf @GUNNER 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0446: set_actor [email protected] dismemberment_possible 0 0446: set_actor [email protected] dismemberment_possible 0 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 jump @GUNNER I'm kinda new in scripting so you might find my script very weak. Link to comment Share on other sites More sharing options...
ZAZ Posted April 19, 2019 Share Posted April 19, 2019 Your whole script loops permanently All codes are repeated and will be executed thousand times per second Add a new loop for the new situation {$CLEO .cs} 0000: "Helicopter Gunner" :GUNNER wait 0 if Player.Defined($PLAYER_CHAR) jf @GUNNER if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @GUNNER 5@ = Actor.CurrentCar($PLAYER_ACTOR) 092B: 1@ = group $PLAYER_GROUP member 2 092B: 2@ = group $PLAYER_GROUP member 3 0470: 7@ = actor 1@ current_weapon 0470: 8@ = actor 2@ current_weapon if and 056D: actor 1@ defined 056D: actor 2@ defined jf @GUNNER 0464: put_actor 1@ into_turret_on_car 5@ at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon 7@ 0464: put_actor 2@ into_turret_on_car 5@ at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon 8@ 0446: set_actor 1@ dismemberment_possible 0 0446: set_actor 2@ dismemberment_possible 0 0638: AS_actor 1@ stay_put 1 099F: AS_actor 1@ ignore_weapon_range 1 07DD: set_actor 1@ attack_rate 100 0638: AS_actor 2@ stay_put 1 099F: AS_actor 2@ ignore_weapon_range 1 07DD: set_actor 2@ attack_rate 100 :Action_Loop wait 0 if Player.Defined($PLAYER_CHAR) jf @cleanup if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @cleanup if and 0118: actor 1@ dead 0118: actor 2@ dead jf @Action_Loop :cleanup 01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian 01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian jump @GUNNER CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
vlads Posted April 19, 2019 Author Share Posted April 19, 2019 Thanks for the respond I did what you tought me i've add a new loops though i'm not sure if i did it right, but the game still crashes. {$CLEO .cs} 0000: "Helicopter Gunner" :GUNNER wait 0 if Player.Defined($PLAYER_CHAR) jf @GUNNER if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @GUNNER [email protected] = Actor.CurrentCar($PLAYER_ACTOR) 092B: [email protected] = group $PLAYER_GROUP member 2 092B: [email protected] = group $PLAYER_GROUP member 3 0470: [email protected] = actor [email protected] current_weapon 0470: [email protected] = actor [email protected] current_weapon jump @Actors :Actors if and 056D: actor [email protected] defined 056D: actor [email protected] defined jf @GUNNER 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 0223: set_actor [email protected] health_to 9999 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 0223: set_actor [email protected] health_to 9999 :Action_Loop wait 0 if Player.Defined($PLAYER_CHAR) jf @cleanup if 00DD: not actor $PLAYER_ACTOR driving_car_with_model #RAINDANC // 05CD: AS_actor $PLAYER_ACTOR exit_car [email protected] jf @cleanup if and 0118: actor [email protected] dead 0118: actor [email protected] dead jf @GUNNER :cleanup 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian jump @GUNNER However i found out that the direct hit of a homing missile gets the heli gunners killed and their death is real cause the crash so i gave them a 9999 health so they can't be killed technically and the crash stopped. Though the fact that the gunner can't be killed now is very unrealistic so i'm still looking for any possible way to fix this. Link to comment Share on other sites More sharing options...
In45do Posted April 20, 2019 Share Posted April 20, 2019 (edited) Try this one, I purposely change their health into 1000 to see if their do not cause a crash {$CLEO .cs} 0000: "Helicopter Gunner" :GUNNER wait 0 if Player.Defined($PLAYER_CHAR) jf @GUNNER if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @GUNNER 092B: [email protected] = group $PLAYER_GROUP member 2 092B: [email protected] = group $PLAYER_GROUP member 3 if and 056D: actor [email protected] defined 056D: actor [email protected] defined jf @GUNNER [email protected] = Actor.CurrentCar($PLAYER_ACTOR) 0470: [email protected] = actor [email protected] current_weapon 0470: [email protected] = actor [email protected] current_weapon 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 0223: set_actor [email protected] health_to 1000 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 0223: set_actor [email protected] health_to 1000 :Action_Loop wait 0 if and Player.Defined($PLAYER_CHAR) 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @cleanup if and 0118: actor [email protected] dead 0118: actor [email protected] dead jf @Action_Loop :cleanup 01C3: remove_references_to_car [email protected] 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian wait 500 jump @GUNNER Edited April 20, 2019 by In45do Link to comment Share on other sites More sharing options...
vlads Posted April 20, 2019 Author Share Posted April 20, 2019 Your script is not working it just remove the reference of my gang member. By the way i forgot that the script in my last post is not working. This is the working one that is suppose to be in my last post. {$CLEO .cs} 0000: "Helicopter Gunner" :GUNNER wait 0 if Player.Defined($PLAYER_CHAR) jf @GUNNER if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @GUNNER [email protected] = Actor.CurrentCar($PLAYER_ACTOR) 092B: [email protected] = group $PLAYER_GROUP member 2 092B: [email protected] = group $PLAYER_GROUP member 3 0470: [email protected] = actor [email protected] current_weapon 0470: [email protected] = actor [email protected] current_weapon jump @Actors :Actors if and 056D: actor [email protected] defined 056D: actor [email protected] defined jf @GUNNER 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 0223: set_actor [email protected] health_to 9999 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 0223: set_actor [email protected] health_to 9999 :Action_Loop wait 0 if Player.Defined($PLAYER_CHAR) jf @cleanup if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @cleanup if and 0118: actor [email protected] dead 0118: actor [email protected] dead jf @GUNNER :cleanup 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian 01C2: remove_references_to_actor [email protected] // Like turning an actor into a random pedestrian jump @GUNNER Just now, vlads said: Its not working it just remove the reference of my gang member. By the way i forgot that the script in my last post is not working. This is the working one that is suppose to be in my last post. {$CLEO .cs} 0000: "Helicopter Gunner" :GUNNER wait 0 if Player.Defined($PLAYER_CHAR) jf @GUNNER if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @GUNNER 5@ = Actor.CurrentCar($PLAYER_ACTOR) 092B: 1@ = group $PLAYER_GROUP member 2 092B: 2@ = group $PLAYER_GROUP member 3 0470: 7@ = actor 1@ current_weapon 0470: 8@ = actor 2@ current_weapon jump @Actors :Actors if and 056D: actor 1@ defined 056D: actor 2@ defined jf @GUNNER 0464: put_actor 1@ into_turret_on_car 5@ at_car_offset -1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon 7@ 0464: put_actor 2@ into_turret_on_car 5@ at_car_offset 1.10 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon 8@ 0638: AS_actor 1@ stay_put 1 099F: AS_actor 1@ ignore_weapon_range 1 07DD: set_actor 1@ attack_rate 100 0223: set_actor 1@ health_to 9999 0638: AS_actor 2@ stay_put 1 099F: AS_actor 2@ ignore_weapon_range 1 07DD: set_actor 2@ attack_rate 100 0223: set_actor 2@ health_to 9999 :Action_Loop wait 0 if Player.Defined($PLAYER_CHAR) jf @cleanup if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @cleanup if and 0118: actor 1@ dead 0118: actor 2@ dead jf @GUNNER :cleanup 01C2: remove_references_to_actor 1@ // Like turning an actor into a random pedestrian 01C2: remove_references_to_actor 2@ // Like turning an actor into a random pedestrian jump @GUNNER Link to comment Share on other sites More sharing options...
In45do Posted April 20, 2019 Share Posted April 20, 2019 My bad. This one has been tested. Should've working fine. {$CLEO .cs} :Cam 03A4: name_thread "gunner_test" :GUNNER wait 0 if Player.Defined($PLAYER_CHAR) jf @GUNNER if 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @GUNNER 092B: [email protected] = group $PLAYER_GROUP member 2 092B: [email protected] = group $PLAYER_GROUP member 3 if and 056D: actor [email protected] defined 056D: actor [email protected] defined jf @GUNNER [email protected] = Actor.CurrentCar($PLAYER_ACTOR) 0470: [email protected] = actor [email protected] current_weapon 0470: [email protected] = actor [email protected] current_weapon 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 0223: set_actor [email protected] health_to 1000 0638: AS_actor [email protected] stay_put 1 099F: AS_actor [email protected] ignore_weapon_range 1 07DD: set_actor [email protected] attack_rate 100 0223: set_actor [email protected] health_to 1000 [email protected] = 0 :Action_Loop wait 0 if and Player.Defined($PLAYER_CHAR) 00DD: actor $PLAYER_ACTOR driving_car_with_model #RAINDANC jf @cleanup2 if 056D: actor [email protected] defined jf @Check2 if 8118: not actor [email protected] dead jf @Dead1 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset -1.5 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] jump @Check2 :Dead1 01C2: remove_references_to_actor [email protected] [email protected] += 1 :Check2 if 056D: actor [email protected] defined jf @Check_All if 8118: not actor [email protected] dead jf @Dead2 0464: put_actor [email protected] into_turret_on_car [email protected] at_car_offset 1.5 0.0 0.0 position 0 shooting_angle_limit 360.0 with_weapon [email protected] jump @Check_All :Dead2 01C2: remove_references_to_actor [email protected] [email protected] += 1 :Check_All if [email protected] == 2 jf @Action_Loop :cleanup 0ACA: show_text_box "RELEASED" 01C3: remove_references_to_car [email protected] wait 500 jump @GUNNER :cleanup2 gosub @CheckReturn jump @cleanup :CheckReturn if 056D: actor [email protected] defined jf @CheckReturn2 01C2: remove_references_to_actor [email protected] :CheckReturn2 if 056D: actor [email protected] defined jf @return 01C2: remove_references_to_actor [email protected] :return return Link to comment Share on other sites More sharing options...
vlads Posted April 21, 2019 Author Share Posted April 21, 2019 Thanks men its working and also fixed the bugs in my previews script. But it only works in when i have 4 or more gang member and i have to recruit the gunner again everytime i exit the heli. Link to comment Share on other sites More sharing options...
In45do Posted April 22, 2019 Share Posted April 22, 2019 Try to change the numbers (member) in this opcode: 092B: [email protected] = group $PLAYER_GROUP member 2 092B: [email protected] = group $PLAYER_GROUP member 3 Link to comment Share on other sites More sharing options...