Blur Gaming Custom Spawn Tutorial

blur

Valued Member!

This is going to be a tut on how to add in Music on spawn, and custom server messages like you see at the bottom of the screen in the video above.... This will not include the halo spawn, and will not answer any questions about it as a tut has already been written for that.

First, Make a .sqf file named playerspawn.sqf it should contain this base code.

Code:
waitUntil { alive player };
//BlurGaming Intro Script
sleep 4;
playsound "introSong";
cutText ["You are playing on *ServerName*", "PLAIN DOWN"];
sleep 4;
cutText ["Second Editable Text", "PLAIN DOWN"];
sleep 4;
cutText ["Third Editable Text", "PLAIN DOWN"];

With this code, you may Edit the time it takes for the song to start playing, you can edit when the 1st, 2nd & 3rd Text apears and also add more if you want.

When choosing a sound file for your server you must convert it to a .ogg format. for me my introSong is called introSong.ogg you can get this format by editing with sound editing programs like audacity. Personally i use SonyVegas because it is easy.

After making the intro song place it in your mission pbo in the root folder.

Now open your Description.ext file and find this

Code:
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="";
};

Directly after the }; add this

Code:
class CfgSounds
{
    sounds[] =
    {
    introSong
    };
    class introSong
    {
    name="introSong";
    sound[]={introSong.ogg,0.9,1};
    titles[] = {};
    };
};

After you have done that, open your init.sqf.

Find

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

and replace it with

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

Then, Under _playerMonitor = .....

Add this

Code:
    _nul = [] execVM "playerspawn.sqf";

and you are done, Thanks for Trying it out!

-BlurGaming.com
 
Thanks for finally posting this. Sorry I bullied you into it by posting my own code when you didn't share. Here are some great online tools for creating the audio. No downloading programs or installing needed.

Great online mp3 cutting tool:
http://cut-mp3.com/

Convert you mp3 to .ogg online:
http://media.io/
 
Does it matter how big the music must be? I can't get this working, stucks at loading. The loading bar if fulled, and stucks at 0 seconds. Any suggestions?
 
Does it matter how big the music must be? I can't get this working, stucks at loading. The loading bar if fulled, and stucks at 0 seconds. Any suggestions?

How long and large is your file? IMO anything over 30 seconds and 300kb stops being neat, and starts being an inconvenience for your players.
 
Okay is it supposed to play every time you join in or just spawn? since it plays every time I log in and out
 
But thx for your work :)
If any use halo jump only spawn after dead
if (dayzPlayerLogin2 select 2 && dayzPlayerLogin select 4) then
paste this code
Code:
_nul = [] execVM "playerspawn.sqf";
not Under _player_monitor... paste under
Code:
  [player, 1000] spawn bis_fnc_halo;
 
How long and large is your file? IMO anything over 30 seconds and 300kb stops being neat, and starts being an inconvenience for your players.

My song is 469kb and overall the mission file is 1885kb. This could be the problem?
 
But thx for your work :)
If any use halo jump only spawn after dead

paste this code
Code:
_nul = [] execVM "playerspawn.sqf";
not Under _player_monitor... paste under
Code:
  [player, 1000] spawn bis_fnc_halo;
it works completely fine with out your additon
 
Back
Top