Jump to content
VHCal

How to fix siren bug?

Recommended Posts

  On 5/16/2016 at 1:53 PM, 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?

Expand  

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

  On 5/16/2016 at 1:55 PM, itchboy said:

Which ones to be specific? Can I have their prototype names?

Expand  

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

  On 5/16/2016 at 2:05 PM, 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.

Expand  

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

  On 5/16/2016 at 2:18 PM, itchboy said:

http://pastebin.com/VG1urwxP

Some code I tried. Replaces your entire siren script. Link expires in 60 minutes.

Expand  

That crashed the script therefore it wouldn't work

ScreenShot_20160516152727.png

Edited by VHCal
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

  On 5/16/2016 at 2:38 PM, 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?

Expand  

It crashes upon start-up and the siren icon isn't there.

Link to comment
Share on other sites

  On 5/18/2016 at 12:43 PM, 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

Expand  

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

  On 5/18/2016 at 3: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.

Expand  

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 5/18/2016 at 3: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.

Expand  

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...