EM4life Posted August 13, 2010 Report Share Posted August 13, 2010 I was trying to add a siren for a car I DL'd, the LAPD car converted from EM3 into EM4 to be more specific. I added the two parts into the LASiren script and used the correct names and everything. But when I turn on the siren it gives me an eror message. It says that the last part, the part that has the vehicles names listed in each section for the siren that that car's been asigned, is too long. idk why but I've attached it to the post so you can look over it. The car i'm trying to get to work is called "cv_umpc_burgundy" for your referance. I believe I've done everything right but, obvously not... If anyone finds the problem(s), let me know. Thanks for you time.This was the process of finding this problem...in emoticons!... to... then... and finally... Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 14, 2010 Report Share Posted August 14, 2010 The scripts not here. But dont need it. The problem is sort of self explanatory in a way, all be it vague to. The section of the script that says PROTO_LAPD,PROTO_LASD,PROTOT_CHP,etc is to long. I dont know exactly what the limit is, and not sure if its C++ related or related to the games engine(im going to guess its the engine). I had the same problem on my end. Basically you have to many units using the same siren. To fix this split it up. Say you have 12 units using sirens 1 and 2. Split that up so you have 2 sets of code of 6 units using those sirens rather then 12. If your lost I will explain it better tomorrow. Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 16, 2010 Author Report Share Posted August 16, 2010 Ya, I get it but I want to actually know how to do it. Whenever I wan't to make my LA Mod better, I always screw it up. But it always get's fixed in the end. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 16, 2010 Report Share Posted August 16, 2010 Ya, I get it but I want to actually know how to do it. Whenever I wan't to make my LA Mod better, I always screw it up. But it always get's fixed in the end.Try doing it your self, post the script if it causes an error, and I will take a look at it. If memory serves me right theres a tutorial about it. The tutorial itself refers to the sosi.script i think, but just ignore the script name and follow the example set by the tutorial as its the same principal. Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 16, 2010 Author Report Share Posted August 16, 2010 I just realized I never attached it... here it is... LA Siren Script.rar Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 16, 2010 Report Share Posted August 16, 2010 Well, I guess I'd mean the NY Mod you've got. Anyways, like in my prevoius post, all of the textures are in the wrong spots. They're not the conventional texture scheme. So it messes up the texture. Am I missing anything to make this show correctly?At a glance it looks right. You said something about it being to long? Then split it up:else if (StrCompare(v.GetPrototypeFileName(), PROTO_MOTORCYCLE) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD2) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD3) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD_ST) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD_K9) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAAP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_UMPC_GREEN) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_UMPC_BURGUNDY) == 0 { int random = Math::rand()%2; if (random == 0) { soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren05.wav", CarPos, true); } else { soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren06.wav", CarPos, true); } }else if (StrCompare(v.GetPrototypeFileName(), PROTO_CV_UMPC) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_CHP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_CHP2) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LASD) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CHARGER_LAPD) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CHARGER_CHP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CAMARO_CHP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_BPAT_DODGE_CHARGER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_BPAT_TAHOE) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_ATF_CV) == 0) { int random = Math::rand()%2; if (random == 0) { soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren05.wav", CarPos, true); } else { soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren06.wav", CarPos, true); } } Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 17, 2010 Author Report Share Posted August 17, 2010 Ok, in trying it out, it gave me some sort of eror message. Will investigate it soon... Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 17, 2010 Report Share Posted August 17, 2010 If you hit ignore, it will pop up a second box telling you what line the error is on. Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 19, 2010 Author Report Share Posted August 19, 2010 It says line 268, and has something to do with parenthesis...The only thing in line 268 is two presses of the tab button and a "}"BTW: lol, in the eror it says "this_is_an_evil_workaround" XD Quote Link to comment Share on other sites More sharing options...
Guest Francis Posted August 19, 2010 Report Share Posted August 19, 2010 Replace StrCompare(v.GetPrototypeFileName(), PROTO_CV_UMPC_BURGUNDY) == 0with StrCompare(v.GetPrototypeFileName(), PROTO_CV_UMPC_BURGUNDY) == 0)Also, there is no limit to conditions in C++. Use this code: else if (StrCompare(v.GetPrototypeFileName(), PROTO_MOTORCYCLE) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD2) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD3) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD_ST) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPD_K9) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAAP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LAPP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_UMPC_GREEN) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_UMPC_BURGUNDY) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_UMPC) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_CHP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_CHP2) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CV_LASD) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CHARGER_LAPD) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CHARGER_CHP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_CAMARO_CHP) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_BPAT_DODGE_CHARGER) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_BPAT_TAHOE) == 0 || StrCompare(v.GetPrototypeFileName(), PROTO_ATF_CV) == 0) { int random = Math::rand()%2; if (random == 0) { soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren05.wav", CarPos, true); } else { soundID = Audio::PlaySample3D("mod:Audio/FX/Sirens/Siren06.wav", CarPos, true); } } Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 19, 2010 Author Report Share Posted August 19, 2010 What was changed in the code ur showing me? It looks the same... Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 19, 2010 Report Share Posted August 19, 2010 Also, there is no limit to conditions in C++. Use this code:I didnt think so, but i think there is in EM4. I had an error like his and as soon as i broke it down into 2 conditions, it worked fine. Plus you posted the same thing that he had in his original script that generated the error(from the looks of it). EM4, pastebin the entire new script using the code I gave you.http://pastebin.com/Sorry to lazy to put a new script together. Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 20, 2010 Author Report Share Posted August 20, 2010 I don't get it... What do you want me to do? And I'm still not sure what needs to be fixed... Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 20, 2010 Report Share Posted August 20, 2010 Paste the contents of the script into that site and post the URL. Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 20, 2010 Author Report Share Posted August 20, 2010 ok... Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 20, 2010 Report Share Posted August 20, 2010 ok...So...wheres the link if your still needing help with this? Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 21, 2010 Author Report Share Posted August 21, 2010 here it is Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 21, 2010 Report Share Posted August 21, 2010 Sigh...why are you posting the original script? You said you had an error on line 268, so I tried to look to see what the problem is but thats hard to do if I dont have the proper script to look at. Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 21, 2010 Author Report Share Posted August 21, 2010 You want the non-Francis version? Well, I'll have to edit it again...LA Siren.rar Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 21, 2010 Report Share Posted August 21, 2010 Line 207:StrCompare(v.GetPrototypeFileName(), PROTO_CV_UMPC_BURGUNDY) == 0 ||Delete the ||, the last line of PROTOs for each siren should not have a ||Other then that, everything looks fine at a glance. Try that and report back. Quote Link to comment Share on other sites More sharing options...
Guest Francis Posted August 21, 2010 Report Share Posted August 21, 2010 Look at my code carefully, the only reason his failed is because he forgot to close the "else if" statement with a brace.AKA:StrCompare(v.GetPrototypeFileName(), PROTO_ATF_CV) == 0instead of StrCompare(v.GetPrototypeFileName(), PROTO_ATF_CV) == 0) Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 21, 2010 Report Share Posted August 21, 2010 lol ahh nice catch. Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 21, 2010 Author Report Share Posted August 21, 2010 So, which one? Francis or Xplorer?I edited the script but see "btw" below.BTW: I'm using the NY Submod so my original LA Mod is in another folder as a backup for later. Quote Link to comment Share on other sites More sharing options...
Xplorer4x4 Posted August 21, 2010 Report Share Posted August 21, 2010 Look at my code carefully, the only reason his failed is because he forgot to close the "else if" statement with a brace.AKA:StrCompare(v.GetPrototypeFileName(), PROTO_ATF_CV) == 0instead of StrCompare(v.GetPrototypeFileName(), PROTO_ATF_CV) == 0)Actually, I just checked all three scripts he posted and havent seen a missing bracket on any of them in regards to the ATF_CV or was that just an example?So, which one? Francis or Xplorer?I edited the script but see "btw" below.BTW: I'm using the NY Submod so my original LA Mod is in another folder as a backup for later.Id use mine because I cant see what Francis is talking about unless it was just an example, but I wouldnt use these scripts for the NY Submod unless you have edited the NY submod to include all these units. Quote Link to comment Share on other sites More sharing options...
EM4life Posted August 21, 2010 Author Report Share Posted August 21, 2010 I tried to edit my LA Mod to use the NY Submod but it failed. I ended up backing up my original, deleting the mod, reinstalling the mod and patch, then putting in the NY Submod.P.S. The lights in that mod suck. I edited them heavily, as I always do to my mods, and it looks ok. Quote Link to comment Share on other sites More sharing options...