Jump to content

Emergency 4 - Script: Siren


[b]Emergency 4 - Script: Siren[/b]
Difficulty: Easy
Programs used:
Emergency 4 Editor (v1.3)
NotePad

==========================

WHAT ARE THE SIREN SCRIPTS:

The original Siren scripts are named SoSi and were made by Bass-Ti.
SoSi means Sondersignal in German. In English it means Siren.

In this tutorial we call the scripts 'Siren scripts'.
The scripts and commands make it possible to do a few new things:
- Possible to have a different siren for each vehicle.
- Sirens are looped: Siren won't stop after a few seconds, but will be repeated until the vehicle stops moving or when you disable the siren.

The scripts contain 3 new commands:
- VCmdSirens Turns the sirens on or off
- VCmdAutoSirenOn -Off Sirens will activate or deactivate automaticly when vehicle starts moving or stops moving. You can turn this off or on.

[url="http://www.emergency-planet.com/tutorials/sirens_01.jpg"]Image 01: Siren commands[/url]

==========================

HOW DOES IT WORK?:

Download this .zip package: [url="http://www..emergency-planet.com/tutorials/siren_scripts.zip"]Siren scripts[/url]
Extract the .zip package and move the 8 scripts to the following folder in your mod: "YourMod/Scripts/Game/Command/..."
Create new folders if necessary. Move the Icons folder from the package to your mod folder.

Start the editor, load your mod. Add the following two commands to all vehicles which must have the new siren commands
- VCmdSiren and VCmdAutoSirenOff.

VCmdAutoSirenOff means the vehicle HAS the ability to turn the automatic sirens off. This means automatic sirens are on for default when the vehicle has this command.

[url="http://www.emergency-planet.com/tutorials/sirens_02.jpg"]Image 02: Add commands to your vehicles[/url]

==========================

AUDIO FILES:
If you want to have custom, new sirens in your mod you need to find or make them.
Audio files in Emergency 3 and 4 will only work if they are mono and in .wav format.
Otherwise they won't be played.

If you want to use new sirens it can be a good idea to replace the original Emergency 4 sirens with empty audio files.
You can download empty sirens here: [url="http://www.emergency-planet.com/tutorials/empty_sirens.zip"]Empty sirens[/url]
Move the 4 audio files to the following folder in your mod: ".../Audio/Fx/sirens/"
In case you have new sirens, move them to the same folder.

==========================

CHANGING THE SCRIPTS:

Go to your ".../Scripts/Game/Command" folder in your mod and open Sirens.script with WordPad or Notepad.
You have to do two things for each vehicle you want to give sirens.

1. Find a line like this:

[CODE][i]const char CAR_01[] = "mod:Prototypes/Vehicles/Fire Department/rw.e4p";[/i][/CODE]

This line has a const char value which has been connected to the path of a vehicle prototype.
Make sure these prototypes have the commands VCmdSiren and VCmdAutoSirenOff as explained earlier.

2. The const char value (CAR_01) is linked to another part of the script.
Scroll down and find a part like this:

[left][CODE][b][i]if (StrCompare(v.GetPrototypeFileName(), CAR_01) == 0)[/i]
[i]soundID = Audio::PlaySample3D("mod:Audio/FX/sirens/Emsiren01.wav", CarPos, true);[/i][/b][/CODE][/left]

As you can see the const char value can be found in this part of the script too.
The second line contains the path to a sound file, the siren.

Meaning of this code:

If the caller (car which executes command) has the prototype connected to the const char value it will play the audio file from the second line.

If you want to do this with more vehicle, simply copy the codes in part 1 and 2 and change them.
Make sure each vehicle has another const char code, like CAR_02, CAR_03 etc...

[url="http://www.emergency-planet.com/tutorials/sirens_03.jpg"]Image 03: Edit the script[/url]

Thanks to Bass-Ti for the original scripts.

For questions about this tutorial:
[url="http://forum.emergency-planet.com/index.php?showtopic=3440"]Emergency 4: Siren scripts[/url]

==========================
Tutorial made by Hoppah
March 2008

User Feedback



Recommended Comments

How can i delay the starting point of siren? I means, fire engine moves for a few second later then the siren is on?

Link to comment
Share on other sites


Guest
Add a Comment

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