Jump to content

Problem with flame thrower


Recommended Posts

I have created a cleo, where a car can shoot fire from the rear bumper, it works as planned, but I cant see the flame from the flamethrower.

In another forum someone told me, I must aim in the air and shoot, it worked, but IDK how to solve that problem for a spawned ped with flamethrower which is attached to the car, here my code:

 

 

// This file was decompiled using sascm.ini published by Seemann (http://sannybuilder.com/files/SASCM.rar) on 13.10.2007{$VERSION 3.1.0027}{$CLEO .cs}//-------------MAIN---------------thread 'FLAMETHROWER' 30@ = 0.0 :FLAMETHROWER_29wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @FLAMETHROWER_29 if or  Actor.DrivingVehicleType($PLAYER_ACTOR, #BFINJECT)  Actor.DrivingVehicleType($PLAYER_ACTOR, #ESPERANT)  Actor.DrivingVehicleType($PLAYER_ACTOR, #BANDITO)else_jump @FLAMETHROWER_29 if 0AB0:   key_pressed 99 else_jump @FLAMETHROWER_29 :FLAMETHROWER_99Model.Load(#NITESTICK)Model.Load(#FLAME)Model.Load(#MALE01)038B: load_requested_models jump @FLAMETHROWER_122 :FLAMETHROWER_122wait 0 if and  Model.Available(#NITESTICK)  Model.Available(#FLAME)  Model.Available(#MALE01)else_jump @FLAMETHROWER_99 03C0: 0@ = actor $PLAYER_ACTOR car 0407: store_coords_to 7@ 8@ 9@ from_car 0@ with_offset 0.0 -2.6 -1.0 2@ = Object.Create(#NITESTICK, 7@, 8@, 9@)Object.CollisionDetection(2@) = False0750: set_object 2@ visibility 0 12@ = Actor.Create(CivMale, #MALE01, 0.0, 0.0, 0.0)01B2: give_actor 12@ weapon 37 ammo 99999 // Load the weapon model before using this 01B9: set_actor 12@ armed_weapon_to 37 Actor.WeaponAccuracy(12@) = 1000337: set_actor 12@ visibility 0 Actor.SetImmunities(12@, 1, 1, 1, 1, 1)02A9: set_actor 12@ immune_to_nonplayer 1 0619: enable_actor 12@ collision_detection 0 04F4: put_actor 12@ into_turret_on_object 2@ offset_from_object_origin 0.3 1.2 0.5 orientation 0 both_side_angle_limit 360.0 lock_weapon 37 wait 1000 jump @FLAMETHROWER_349 :FLAMETHROWER_349wait 0 if   not Actor.Dead(12@)else_jump @FLAMETHROWER_754 if or  Actor.DrivingVehicleType($PLAYER_ACTOR, #BFINJECT)  Actor.DrivingVehicleType($PLAYER_ACTOR, #ESPERANT)  Actor.DrivingVehicleType($PLAYER_ACTOR, #BANDITO)else_jump @FLAMETHROWER_754 0681: attach_object 2@ to_car 0@ with_offset 0.0 -2.6 -1.0 rotation 0.0 0.0 30@ 04F4: put_actor 12@ into_turret_on_object 2@ offset_from_object_origin 0.3 1.2 0.5 orientation 0 both_side_angle_limit 360.0 lock_weapon 37 jump @FLAMETHROWER_479 :FLAMETHROWER_479wait 0 if   not Actor.Dead(12@)else_jump @FLAMETHROWER_754 if 0AB0:   key_pressed 17 else_jump @FLAMETHROWER_585 0400: store_coords_to 13@ 14@ 15@ from_object 2@ with_offset 0.0 -50.0 2.0 017B: set_actor 12@ weapon 37 ammo_to 99999 0668: AS_actor 12@ rotate_and_shoot_at 13@ 14@ 15@ 100 ms jump @FLAMETHROWER_349 :FLAMETHROWER_585wait 0 if 0AB0:   key_pressed 39 else_jump @FLAMETHROWER_642 if   not 30@ > 45.0 else_jump @FLAMETHROWER_642 30@ += 1.0 jump @FLAMETHROWER_349 :FLAMETHROWER_642wait 0 if 0AB0:   key_pressed 37 else_jump @FLAMETHROWER_699 if  30@ >= -45.0 else_jump @FLAMETHROWER_585 30@ -= 1.0 jump @FLAMETHROWER_349 :FLAMETHROWER_699wait 0 if 0AB0:   key_pressed 99 else_jump @FLAMETHROWER_349 jump @FLAMETHROWER_754 :FLAMETHROWER_754Object.Destroy(2@)Actor.DestroyInstantly(12@)Model.Destroy(#NITESTICK)Model.Destroy(#MALE01)Model.Destroy(#FLAME)wait 1000 jump @FLAMETHROWER_29 

 

Any ideas? I have already tried attaching the flamethrower particle to the actor, this also didnt work(no I didnt forget to make it visible). but when I hold the fire button while exiting, the flamethrower particle got visible and was at the same place all the time (not attached to anything)

 

I hope im posting this to the right forum confused.gif

 

Another,SERIOUS problem(everything in main.scm):

 

I have created a save pickup now, becuse soon im going to make missions for my mod (Knight Rider Old School)

I had to make a few script changes, but then it worked, I saved the game and I was able to load it, but when I tryed using turboboost, the game crashed (it worked before I loaded the game)

I tryed removing the mp3 file from the code and it worked. I have also tried adding my sound to SFX/script( wav 45200), it worked but the quality was bad, maybe because I replaced it with a dialog.

here is my code, I hope you guys can help me with this one, I will change the other scripts when I know what to do

 

:TBOOSTthread 'TBOOST'$TBOOSTSPD = 0.2 $TBOOSTSPDN = 1 0AAC: $TBOOSTSOUND = load_mp3 "CLEO\AUDIO\TURBOBOOST.MP3":TBOOST_60wait 0 if   Player.Defined($PLAYER_CHAR)else_jump @TBOOST_60if   Actor.InCar($PLAYER_ACTOR, $KITT)else_jump @TBOOST_60 :TBOOST_107wait 0 if 0AB0:   key_pressed 16 else_jump @TBOOST_324 wait 50 jump @TBOOST_137 :TBOOST_137if and81F3:   not car $KITT in_air 81F4:   not car $KITT flipped else_jump @TBOOST_60 0AAD: set_mp3 $TBOOSTSOUND perform_action 0 0AAD: set_mp3 $TBOOSTSOUND perform_action 1 06A2: get_car $KITT velocity_in_direction_XYZ $TBOOST1 $TBOOST2 $TBOOST3 $TBOOST1 /= 2500.0 $TBOOST2 /= 2500.0 $TBOOST3 /= 2500.0 02F8: get_car $KITT Z_angle_cosine_to $TBOOST4 02F9: get_car $KITT Z_angle_sine_to $TBOOST5 $TBOOST4 *= 0.35 $TBOOST5 *= 0.35 005B: $TBOOST1 += $TBOOST4 // (float) 005B: $TBOOST2 += $TBOOST5 // (float) jump @TBOOST_275 :TBOOST_275005B: $TBOOST3 += $TBOOSTSPD // (float) 07D5: set_car $KITT velocity_in_direction_XYZ $TBOOST1 $TBOOST2 $TBOOST3 rotation_velocitiesXY 0.0 0.0 unk 0.0 wait 2000 jump @TBOOST_60 :TBOOST_324wait 0 if and0AB0:   key_pressed 84 0AB0:   key_pressed 51 else_jump @TBOOST_431 if   not $TBOOSTSPD > 0.4 else_jump @TBOOST_431 $TBOOSTSPDN += 1 03F0: enable_text_draw 1 01E4: show_text_1number_lowpriority GXT 'TBOOST' number $TBOOSTSPDN time 150 flag 1  // TBoostPower: ~1~033F: set_text_draw_letter_size 1.0 1.0 $TBOOSTSPD += 0.01 wait 20 jump @TBOOST_107 :TBOOST_431wait 0 if and0AB0:   key_pressed 84 0AB0:   key_pressed 52 else_jump @TBOOST_60 if  $TBOOSTSPD >= 0.2 else_jump @TBOOST_324 $TBOOSTSPDN -= 1 03F0: enable_text_draw 1 01E4: show_text_1number_lowpriority GXT 'TBOOST' number $TBOOSTSPDN time 150 flag 1  // TBoostPower: ~1~033F: set_text_draw_letter_size 1.0 1.0 $TBOOSTSPD -= 0.01 wait 20 jump @TBOOST_107

 

 

PS: I havent found any check if the mp3 is loaded.

Edited by Roflcake
Link to comment
https://gtaforums.com/topic/439530-problem-with-flame-thrower/
Share on other sites

The object NITESTICK disturb the flame

Remove the object and use get coords from car to give the actor the shooting target

But the car will burn then

 

0337: set_actor 12@ visibility 0Actor.SetImmunities(12@, 1, 1, 1, 1, 1)02A9: set_actor 12@ immune_to_nonplayer 10619: enable_actor 12@ collision_detection 0//04F4: put_actor 12@ into_turret_on_object 2@ offset_from_object_origin 0.3 1.2 0.5 orientation 0 both_side_angle_limit 360.0 lock_weapon 3706A7: put_actor 12@ into_turret_on_car 0@ at_car_offset 0.0 -2.1 -0.5 position 1 shooting_angle 360.0 360.0 with_weapon 37wait 1000jump @FLAMETHROWER_349:FLAMETHROWER_349wait 0if not Actor.Dead(12@)else_jump @FLAMETHROWER_754if or Actor.DrivingVehicleType($PLAYER_ACTOR, #BFINJECT) Actor.DrivingVehicleType($PLAYER_ACTOR, #ESPERANT) Actor.DrivingVehicleType($PLAYER_ACTOR, #BANDITO)else_jump @FLAMETHROWER_754//0681: attach_object 2@ to_car 0@ with_offset 0.0 -2.6 -1.0 rotation 0.0 0.0 30@//04F4: put_actor 12@ into_turret_on_object 2@ offset_from_object_origin 0.3 1.2 0.5 orientation 0 both_side_angle_limit 360.0 lock_weapon 37jump @FLAMETHROWER_479:FLAMETHROWER_479wait 0if not Actor.Dead(12@)else_jump @FLAMETHROWER_754if0AB0:   key_pressed 1else_jump @FLAMETHROWER_585//0400: store_coords_to 13@ 14@ 15@ from_object 2@ with_offset 0.0 -50.0 2.00407: store_coords_to 13@ 14@ 15@ from_car 0@ with_offset 0.0 -12.6 0.0//017B: set_actor 12@ weapon 37 ammo_to 999990668: AS_actor 12@ rotate_and_shoot_at 13@ 14@ 15@ 100 msjump @FLAMETHROWER_349

 

The object NITESTICK disturb the flame

Remove the object and use get coords from car to give the actor the shooting target

But the car will burn then

 

0337: set_actor 12@ visibility 0Actor.SetImmunities(12@, 1, 1, 1, 1, 1)02A9: set_actor 12@ immune_to_nonplayer 10619: enable_actor 12@ collision_detection 0//04F4: put_actor 12@ into_turret_on_object 2@ offset_from_object_origin 0.3 1.2 0.5 orientation 0 both_side_angle_limit 360.0 lock_weapon 3706A7: put_actor 12@ into_turret_on_car 0@ at_car_offset 0.0 -2.1 -0.5 position 1 shooting_angle 360.0 360.0 with_weapon 37wait 1000jump @FLAMETHROWER_349:FLAMETHROWER_349wait 0if not Actor.Dead(12@)else_jump @FLAMETHROWER_754if or Actor.DrivingVehicleType($PLAYER_ACTOR, #BFINJECT) Actor.DrivingVehicleType($PLAYER_ACTOR, #ESPERANT) Actor.DrivingVehicleType($PLAYER_ACTOR, #BANDITO)else_jump @FLAMETHROWER_754//0681: attach_object 2@ to_car 0@ with_offset 0.0 -2.6 -1.0 rotation 0.0 0.0 30@//04F4: put_actor 12@ into_turret_on_object 2@ offset_from_object_origin 0.3 1.2 0.5 orientation 0 both_side_angle_limit 360.0 lock_weapon 37jump @FLAMETHROWER_479:FLAMETHROWER_479wait 0if not Actor.Dead(12@)else_jump @FLAMETHROWER_754if0AB0:   key_pressed 1else_jump @FLAMETHROWER_585//0400: store_coords_to 13@ 14@ 15@ from_object 2@ with_offset 0.0 -50.0 2.00407: store_coords_to 13@ 14@ 15@ from_car 0@ with_offset 0.0 -12.6 0.0//017B: set_actor 12@ weapon 37 ammo_to 999990668: AS_actor 12@ rotate_and_shoot_at 13@ 14@ 15@ 100 msjump @FLAMETHROWER_349

 

Ok thanks, I will try it ASAP, and what about the mp3 problem?

 

Ok thanks, I will try it ASAP, and what about the mp3 problem?

Your TBOOST script works for me in a stripped main but I used a music song

anyway, the sounds starts always when I press shift in $KITT car

 

To check if the mp3 is loaded can you check if it's not -1

 

0AAC: $TBOOSTSOUND = load_mp3 "CLEO\AUDIO\TURBOBOOST.MP3"if8038:   NOT   $TBOOSTSOUND ==  -1jf @TBOOST_60

 

 

also a check if the mp3 file exist makes sense

 

if0AAB:   file_exists "CLEO\AUDIO\TURBOBOOST.MP3"004D: jump_if_false @TBOOST_60

 

 

and what Deji posted is right

If I add these checks, it still crashes confused.gif

 

What about changing the script, so the mp3 file is only loaded when the player is in bfinject($KITT), and when he exit the car, it will be unloaded?

I have tryed that already, but my game crashed, after I exited the car & entered it again.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • 0 User Currently Viewing
    0 members, 0 Anonymous, 0 Guests

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.