FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visitView your postsView unanswered posts

Inserting Music

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
SooperK

Junior Member
Junior Member


Joined: 10 Nov 2014
Posts: 39
Location: Jennewa, Airdenor
73 Bank Notes
Items

PostPosted: Sun Mar 24, 2019 11:45 pm    Post subject: Inserting Music Reply with quote

Trying to insert a sound file upon dying in freeride day using a wav. file. Any known way to do this in bscript?
Back to top
View user's profile Send private message
mammix

Junior Member
Junior Member


Joined: 20 Sep 2014
Posts: 54
Location: Lublin, Poland
3006 Bank Notes
Items

PostPosted: Mon Mar 25, 2019 4:17 pm    Post subject: Inserting Music Reply with quote

14940032 and 14940033
I think these are the sounds Tommy makes when he dies. Replace them with your sounds in wav.
Back to top
View user's profile Send private message
SooperK

Junior Member
Junior Member


Joined: 10 Nov 2014
Posts: 39
Location: Jennewa, Airdenor
73 Bank Notes
Items

PostPosted: Tue Mar 26, 2019 12:25 am    Post subject: Inserting Music Reply with quote

I tried this last night:

Under EnergyMeter in bscript, I used this script below:

dim_act 1
dim_flt 1

findactor 0, "Tommy"

label 101
human_getproperty 0,0,Energy
if flt[0] = 0, -1,101
citymusic_off
stream_create 0, "sounds\music\fate.ogg"
stream_play 0
wait 10000

endofmission 0, 00980004
end

This is the end of the mission which in this case turns off the city music, and begins to play the music from Frank's funeral. (I decided to just go with the music .ogg files in the sounds folder). I searched through SomebodYs Improved Script reference and found the "stream_create". The ID, (in this case "0"), from my understanding must match the value in flt[]. The stream_create 0, locates the .ogg file to be played, and stream_play 0, indicates that the above file should be played unto its end. Whether or not the music laps, I do not know.
Back to top
View user's profile Send private message
mammix

Junior Member
Junior Member


Joined: 20 Sep 2014
Posts: 54
Location: Lublin, Poland
3006 Bank Notes
Items

PostPosted: Tue Mar 26, 2019 4:47 pm    Post subject: Inserting Music Reply with quote

It looks fine. Does it work?
Back to top
View user's profile Send private message
SooperK

Junior Member
Junior Member


Joined: 10 Nov 2014
Posts: 39
Location: Jennewa, Airdenor
73 Bank Notes
Items

PostPosted: Tue Mar 26, 2019 11:50 pm    Post subject: Inserting Music Reply with quote

Yes, this is tested and does work! Just wondering if it will work with any type of sound file like mp3 or wav and not just ogg. I'll test both of these and post back
Back to top
View user's profile Send private message
AsaSK

Mafiascene Veteran Modder
Mafiascene Veteran Modder


Joined: 24 Feb 2013
Posts: 756
Location: London, England
13725 Bank Notes
Items

PostPosted: Wed Mar 27, 2019 11:43 am    Post subject: Inserting Music Reply with quote

The 'stream_create' command only works with .OGG, 'playsound' works for .WAVs, .MP3 isn't supported AFAIK.
_________________

The official Mafioso Mod thread
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.021 | Queries: 18