frankandbeans Posted April 9, 2016 Share Posted April 9, 2016 (edited) I've added 40mm firing sounds to the ac130 mod but I always crash after pressing it more than twice. Is there a way to spam the sounds? The 40mm LMB press from Ryosuke's ac130 mod: :AC130_5273Audiostream.PerformAction([email protected], PLAY)068D: get_camera_position_to [email protected] [email protected] [email protected] 068E: get_camera_target_point_to [email protected] [email protected] [email protected] 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 0063: [email protected] -= [email protected] // (float) 050A: [email protected] = distance_between_XYZ [email protected] [email protected] [email protected] and_XYZ 0.0 0.0 0.0 [email protected] /= 5.0 0073: [email protected] /= [email protected] // (float) 0073: [email protected] /= [email protected] // (float) 0073: [email protected] /= [email protected] // (float) 005B: [email protected] += [email protected] // (float) 005B: [email protected] += [email protected] // (float) 005B: [email protected] += [email protected] // (float) [email protected] *= 100.0 [email protected] *= 100.0 [email protected] *= 100.0 [email protected]([email protected],5i) = Object.Create(1582, [email protected], [email protected], [email protected])Object.CollisionDetection([email protected]([email protected],5i)) = TrueObject.ToggleInMovingList([email protected]([email protected],5i)) = True04D9: object [email protected]([email protected],5i) set_scripted_collision_check 1 0750: set_object [email protected]([email protected],5i) visibility 0 0906: set_object [email protected]([email protected],5i) mass_to 1.0 // float 0908: set_object [email protected]([email protected],5i) turn_mass_to 99999.9 // float Object.SetImmunities([email protected]([email protected],5i), 1, 1, 1, 1, 1)Object.Throw([email protected]([email protected],5i), [email protected], [email protected], [email protected]) The opcode 'Audiostream.PerformAction(20@, PLAY)' shown above is the only thing I added along with '[email protected] = Audiostream.Load("CLEO\ac130\ac130_40mm_fire_c2.WAV")' upon first entering turret mode on the gunship. Edited April 9, 2016 by frankandbeans Link to comment Share on other sites More sharing options...
goodidea82 Posted April 10, 2016 Share Posted April 10, 2016 Not sure what "spam audio" means. The opcode 'Audiostream.PerformAction(20@, PLAY)' shown above is the only thing I added along with '[email protected] = Audiostream.Load("CLEO\ac130\ac130_40mm_fire_c2.WAV")' upon first entering turret mode on the gunship. Maybe there is a problem with [email protected] = Audiostream.Load("CLEO\ac130\ac130_40mm_fire_c2.WAV") and you should check the result of it. Shouldn't the path be "...\\....\\..."? I suggest to write a test only for the Audiostream without the rest of the mod. Link to comment Share on other sites More sharing options...
ZAZ Posted April 10, 2016 Share Posted April 10, 2016 yes, mp3 file path is required either only with opcodes 0AAC: and 0AAD:, without 3dsupport, means without assignment to actor, vehicle or object i did it mostly in this way //-scriptgosub @music//-code:MP3_ONEif0AAB: file_exists "CLEO\sound.mp3"jf @MP3_nomp30AAC: [email protected] = load_mp3 "CLEO\sound.mp3"wait 0if8039: not [email protected] == -1jf @MP3_return0AAD: set_mp3 [email protected] perform_action 1jump @MP3_return:MP3_nomp300BA: show_text_styled GXT 'fem_off' time 1000 style 4wait 1000:MP3_returnreturnOr with 0AC1: and 0AAD: and additional the code to assigne to actor, vehicle or object,then cleo 4 is required because mp3 is attached to actor, so it have the effect that the music have less volume if distance between player and actor is bigger 0AC1: [email protected] = load_audiostream_with_3d_support "CLEO\music.mp3"0AAD: set_mp3 [email protected] perform_action 10AC4: link_3d_audiostream [email protected] to_actor [email protected]// - cleo 4 -but this method have also the side effect that the total volume of the music is more quietI mostly did it in this way //-scriptgosub @music//-code:musicif0AAB: file_exists "CLEO\music.mp3"jf @music_nomp30AC1: [email protected] = load_audiostream_with_3d_support "CLEO\music.mp3"wait 0if8039: not [email protected] == -1jf @music_return0AAD: set_mp3 [email protected] perform_action 10AC4: link_3d_audiostream [email protected] to_actor [email protected]// - cleo 4 -jump @music_return:music_nomp300BA: show_text_styled GXT 'fem_off' time 1000 style 4wait 1000:music_returnreturnor in this way, i wrote for cars with mp3 :car_audiowait 0if0AC1: [email protected] = load_audiostream_with_3d_support "CLEO\Sound\party1.MP3"// - cleo 4 - //IF and SETjf @car_audio0AAD: set_audiostream [email protected] perform_action 10AC5: link_3d_audiostream [email protected] to_vehicle [email protected]// - cleo 4 - CLEO MODS CLEO Script Tutorial Link to comment Share on other sites More sharing options...
frankandbeans Posted April 11, 2016 Author Share Posted April 11, 2016 (edited) edit: nvm..... Edited April 13, 2016 by frankandbeans 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