Jump to content

[HOW TO] Adding Intro Music!


Indiculous

Recommended Posts

NOTICE: I do not take credit for these scripts im simply just sharing them with a tutorial!

 

Programs i use http://audacity.sourceforge.net/download/

 

Find a song you wish to use and drag and drop it into audacity.

 

Crop the song to around 30 seconds and then "File\export" export it as OGG

 

Name the OGG File introsong and put it in the root of your mission file (in the same place as your init.sqf)

 

 

Now on to the script!

 

1)Open your init.sqf

 

Around Line 88 look for 

//Run the player monitor

 

Just under that place this 

 _id = player addEventHandler ["Respawn", {_id = [] spawn player_death; _nul = [] execVM "playerspawn.sqf";}];

2)Make a sqf called playerspawn.sqf in the same place as your init.sqf

 

and inside that paste this into it

 

waitUntil { alive player };
//BlurGaming Intro Script
sleep 4;
playsound "introSong";
cutText ["servername here", "PLAIN DOWN"];
 
3)in your description.ext around line 43-55 you will see this 

class RscPicture
{
access=0;
type=0;
idc=-1;
style=48;
colorBackground[]={0,0,0,0};
colorText[]={1,1,1,1};
font="TahomaB";
sizeEx=0;
lineSpacing=0;
text="";
};
 
Under that paste this 
 
class CfgSounds
{
    sounds[] =
    {
    introSong
    };
    class introSong
    {
    name="introSong";
    sound[]={introSong.ogg,0.9,1};
    titles[] = {};
    };
};
 
 
Thats it your done!
Link to comment
Share on other sites

  • 3 weeks later...

not worked.

 

Now on to the script!

 

1)Open your init.sqf

 

Around Line 88 look for 

//Run the player monitor

 

Just under that place this 

 _id = player addEventHandler ["Respawn", {_id = [] spawn player_death; _nul = [] execVM "playerspawn.sqf";}];

 

without add ... just
 

replace this

_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];

 

with this 

 _id = player addEventHandler ["Respawn", {_id = [] spawn player_death; _nul = [] execVM "playerspawn.sqf";}];

 

 

 

and you forgot about :

_nul = [] execVM "playerspawn.sqf";

Link to comment
Share on other sites

  • 5 weeks later...

Sorry for bumping an older topic, but how can I activate the intro music once a 'not dead' player joins the game?

For this you only have to put

[] execVM "playerspawn.sqf";

in your init.sqf at the bottom and the //Playermonitor Line you setup back as it was:

_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];
Link to comment
Share on other sites

 

For this you only have to put

[] execVM "playerspawn.sqf";

in your init.sqf at the bottom and the //Playermonitor Line you setup back as it was:

_id = player addEventHandler ["Respawn", {_id = [] spawn player_death;}];

 

Aight, thanks!

Link to comment
Share on other sites

  • 5 months later...
  • 2 weeks later...

All working great however the song and credits play every time someone logs in not just after a player dies and respawns

 

Anyway to change this ?

 

Same here, i wish for it to only play when player dies and Re-spawns or Fresh Spawn

 

also is there by chance a way to put the .ogg server side so people dont have to download a bigger mission, already changed 1mb to 200kb .ogg but thought i ask

Link to comment
Share on other sites

In your init.sqf

 

Delete :

_nul = [] execVM "playerspawn.sqf";

at the bottom add this

waitUntil {!isNil "PVDZE_plr_LoginRecord"};
if (!isDedicated && (dayzPlayerLogin2 select 2)) then {
    if (dayzPlayerLogin2 select 2) then {execVM "playerspawn.sqf";};
};

This will make sure that the song only plays if he is a fresh spawn

Link to comment
Share on other sites

  • 4 months later...
 

 

class CfgSounds
{
sounds[] =
{
        carLock;
        introSong
};
class carLock
{
        name="carLock";
        sound[]={sounds\carlock.ogg,0.9,1};
        titles[] = {};
};
    class introSong
    {
name="introSong";
sound[]={introSong.ogg,0.9,1};
titles[] = {};
};
}; 

 

please repair

 

I have the same error with this information:

http://screenshooter.net/101974150/mwteghw

The code above doesn't work. Somebody help ? :P

 

If you need... There is my description.ext

http://pastebin.com/qyhgcVdt

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...