[help] dvar_t* Dvar_RegisterString thingy for music.
Featured Replies
Сейчас на странице 0
- Нет пользователей, просматривающих эту страницу
A better way to browse. Learn more.
A full-screen app on your home screen with push notifications, badges and more.
Используя этот сайт, вы соглашаетесь Условия использования.
Yep you know NT has replaced menu music with 'bridge' music. I think its about storm.
Just looked MusicTalent :shock: cpp and see some awesome 'implementions' to game. Decided to make 'changeable' menu music by game dVar.
Did it by
dvar_t* music = Dvar_FindVar("iw4m_music");
if( music->current.integer == 0 ) { newFile.file = "hz_t_oilrig_themestealth_v1.mp3"; }
if( music->current.integer == 1 ) { newFile.file = "hz_boneyard_intro_LR_1.mp3"; }
if( music->current.integer == 2 ) { newFile.file = "hz_gulag_showers_LR_1.mp3"; }
if( music->current.integer == 3 ) { newFile.file = "hz_contingency_launch_LR_1.mp3"; }
if( music->current.integer == 4 ) { newFile.file = "hz_special_ops_2mx.mp3"; }
if( music->current.integer == 5 ) { newFile.file = "user.mp3"; }
and putting Dvar_RegisterInt("iw4m_music", 0, 0, 5, DVAR_FLAG_SAVED, "Main menu music theme. Specify by number:\n0: Default \n1: NTAuthority 'Bridge' \n2: Pvt. Mert* 'Showers' \n3: 'Launch' - Contingency \n4: Special Ops Theme \n5: User Specified*\n*) Put a mp3 file into m2demo/sound/music by named 'user.mp3'...");
after installhook codes.
when you set dvar 0 to 5 and make snd_restart the music will play and it also saves itself config file. thats not my problem
my problem is i wanted to make 'specify name' dvar.
replaced all these ifs with only 'newFile.file = music->current.string;' code. So game needs to be read this var at startup. but there is no such var so game crashes. (if you start game with iw4m +set iw4m_music hz_t_oilrig_themestealth_v1.mp3 no problem it works)
I tried to put Dvar_RegisterString("iw4m_music", "hz_t_oilrig_themestealth_v1.mp3", 1, "Menu music file name."); after these installhooks but game crashes instantly.
tried put this somewhere in patchmw2.cpp and still doesnt work.
After all, you can add your custom music by putting your file into m2demo/sound/music and typing its full name into console... it will play...
hope some1 helps me
thx