MAD BOSS Posted August 4, 2010 Share Posted August 4, 2010 Yeap, I've always wanted to make Nitro Sound in Vice City. Here is a bit of a code sketchup: I allready have this thread up and running: If player is driving (some fast car), and keys pressed W+CTRL, speed is multipliedeffects of fire and corona behind the car (just like in NFS)[email protected] begining Now, when I tried to make sound load while pressing the same key combination, the game always crashes. This is a sketchup of my failed sound mod: :LOADwait 50If and -defined-driving (fast car)-key combination pressedjf @LOADload wav "WAV_1" as [email protected] NITRO:NITROwait 0if and-player defined-driving the fast carjf @EXITif-wav 1 loadedjf @LOADifkeys pressed W+CTRL (holding them)jf @ENDplay wav 1:NEXTwait 0if-driving the fast carjf @EXITif-Keys pressed W+CTRLjf @NITROjump @NEXT:EXITunload wav 1jump @LOAD NOTE: This is just a sketchup code, so you can understand the way I wanna go with this: Once you press the combination, car will play the wav IF you hold it, he will not load it again, but leave it play until the end Once finished (wav), or keys not pressed, wav stops and thread is looped Sound is about 40 seconds long, so when it ends, the code is idle for like 10 sec (to fill up the NOS again) And then the loop I really hope someone is willing to participate in this, as I've allready made Neon mods, Nitro effects and shared it all with you guys, so now I need this help of codding the sounds for them So please, can anyone help me make this mod? Link to comment Share on other sites More sharing options...
MW_29 Posted August 4, 2010 Share Posted August 4, 2010 Are you planing to limit maximum speed that could be achieved by using nitro boost too in this mod? ...im asking about it bcz car flying up to the skies is a bit exaggerated i think ;D ...Well nitro sound just like in NFS would be damn great ;D Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 4, 2010 Author Share Posted August 4, 2010 Are you planing to limit maximum speed that could be achieved by using nitro boost too in this mod? ...im asking about it bcz car flying up to the skies is a bit exaggerated i think ;D ...Well nitro sound just like in NFS would be damn great ;D The speeding part is done, I am now totally focused on the sound part! And I need some help from someone who knows what's wrong with my code.. Link to comment Share on other sites More sharing options...
Silent Posted August 5, 2010 Share Posted August 5, 2010 Test that construction: :LOADwait 250if-defined // It is better to keep player_defined conditional in separate if.jf @LOADif and-driving (fast car)-key combination pressedjf @LOADload wav "WAV_1" as 1:NITROwait 0if and-player defined-driving the fast carjf @EXITif-wav 1 loadedjf @NITRO // Main changeifkeys pressed W+CTRL (holding them)jf @END // That label doesn't exists;oplay wav 1:NEXTwait 0if-driving the fast carjf @EXITif-Keys pressed W+CTRLjf @NITROjump @NEXT:EXITunload wav 1jump @LOAD Link to comment Share on other sites More sharing options...
Frank.s Posted August 5, 2010 Share Posted August 5, 2010 (edited) I think it won't work for two reasons, one is because the JumpFalse for the keypress check in the :NEXT label should jump to :NEXT when instead it jumps to :NITRO also change the jump under it from :NEXT to :NITRO (basically swapping what label the two jump to). The second reason is because vice won't play a .wav file that isn't an original (named) one so you will need to replace one of the existing .wav files in the audio folder to play it. Edited August 5, 2010 by frank.s Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 5, 2010 Author Share Posted August 5, 2010 I accidently wrote :END insted of EXIT... @frank.s As for the switching jf and jump labels, I know why I made them this way. Beacuse if the wav allready started, the NEXT thread is used not to stop it UNTIL player either leaves the car or releases the keys. If I switch those to labels as you suggested, the wav would constantly loop every 250ms and that wasn't the idea Link to comment Share on other sites More sharing options...
MW_29 Posted August 5, 2010 Share Posted August 5, 2010 (edited) So, as you wrote in first post, this would need to look like this: :LOADwait 50If Player.Defined($PLAYER_CHAR)jf @LOADIf and 00DE: player $PLAYER_CHAR driving_vehicle_type #BANSHEE 05EE: key_pressed 87 //VK_... 05EE: key_pressed 17 //VK_...jf @LOAD03CF: load_wav 'STRIP_1' as $1 jump @NITRO:NITROwait 0if and Player.Defined($PLAYER_CHAR) 00DE: player $PLAYER_CHAR driving_vehicle_type #BANSHEEjf @EXITif03D0: wav 1 loaded jf @LOADif 05EE: key_pressed 87 //VK_... 05EE: key_pressed 17 //VK_...jf @EXIT03D1: play_wav $1 :NEXTwait 0if 00DE: player $PLAYER_CHAR driving_vehicle_type #BANSHEEjf @EXITif 05EE: key_pressed 87 //VK_... 05EE: key_pressed 17 //VK_...jf @NITROjump @NEXT:EXIT040D: unload_wav $1 jump @LOAD But i am sure that you have already tested this construction, but i am posting this code for others, more advanced coders than me to see exactly what the idea looks like and i hope someone can figure this out and the idea will become reality I am almost deadly sure that this code i have posted, needs serious fixes ...i am also offering my help, i mean if i will be able to help in something , but i am still interesting in Vice modding so I'll try ;D PS.: I wrote 'Strip_1' bcz this sound i have never heard in game , but it is stock .wav file that already VC has had, so it could be simply replaced with nitro boost sound Edited August 5, 2010 by MW_29 Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 5, 2010 Author Share Posted August 5, 2010 Ok, I debuged it a bit, but I still can't make the sound PLAY! I used scanlines to test if script is working nice, looping etc... It is, but no sound... // This file was decompiled using vicescm.ini published by GtaForums.com on 27.7.07{$VERSION 2.2.0000}{$CLEO .cs}//-------------MAIN---------------0000: :LOADwait 250if Player.Defined($PLAYER_CHAR)jf @LOADif and00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRB00E1: key_pressed 0 17jf @LOAD03CF: load_wav 'MOB_52A' as [email protected] jump @NITRO:NITRO;wait 0if03D0: wav [email protected] loadedjf @LOAD04C7: toggle_camera_green_scanlines 1 if00E1: key_pressed 0 17jf @EXIT03D1: play_wav [email protected] @NEXT:NEXTwait 0if and83D2: not wav [email protected] ended 00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRBjf @EXITif00E1: key_pressed 0 17jf @NITROjump @NEXT:EXIT040D: unload_wav [email protected]: toggle_camera_green_scanlines 0jump @LOAD Link to comment Share on other sites More sharing options...
MW_29 Posted August 5, 2010 Share Posted August 5, 2010 (edited) Ok, I debuged it a bit, but I still can't make the sound PLAY! I used scanlines to test if script is working nice, looping etc... It is, but no sound... // This file was decompiled using vicescm.ini published by GtaForums.com on 27.7.07{$VERSION 2.2.0000}{$CLEO .cs}//-------------MAIN---------------0000: :LOADwait 250if Player.Defined($PLAYER_CHAR)jf @LOADif and00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRB00E1: key_pressed 0 17jf @LOAD03CF: load_wav 'MOB_52A' as [email protected] jump @NITRO:NITRO;wait 0if03D0: wav [email protected] loadedjf @LOAD04C7: toggle_camera_green_scanlines 1 if00E1: key_pressed 0 17jf @EXIT03D1: play_wav [email protected] @NEXT:NEXTwait 0if and83D2: not wav [email protected] ended 00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRBjf @EXITif00E1: key_pressed 0 17jf @NITROjump @NEXT:EXIT040D: unload_wav [email protected]: toggle_camera_green_scanlines 0jump @LOAD Man, I got it! ;DD This code works for me! xD // This file was decompiled using vicescm.ini published by GtaForums.com on 27.7.07{$VERSION 2.2.0000}{$CLEO .cs}//-------------MAIN---------------0000::LOADwait 250ifPlayer.Defined($PLAYER_CHAR)jf @LOADif and00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRB00E1: key_pressed 0 17jf @LOAD03CF: load_wav 'MOB_52A' as $nitro jump @NITRO:NITROwait 0if03D0: wav $nitro loadedjf @LOAD04C7: toggle_camera_green_scanlines 1if00E1: key_pressed 0 17jf @EXIT03D1: play_wav $nitrojump @NEXT:NEXTwait 0if and83D2: not wav $nitro ended00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRBjf @EXITif00E1: key_pressed 0 17jf @NITROjump @NEXT:EXIT040D: unload_wav $nitro04C7: toggle_camera_green_scanlines 0jump @LOAD I have just changed [email protected] to $1, it didn't work, then to $1177, and game shut down then, so i changed it to $nitro, i didn't expect that will do the job and suddenly ...it worked ;D Try yourself. Edited August 5, 2010 by MW_29 Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 5, 2010 Author Share Posted August 5, 2010 It worked loading the file once... And when I release the button and hold it again, nothing happens..... I've tried everything, even codded the script once again: :LOADwait 50if Player.Defined($PLAYER_CHAR)jf @LOADif00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRBjf @LOADjump @LOADIT:LOADIT03CF: load_wav 'MOB_52A' as $nitro jump @NITROS:NITROS wait 0if03D0: wav $nitro loadedjf @LOADIT if00E1: key_pressed 0 6jf @NITROS03D1: play_wav $nitro04C7: toggle_camera_green_scanlines 1jump @NEXT:NEXTwait 0if80E1: not key_pressed 0 6 jf @NEXT018E: stop_sound $nitro jump @EXIT_2:EXITif03D0: wav $nitro loadedjf @EXIT_2040D: unload_wav $nitro04C7: toggle_camera_green_scanlines 0jump @LOAD:EXIT_204C7: toggle_camera_green_scanlines 0jump @NITROS But not luck at all. Can someone help us? Link to comment Share on other sites More sharing options...
MW_29 Posted August 5, 2010 Share Posted August 5, 2010 It worked loading the file once... And when I release the button and hold it again, nothing happens..... I've tried everything, even codded the script once again: :LOADwait 50if Player.Defined($PLAYER_CHAR)jf @LOADif00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRBjf @LOADjump @LOADIT:LOADIT03CF: load_wav 'MOB_52A' as $nitro jump @NITROS:NITROS wait 0if03D0: wav $nitro loadedjf @LOADIT if00E1: key_pressed 0 6jf @NITROS03D1: play_wav $nitro04C7: toggle_camera_green_scanlines 1jump @NEXT:NEXTwait 0if80E1: not key_pressed 0 6 jf @NEXT018E: stop_sound $nitro jump @EXIT_2:EXITif03D0: wav $nitro loadedjf @EXIT_2040D: unload_wav $nitro04C7: toggle_camera_green_scanlines 0jump @LOAD:EXIT_204C7: toggle_camera_green_scanlines 0jump @NITROS But not luck at all. Can someone help us? Are you sure the sound is pleyed only once? On my Vice it is played eveytime i press the key, it stops when i release key, if i press and hold key the sound is played till the end of it, then after a little pause sequence is played again, and this is the code i am using right now: // This file was decompiled using vicescm.ini published by GtaForums.com on 27.7.07{$VERSION 2.2.0000}{$CLEO .cs}//-------------MAIN---------------0000::LOADwait 250ifPlayer.Defined($PLAYER_CHAR)jf @LOADif and00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRB00E1: key_pressed 0 17jf @LOAD03CF: load_wav 'MOB_52A' as $nitro jump @NITRO:NITROwait 0if03D0: wav $nitro loadedjf @LOAD04C7: toggle_camera_green_scanlines 1if00E1: key_pressed 0 17jf @EXIT03D1: play_wav $nitrojump @NEXT:NEXTwait 0if and83D2: not wav $nitro ended00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRBjf @EXITif00E1: key_pressed 0 17jf @NITROjump @NEXT:EXIT040D: unload_wav $nitro04C7: toggle_camera_green_scanlines 0jump @LOAD Are you testing it on this "MOB_52A" file or are you using your new custom sound file for this mod, if you are so maybe lenght of it is messing something, but i am not sure Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 5, 2010 Author Share Posted August 5, 2010 Then maybe my CLEO.asi is wrong... Send me yours. Link to comment Share on other sites More sharing options...
MW_29 Posted August 6, 2010 Share Posted August 6, 2010 Im waiting on progress in this mod, hope it will be finished soon, i can also offer my further help if necessary ;D Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 6, 2010 Author Share Posted August 6, 2010 (edited) -Ok, I've deleted some other CLEO mods, it seems they were the problem with this one. -Here is the code that works: :LOADwait 150ifPlayer.Defined($PLAYER_CHAR)jf @LOADif and00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRB00E1: key_pressed 0 17jf @LOAD03CF: load_wav 'BUD3_9B' as $nitrojump @NITRO:NITROwait 0if03D0: wav $nitro loadedjf @LOADif00E1: key_pressed 0 17jf @EXIT03D1: play_wav $nitrojump @NEXT:NEXTwait 0if and83D2: not wav $nitro ended00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRBjf @EXITif00E1: key_pressed 0 17jf @NITROjump @NEXT:EXIT040D: unload_wav $nitrojump @LOAD And the Nitrous sound - Download Link 1 - Download Link 2 The sound lasts for about ~10 seconds, so if anyone knows how to make a progress bar that controls the nitro spent while holding the key, I would be very happy And, yeah, it should refil itself slowly if you don't hold the NITRO key. Edited August 6, 2010 by kikiboy95 Link to comment Share on other sites More sharing options...
MW_29 Posted August 6, 2010 Share Posted August 6, 2010 (edited) kikiboy, it seems you forgot to pack sound file into .rar, so there is a problem with downloading it at the moment, ...waiting for a fix haha ;D Edit: Or at least i get something like: Download failed!You are already downloading a file! Just 1 download is possible at the same time for free user.Get your uploaded Premium-Account now!Your Premium-Account will be activated immediately after your order. ...although i am not downloading any other file, weird ;/ Edited August 6, 2010 by MW_29 Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 6, 2010 Author Share Posted August 6, 2010 kikiboy, it seems you forgot to pack sound file into .rar, so there is a problem with downloading it at the moment, ...waiting for a fix haha ;D It is wav file, and it downloads fine for me. But if you want the rar version... Here it is >link< Link to comment Share on other sites More sharing options...
artiq Posted August 6, 2010 Share Posted August 6, 2010 (edited) The sound lasts for about ~10 seconds, so if anyone knows how to make a progress bar that controls the nitro spent while holding the key, I would be very happy smile.gif And, yeah, it should refil itself slowly if you don't hold the NITRO key. @kikiboy95: Look at my Speed Breaker Mod. I think there can be similar bar for your mod Edited August 6, 2010 by artiq Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 7, 2010 Author Share Posted August 7, 2010 The sound lasts for about ~10 seconds, so if anyone knows how to make a progress bar that controls the nitro spent while holding the key, I would be very happy smile.gif And, yeah, it should refil itself slowly if you don't hold the NITRO key. @kikiboy95: Look at my Speed Breaker Mod. I think there can be similar bar for your mod MW_29 and I are working on it now. It's in pre-beta stage. Thanks for the link Achievments so far: Nitro Sound while holding the key Stoppping the sound once key is released Nitrous bar Self-filling mechanism -More to work on: Making the bottle fill itself slower, making the sound stop if bottle is all empty, making more cars have nitrous. Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 9, 2010 Author Share Posted August 9, 2010 Ok, time to show some work progress. MW_29 and I were able to make a bar that displays N2O oxide level, which is spent while holding the FIRE key (17). It autorefills itself after some time. NEON BAR // This file was decompiled using vicescm.ini published by GtaForums.com on 27.7.07{$VERSION 2.2.0000}{$CLEO .cs}//-------------MAIN---------------thread 'NOS' 0209: $N36 = random_int 25 100 $N37 = 0 // integer values $N38 = 0 // integer values 0084: $N38 = $N36 // integer values and handles $N38 *= 10 // integer values $N38 -= 10 // integer values 0084: $N37 = $N36 // integer values and handles $N37 *= 10 // integer values :NOS_70wait 0 if 00E0: player $PLAYER_CHAR driving jf @NOS_70 03C1: $NOSC = player $PLAYER_CHAR car :NOS_98wait 0 04F7: status_text $N36 1 line 3 'NOS' if 00E0: player $PLAYER_CHAR driving jf @NOS_257 :NOS_135wait 0 if 00E0: player $PLAYER_CHAR driving jf @NOS_257 if 00E1: key_pressed 0 17 jf @NOS_342 if $N36 > 0 // integer values jf @NOS_319 04AE: $NOS_EMPTY = 0 // integer values OR floating-point values wait 100 $N37 -= 3 // integer values $N38 -= 15 // integer values $N36 -= 3 // integer values jump @NOS_135 :NOS_229wait 0 0209: $N36 = random_int 25 100 03C1: $NOSC = player $PLAYER_CHAR car jump @NOS_98 :NOS_257wait 0 0151: remove_status_text $N36 jump @NOS_273 :NOS_273wait 0 if 00E0: player $PLAYER_CHAR driving jf @NOS_273 if 00DC: player $PLAYER_CHAR driving $NOSC jf @NOS_229 jump @NOS_98 :NOS_319wait 0 04AE: $NOS_EMPTY = 1 // integer values OR floating-point values wait 2000 jump @NOS_135 :NOS_342wait 100 if 00E0: player $PLAYER_CHAR driving jf @NOS_257 if 80E1: not key_pressed 0 17 jf @NOS_135 if not $N36 > 99 // integer values jf @NOS_135 $N36 += 1 // integer values jump @NOS_342 - And this is another script, used for loading audio effect while pressing that key: NEON SOUND // This file was decompiled using vicescm.ini published by GtaForums.com on 27.7.07{$VERSION 2.2.0000}{$CLEO .cs}//-------------MAIN---------------0000: :NONAME_2wait 150 if Player.Defined($PLAYER_CHAR)else_jump @NONAME_2 if and00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRB 00E1: key_pressed 0 17 else_jump @NONAME_2 03CF: load_wav 'BUD3_9B' as $NITRO jump @NONAME_68 :NONAME_68wait 0 if 03D0: wav $NITRO loaded else_jump @NONAME_2 if 00E1: key_pressed 0 17 else_jump @NONAME_169 03D1: play_wav $NITRO jump @NONAME_117 :NONAME_117wait 0 if and83D2: not wav $NITRO ended 00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRB else_jump @NONAME_169 if 00E1: key_pressed 0 17 else_jump @NONAME_68 jump @NONAME_117 :NONAME_169040D: unload_wav $NITRO jump @NONAME_2 But, when I tried to unite the 2 scripts, the bar is progressing nicely, but the sound just dosen't play. No crashes, but like the game doesen't load it or something... Can anyone help ? This is the progress made so far on uniting the scripts: // This file was decompiled using vicescm.ini published by GtaForums.com on 27.7.07{$VERSION 2.2.0000}{$CLEO .cs}//-------------MAIN---------------thread 'NOS' 0209: $N36 = random_int 25 100 $N37 = 0 // integer values $N38 = 0 // integer values 0084: $N38 = $N36 // integer values and handles $N38 *= 10 // integer values $N38 -= 10 // integer values 0084: $N37 = $N36 // integer values and handles $N37 *= 10 // integer values :NOS_70wait 0 if 00E0: player $PLAYER_CHAR driving else_jump @NOS_70 03C1: $NOSC = player $PLAYER_CHAR car :NOS_98wait 0 04F7: status_text $N36 1 line 3 'NOS' if 00E0: player $PLAYER_CHAR driving else_jump @NOS_257 :NOS_135wait 0 if 00E0: player $PLAYER_CHAR driving else_jump @NOS_257 if 00E1: key_pressed 0 17 else_jump @NOS_34203CF: load_wav 'BUD3_9B' as $nitro:NOS_136wait 0if03D0: wav $nitro loadedjf @NOS_135 if $N36 > 0 // integer values else_jump @NOS_31903D1: play_wav $nitrojump @NOS_2:NOS_2wait 0if00DE: player $PLAYER_CHAR driving_vehicle_type #BLOODRBjf @EXITif00E1: key_pressed 0 17jf @NOS_342if $N36 > 0 // integer values else_jump @NOS_319wait 100 $N37 -= 3 // integer values $N38 -= 15 // integer values $N36 -= 3 // integer values jump @NOS_2:NOS_229wait 0 0209: $N36 = random_int 25 100 03C1: $NOSC = player $PLAYER_CHAR car jump @NOS_98 :NOS_257wait 0040D: unload_wav $nitro 0151: remove_status_text $N36 jump @NOS_273 :EXIT040D: unload_wav $nitrojump @NOS_273:NOS_273wait 0 if 00E0: player $PLAYER_CHAR driving else_jump @NOS_273 if 00DC: player $PLAYER_CHAR driving $NOSC else_jump @NOS_229 jump @NOS_98 :NOS_319wait 0 040D: unload_wav $nitrowait 2000 jump @NOS_135 :NOS_342wait 100 if00E0: player $PLAYER_CHAR drivingjf @NOS_257if 80E1: not key_pressed 0 17 else_jump @NOS_135 if not $N36 > 99 // integer values else_jump @NOS_135 $N36 += 1 // integer values jump @NOS_342 Link to comment Share on other sites More sharing options...
riquenunes Posted August 9, 2010 Share Posted August 9, 2010 Didn't you mean Nitro instead of Neon? :S Why not just use both scripts apart? Link to comment Share on other sites More sharing options...
MAD BOSS Posted August 9, 2010 Author Share Posted August 9, 2010 Didn't you mean Nitro instead of Neon? :SWhy not just use both scripts apart? Because they don't work together. I dunno why. If I have only one of them in CLEO folder, they do work. Logic? Link to comment Share on other sites More sharing options...
MW_29 Posted August 9, 2010 Share Posted August 9, 2010 Didn't you mean Nitro instead of Neon? :SWhy not just use both scripts apart? Because they don't work together. I dunno why. If I have only one of them in CLEO folder, they do work. Logic? NEON? WTF? I thought it's all about NITRO sound ;D ...nevermind, right now 2 .CS files, 1st with n20 bar and 2nd with sound playing script ...however on mine VC, sound is played only when n2o bar goes to zero and then i press 17 key , and then sound file is played ...not exactly what we are aiming for ...so status of this modification i would say is very W.I.P. ...however i am proud of advancements which we made from start ;D 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