Gamestudio Links
Zorro Links
Newest Posts
Removing outliers from files
by EvanTJ. 11/28/26 18:19
Experiences with cTrader
by JeyKey II. 11/27/26 09:04
make a complaint
by EW_bytes. 11/26/26 23:00
FXCM => AVA Trade Plugin???
by Martin_HH. 11/25/26 21:59
No connection to MT4
by Martin_HH. 11/23/26 06:38
MinMax function on History t6 file
by LucasJoshua. 11/21/26 14:28
What are you working on?
by rayp. 11/20/26 18:10
AUM Magazine
Latest Screens
Dorifto samurai
Shadow 2
Rocker`s Revenge
Stug 3 Stormartillery
Who's Online Now
3 registered members (Quad, EvanTJ, AndrewAMD), 4,223 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Newest Members
EvanTJ, rht, MaliceTheMaker, Haitao_Ren, JimSimons
19250 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Page 1 of 3 1 2 3
Hi George, intelligent music...? #143603
07/26/07 16:44
07/26/07 16:44
Joined: Jan 2006
Posts: 2,157
Connecticut, USA
Blink Offline OP

Expert
Blink  Offline 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: Blink] #143604
07/27/07 06:13
07/27/07 06:13
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
Yes, the code will work fine if you use different functions and music file names in different areas. Let me know if you encounter problems with it.

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 Offline OP

Expert
Blink  Offline 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 Offline OP

Expert
Blink  Offline 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: Blink] #143607
08/13/07 20:00
08/13/07 20:00
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
Sorry for the delay; I was away for a few days. It looks like this line of code:

while (vec_dist (plbiped01_entity.x, my.x) > 100) {wait (1);}

isn't working properly; the player might not be able to come closer than 100 quants to the entity that is supposed to trigger the change, so the music can't be faded out (doesn't stop).

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 Offline OP

Expert
Blink  Offline 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 Offline OP

Expert
Blink  Offline 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 Offline

Expert
George  Offline

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 Offline OP

Expert
Blink  Offline 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."
Re: Hi George, intelligent music...? [Re: Blink] #143612
08/16/07 19:42
08/16/07 19:42
Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
George Offline

Expert
George  Offline

Expert

Joined: Aug 2003
Posts: 2,011
Bucharest, Romania
If that's the problem, you should insert a simple:

snd_stop (music_handle);

before the level_load instruction. That should fix it.

Page 1 of 3 1 2 3

Moderated by  George 

Gamestudio download | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1