Jump to content
VHCal

How to fix siren bug?

Recommended Posts

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.

Link to comment
Share on other sites

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";

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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 by VHCal
Link to comment
Share on other sites

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

  • Upvote 1
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.



×
×
  • Create New...