|
3 registered members (Quad, EvanTJ, AndrewAMD),
4,223
guests, and 2
spiders. |
|
Key:
Admin,
Global Mod,
Mod
|
|
|
Hi George, intelligent music...?
#143603
07/26/07 16:44
07/26/07 16:44
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
I am using that awesome code for my project, now my question is, i have this code on all of my levels named different so i could change the music wavs. so will the music change each level like i want it to, or will the music from the first level that plays it continue on to the next level? i know this is a premature question ansd i should test it myself, but i worked for a long time last night inserting music triggers in all of my levels and altering code in SED. i just wanted to know if the code should work that way in theory. i think it will work,lol.
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: Hi George, intelligent music...?
[Re: George]
#143605
08/05/07 18:42
08/05/07 18:42
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
i finally finished what i was working on and i tested the intelligent music code with a level change. the music doesnt stop, it continues, and when you change levels again, that levels music continues too, it piled up all of the music files on each level until it crashed after the 6th level. here it is: Code:
sound niceloop_wav = <niceloop.wav>; // Your wav file name
sound alarmbrk_wav = <alarmbrk.wav>; // Your wav file name
var music_handle;
var temp_volume;
action music_trigger
{
// my.invisible = on; // remove the comment when you've chosen the best position for the entity
my.passable = on;
while (plbiped01_entity == null) {wait (1);}
while (1)
{
music_handle = snd_loop (niceloop_wav, 50, 0); // play the "gentle" sound track
while (vec_dist (plbiped01_entity.x, my.x) > 100) {wait (1);} // play with "100"
temp_volume = 50; // put the same value that was used for snd_loop here
while (temp_volume > 5) // decrease the volume slowly
{
snd_tune (music_handle, temp_volume, 0, 0);
temp_volume -= 1 * time_step;
wait (1);
}
snd_stop (music_handle); // stop "gentle.wav";
music_handle = snd_loop (alarmbrk_wav, 50, 0); // play the "tense" sound track
while (vec_dist (plbiped01_entity.x, my.x) < 1000) {wait (1);} // play with "1000"
temp_volume = 50;
while (temp_volume > 5) // decrease the volume slowly
{
snd_tune (music_handle, temp_volume, 0, 0);
temp_volume -= 1 * time_step;
wait (1);
}
snd_stop (music_handle); // stop "tense.wav";
wait (1);
}
}
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: Hi George, intelligent music...?
[Re: Blink]
#143606
08/06/07 18:18
08/06/07 18:18
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
George, did you look at the code yet?
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: Hi George, intelligent music...?
[Re: George]
#143608
08/14/07 21:40
08/14/07 21:40
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
i dont quite understand what you mean. should i place the entity in a place where the entity touches it, or should i move it away because it is too close?
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: Hi George, intelligent music...?
[Re: Blink]
#143609
08/16/07 03:42
08/16/07 03:42
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
sorry, can you explain it again, i didnt get what you meant.
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
Re: Hi George, intelligent music...?
[Re: Blink]
#143610
08/16/07 11:59
08/16/07 11:59
|
Joined: Aug 2003
Posts: 2,011 Bucharest, Romania
George

Expert
|

Expert
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
|
Let's examine the first few lines inside the while(1) loop:
music_handle = snd_loop (niceloop_wav, 50, 0); while (vec_dist (plbiped01_entity.x, my.x) > 100) {wait (1);} temp_volume = 50; while (temp_volume > 5) { snd_tune (music_handle, temp_volume, 0, 0); temp_volume -= 1 * time_step; wait (1); }
Since the sound isn't faded out, I believe that the player doesn't come closer than 100 quants to the entity that is supposed to trigger the music change, so you should increase 100 until the player is able to trigger the change. Another possible problem could appear because player's pointer name isn't the proper one. Let me know if you need more info.
|
|
|
Re: Hi George, intelligent music...?
[Re: George]
#143611
08/16/07 12:53
08/16/07 12:53
|
Joined: Jan 2006
Posts: 2,157 Connecticut, USA
Blink
OP

Expert
|
OP

Expert
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
|
what do you mean, the name isnt the proper one? the plBiped01_entity? i had to change it to be able to use it, because i use mostly templates. my character triggers the music change, thats not the problem, the music doesnt stop when the level changes, thats the problem.
My Famous Quotes: "Hip hop is like a virus, infecting everyone and everything around it. Every form of media has some way,shape or form, assimilated hip hop into it." It has also mutated into other strains like, trip hop, house, rap, gangster, and conscious forms. Once you are infected with it, its with you for life."
|
|
|
|