Blur Gaming Custom Spawn Tutorial

Discussion in 'Tutorials' started by blur, Apr 26, 2013.

  1. blur

    blur Valued Member!

    Joined:
    Nov 5, 2012
    Messages:
    253
    Likes Received:
    73


    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
     
    Saints Mantis, D4ng3r, MaTrix and 4 others like this.
  2. Komplex

    Komplex Member

    Joined:
    Feb 21, 2013
    Messages:
    53
    Likes Received:
    3
    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/
     
    blur likes this.
  3. Hoplit

    Hoplit Well-Known Member

    Joined:
    Feb 21, 2013
    Messages:
    109
    Likes Received:
    4
    Thanks, going to try it tomorrow, your video is freakin epic!!!!!!!
     
  4. HalvorS

    HalvorS New Member

    Joined:
    Feb 28, 2013
    Messages:
    29
    Likes Received:
    0
    This works! Pretty badass
     
  5. Tiger

    Tiger Well-Known Member

    Joined:
    Mar 7, 2013
    Messages:
    108
    Likes Received:
    24
    Oh man I will feel like such a badman entering chernarus like this!

    Great work man!
     
  6. Hoplit

    Hoplit Well-Known Member

    Joined:
    Feb 21, 2013
    Messages:
    109
    Likes Received:
    4
    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?
     
  7. Komplex

    Komplex Member

    Joined:
    Feb 21, 2013
    Messages:
    53
    Likes Received:
    3
    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.
     
  8. Saethkept

    Saethkept Well-Known Member

    Joined:
    Mar 17, 2013
    Messages:
    107
    Likes Received:
    15
    Very interesting. Quite powerful with the music from 28 Days Later as well.
     
  9. Drmsy

    Drmsy New Member

    Joined:
    Apr 24, 2013
    Messages:
    1
    Likes Received:
    0
    Okay is it supposed to play every time you join in or just spawn? since it plays every time I log in and out
     
  10. blur

    blur Valued Member!

    Joined:
    Nov 5, 2012
    Messages:
    253
    Likes Received:
    73
    every time you spawn
     
  11. RichyM92

    RichyM92 Well-Known Member

    Joined:
    Feb 19, 2013
    Messages:
    116
    Likes Received:
    8
    I keep getting kicked for script restriction #126 any ideas?
     
  12. RichyM92

    RichyM92 Well-Known Member

    Joined:
    Feb 19, 2013
    Messages:
    116
    Likes Received:
    8
    fixed. Added a filter to line 126. Thanks for sharing
     
  13. Slim

    Slim New Member

    Joined:
    Feb 10, 2013
    Messages:
    17
    Likes Received:
    0
    Can you share your track? )) It's cool
     
  14. blur

    blur Valued Member!

    Joined:
    Nov 5, 2012
    Messages:
    253
    Likes Received:
    73
    uhmmmm no.
     
    Andrew_S90 and Slim like this.
  15. Slim

    Slim New Member

    Joined:
    Feb 10, 2013
    Messages:
    17
    Likes Received:
    0
    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;
     
  16. Hoplit

    Hoplit Well-Known Member

    Joined:
    Feb 21, 2013
    Messages:
    109
    Likes Received:
    4
    My song is 469kb and overall the mission file is 1885kb. This could be the problem?
     
  17. blur

    blur Valued Member!

    Joined:
    Nov 5, 2012
    Messages:
    253
    Likes Received:
    73
    it works completely fine with out your additon
     
  18. blur

    blur Valued Member!

    Joined:
    Nov 5, 2012
    Messages:
    253
    Likes Received:
    73
    is your song in .ogg format?
     
  19. Hoplit

    Hoplit Well-Known Member

    Joined:
    Feb 21, 2013
    Messages:
    109
    Likes Received:
    4
    Yes. Would you like me to upload the mission file?
     
  20. blur

    blur Valued Member!

    Joined:
    Nov 5, 2012
    Messages:
    253
    Likes Received:
    73
    i'd rather you not. can you pm it to me?
     

Share This Page