SnipeZz_Qc
Member
Hello people want to know how we can add custom music and listen it with a radio, etc.
Ex:
Ex2:
http://oi49.tinypic.com/2ntbbk0.jpg
Required:
- Visual studio 2008 or something for edit config.cpp / ******.hpp
- CfgConvert : http://www.mediafire.com/?2bg2jib6o62u0pe
- PBO Manager : http://www.armaholic.com/page.php?id=16369&a=dl
- NotePad++
- Mp3 to ogg converter : http://media.io/
- unRap : http://www.mediafire.com/?tpql314rczak61r
- A Brain
1 - Modif the Radio:
In dayz_equip.pbo derypt "config.bin" with unRap.exe (drag it onto it)
1.1 - Edit Config.bin
Open config.cpp with visual studio and go at line : 684 and paste
1.2 - Save it and repack it with CfgConvert and this command :
cfgConvert [-bin | -txt] {[-dst <destination>] <source>}
Ex: cfgConvert.exe -bin -dst C:\Users\MyName\Desktop\config.bin
C:\Users\MyName\Desktop\config.cpp
Note: You cannot use a folder with a space in the command.
1.3 - Delete the old config.bin and insert your new one
2 - Convert Your Music
Download wich music you want and convert it with http://media.io/
Format : OGG
Quality : Normal
2.1 - Add Your Music
In dayz_sfx.pbo ; tracks
Add your music (.ogg) there
Than Decrypt the config.bin of the dayz_sfx.pbo with unRap
Insert at line : 718
After that save it and repack it with CfgConvert Than delete the old config.bin and insert the new one.
3 - Make The Script
In dayz_code.pbo ; action add this script and name it radio.sqf :
Than save it.
3.1 - Modif Scripts
In dayz_code ; compile ; player_music.sqf add "!dayz_name_of_your-song" or copy that
Than in dayz_code; init ; compiles.sqf add that at line 86
There you go, you finish and you can listen at your music with a object, radio.
Sorry for my bad english.
A little like is appreciate.
SniPeZz Qc
Ex:
http://oi49.tinypic.com/2ntbbk0.jpg
Required:
- Visual studio 2008 or something for edit config.cpp / ******.hpp
- CfgConvert : http://www.mediafire.com/?2bg2jib6o62u0pe
- PBO Manager : http://www.armaholic.com/page.php?id=16369&a=dl
- NotePad++
- Mp3 to ogg converter : http://media.io/
- unRap : http://www.mediafire.com/?tpql314rczak61r
- A Brain
1 - Modif the Radio:
In dayz_equip.pbo derypt "config.bin" with unRap.exe (drag it onto it)
1.1 - Edit Config.bin
Open config.cpp with visual studio and go at line : 684 and paste
Code:
class ItemRadio : ItemCore {
scope = 2;
displayName = "Radio";
descriptionShort = "Radio FM";
class ItemActions {
class Use {
text = "Listen";
script = "spawn radio;";
use[] = {"ItemRadio"};
};
};
};
1.2 - Save it and repack it with CfgConvert and this command :
cfgConvert [-bin | -txt] {[-dst <destination>] <source>}
Ex: cfgConvert.exe -bin -dst C:\Users\MyName\Desktop\config.bin
C:\Users\MyName\Desktop\config.cpp
Note: You cannot use a folder with a space in the command.
1.3 - Delete the old config.bin and insert your new one
2 - Convert Your Music
Download wich music you want and convert it with http://media.io/
Format : OGG
Quality : Normal
2.1 - Add Your Music
In dayz_sfx.pbo ; tracks
Add your music (.ogg) there
Than Decrypt the config.bin of the dayz_sfx.pbo with unRap
Insert at line : 718
Code:
class dayz_name_of_your_song {
name = "NameOfYourSong";
sound[] = {"\dayz_sfx\tracks\name_of_your_song.ogg", 1.0, 1.0};
duration = "";
};
3 - Make The Script
In dayz_code.pbo ; action add this script and name it radio.sqf :
Code:
private["_hasradio","_item","_text"];
_item = _this;
_hasradio = _this in items player;
_config = configFile >> "CfgMagazines" >> _item;
_text = getText (_config >> "displayName");
if (!_hasradio) exitWith {cutText [format[(localize "str_player_31"),_text,"Listen"] , "PLAIN DOWN"]};
playMusic "dayz_name_of_your_song";
3.1 - Modif Scripts
In dayz_code ; compile ; player_music.sqf add "!dayz_name_of_your-song" or copy that
Code:
private["_zombie","_type","_chance","_rnd","_sound"];
while {!r_player_dead} do {
_num = round(random 35);
_sound = "z_suspense_" + str(_num);
_length = getNumber(configFile >> "cfgMusic" >> _sound >> "Duration");
_pause = ((random 5) + 2) + _length;
if (!r_player_unconscious and !r_pitchWhine and !dayz_name_of_your_song) then {
playMusic _sound;
};
sleep _pause;
};
Code:
radio = compile preprocessFileLineNumbers "\z\addons\dayz_code\actions\radio.sqf";
There you go, you finish and you can listen at your music with a object, radio.
Sorry for my bad english.
A little like is appreciate.
SniPeZz Qc