VHCal Posted May 16, 2016 Report Share Posted May 16, 2016 I believe I have set up my sirens correctly but I am having problems with the KFRS vehicles. LASiren.script Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 16, 2016 Report Share Posted May 16, 2016 What exactly is wrong with this? I dont have any idea what is wrong unless you tell me in particular what happens. Does it crash upon selecting a vehicle? Error when playing command? Or nothing happens when pressing the command? Quote Link to comment Share on other sites More sharing options...
VHCal Posted May 16, 2016 Author Report Share Posted May 16, 2016 1 minute ago, itchboy said: What exactly is wrong with this? I dont have any idea what is wrong unless you tell me in particular what happens. Does it crash upon selecting a vehicle? Error when playing command? Or nothing happens when pressing the command? Sorry, I didn't explain it very well. Upon pressing the siren button nothing happens for certain vehicles. No crash happens. Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 16, 2016 Report Share Posted May 16, 2016 Which ones to be specific? Can I have their prototype names? Quote Link to comment Share on other sites More sharing options...
VHCal Posted May 16, 2016 Author Report Share Posted May 16, 2016 Just now, itchboy said: Which ones to be specific? Can I have their prototype names? Sure, they are: const char CAR_50[] = "mod:Prototypes/Vehicles/Kent FRS/Nissan.e4p"; const char CAR_51[] = "mod:Prototypes/Vehicles/Kent FRS/Officer_car.e4p"; const char CAR_52[] = "mod:Prototypes/Vehicles/Kent FRS/Sprinter.e4p"; const char CAR_53[] = "mod:Prototypes/Vehicles/Kent FRS/Incident.e4p"; Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 16, 2016 Report Share Posted May 16, 2016 Try using else if conditions instead of making them all as 'if' conditions. My first theory is that you have far too many 'if' conditions and the game stops reading that set because you have too many. Try grouping them by 10 at most. Another question is, do you have the correct prototypes up in the top? Some people come here complaining about issues but then it ends up being a spelling error with the prototype name. Quote Link to comment Share on other sites More sharing options...
VHCal Posted May 16, 2016 Author Report Share Posted May 16, 2016 3 minutes ago, itchboy said: Try using else if conditions instead of making them all as 'if' conditions. My first theory is that you have far too many 'if' conditions and the game stops reading that set because you have too many. Try grouping them by 10 at most. Another question is, do you have the correct prototypes up in the top? Some people come here complaining about issues but then it ends up being a spelling error with the prototype name. Okay seems a bit wired to just stop working, will give it a try. I have checked the prototypes and spelling seems to be fine. Just strange that it's only fire vehicles that aren't working. Thanks for the reply. Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 16, 2016 Report Share Posted May 16, 2016 Do the vehicles from 54-61 work? Quote Link to comment Share on other sites More sharing options...
VHCal Posted May 16, 2016 Author Report Share Posted May 16, 2016 Just now, itchboy said: Do the vehicles from 54-61 work? Yes Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 16, 2016 Report Share Posted May 16, 2016 http://pastebin.com/VG1urwxP Some code I tried. Replaces your entire siren script. Link expires in 60 minutes. Quote Link to comment Share on other sites More sharing options...
VHCal Posted May 16, 2016 Author Report Share Posted May 16, 2016 (edited) 8 minutes ago, itchboy said: http://pastebin.com/VG1urwxP Some code I tried. Replaces your entire siren script. Link expires in 60 minutes. That crashed the script therefore it wouldn't work Edited May 16, 2016 by VHCal Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 16, 2016 Report Share Posted May 16, 2016 At what line did it crash. Keep pressing 'retry' and let me know what line it goes. Quote Link to comment Share on other sites More sharing options...
VHCal Posted May 16, 2016 Author Report Share Posted May 16, 2016 4 minutes ago, itchboy said: At what line did it crash. Keep pressing 'retry' and let me know what line it goes. It's line 352 then goes on about adding -p Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 16, 2016 Report Share Posted May 16, 2016 Thing is, there is no line 352, which means this is a bracket bug on my part. Does it crash when using the command or only highlighting over the vehicle? Might be line 163 actually if (StrCompare(v.GetPrototypeFileName(), CAR_31) == 0 || StrCompare(v.GetPrototypeFileName(), CAR_32) == 0 || The || at the end of car 32 is missing. if (StrCompare(v.GetPrototypeFileName(), CAR_17) == 0 || StrCompare(v.GetPrototypeFileName(), CAR_20) == 0 || Same issue with line 144. Car 20 is missing the || I'm not particularly good at scripting, but I at least tried to tidy up your code. Quote Link to comment Share on other sites More sharing options...
VHCal Posted May 16, 2016 Author Report Share Posted May 16, 2016 47 minutes ago, itchboy said: Thing is, there is no line 352, which means this is a bracket bug on my part. Does it crash when using the command or only highlighting over the vehicle? It crashes upon start-up and the siren icon isn't there. Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 17, 2016 Report Share Posted May 17, 2016 Starting the game? Try the above things I listed. Quote Link to comment Share on other sites More sharing options...
VHCal Posted May 17, 2016 Author Report Share Posted May 17, 2016 11 hours ago, itchboy said: Starting the game? Try the above things I listed. Ah okay I will take a look into it, thanks. Quote Link to comment Share on other sites More sharing options...
Chris07 Posted May 17, 2016 Report Share Posted May 17, 2016 EOF refers to end of file. The script is reaching the end of file before it wants to. That means you're probably missing a bracket 1 Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 18, 2016 Report Share Posted May 18, 2016 3 hours ago, Chris07 said: EOF refers to end of file. The script is reaching the end of file before it wants to. That means you're probably missing a bracket I am missing more than just a bracket, it would seem I am missing 2 different || 'or' lines. Quote Link to comment Share on other sites More sharing options...
amuchalipsis Posted May 18, 2016 Report Share Posted May 18, 2016 Try this one. Just add one of these commands to the cars to make the siren sound: DummySirenWhelenAlpha DummySirenWhelenAlpha2 DummySirenWhelenGamma DummySirenWhelen295 DummySirenPH7009 DummySirenWoodwayCommander3 DummySirenPremiumHazard LASiren.script Quote Link to comment Share on other sites More sharing options...
itchboy Posted May 18, 2016 Report Share Posted May 18, 2016 2 hours ago, amuchalipsis said: Try this one. Just add one of these commands to the cars to make the siren sound: DummySirenWhelenAlpha DummySirenWhelenAlpha2 DummySirenWhelenGamma DummySirenWhelen295 DummySirenPH7009 DummySirenWoodwayCommander3 DummySirenPremiumHazard http://www.emergency-planet.com/applications/core/interface/file/attachment.php?id=17851 While this method also works, it is quite messy becuase it involves adding more commands, and means a lot of editor work for the end user. Another drawback is that the mod will take much longer to load if you add numerous dummy commands. Each solution has its plus and minuses, but its up to OP to decide. Quote Link to comment Share on other sites More sharing options...
VHCal Posted May 18, 2016 Author Report Share Posted May 18, 2016 (edited) 6 hours ago, itchboy said: While this method also works, it is quite messy becuase it involves adding more commands, and means a lot of editor work for the end user. Another drawback is that the mod will take much longer to load if you add numerous dummy commands. Each solution has its plus and minuses, but its up to OP to decide. I would prefer to script the vehicles into the mod as it would be neater ---------UPDATE----------- I fixed it by adding if (StrCompare(v.GetPrototypeFileName(), CAR_98) == 0) soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/PH7009.wav", CarPos, true); and that seemed to work. Thanks for everyone's input! Edited May 18, 2016 by VHCal Quote Link to comment Share on other sites More sharing options...
amuchalipsis Posted May 25, 2016 Report Share Posted May 25, 2016 On 18/5/2016 at 5:20 PM, itchboy said: While this method also works, it is quite messy becuase it involves adding more commands, and means a lot of editor work for the end user. Another drawback is that the mod will take much longer to load if you add numerous dummy commands. Each solution has its plus and minuses, but its up to OP to decide. Thanks for the info. I didn't know that, I guess one never ends a day without learning something new 1 Quote Link to comment Share on other sites More sharing options...