Menu

Show posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Show posts Menu

Messages - khnum

#41
Thanks Scorpius, it worked  :D
#42
So, i' making a gui to switch between different characters, and when you click on the image of the character you want to switch to, an animation starts; anyway, if the character is in the same room, there are no problems, but if the player is in another room, the room changes after the animation (and i want it to start after the room change). Since setAsPlayer waits for the entire function to finish before switching, what can i do?
#43
I could help you with music, but let me know if you want midis or not.
#44
 :( I never said it was exactly like iMuse, it was just my workaround to the problem of the inaccuration of seekmp3posmillis. Anyway there are a few bugs: sincevwhen using digital music setting master volume to 0 doesn't completely silence the music, i had to lower the digital master volume (from 100 to 50), so if there's some voice or fx playing, it will affect this changing;

another problem is the room's music level: my script only works well with normal, and needs some fixes to work with other levels (don't know if monkey_05_06 fixed it in the module)
#45
No problem, happy to see my code's been useful  :=
#46
Ok, i definitively did it!
To override the break we all heard, i fade out music1, then fade in music2 strating where music1 was. (it works with oggs, mp3, and wave; i haven't tested it on midis but it should work if you use getmidiposition instead of getmp3posmillis)

Here is the code:
Code: ags

first of all put this at the beginning of the script:


int fade_switch=0, timer=0, music, mp3pos,vol;

then import the same variables into the haeder.



put this into repeatedly_execute:

if (fade_switch==1) {
  timer++;
  if (timer<=100) {
    SetMusicMasterVolume(100-timer);}
  if (timer>100){
    if (timer<=150){
      SetDigitalMasterVolume(100-(timer-100));
      mp3pos=GetMP3PosMillis();}
    if (timer==151) {
      SetMusicVolume(-2);
      PlayMusic(music);
      SeekMP3PosMillis(mp3pos);}
    if (timer>151){
      if (timer<=200){
	SetDigitalMasterVolume(50+(timer-150));}
      if (timer>200){
	if (timer<=300){		          
	  SetMusicMasterVolume(0+(timer-200));}
	if (timer==310) {
	  SetMusicVolume(-1);}
	if (timer==320) {
	  SetMusicVolume(0);}
        if (timer>320) {
          fade_switch=0;
	  timer=0;}




Ok, this is the code; now let's check the variables:

"fade_switch" is the switch that make the music change;

"music" is the music number;


to make the music change (in a room, an interaction, or wherever you want) turn the switch on (fade_switch=1), and set "music" to the number of the incoming song (i.e. music=2 for music2.ogg)

Of course you can change fade velocity, just make some calculation :)

If you're gonna use the code I'd appreciate to be in your credits, but you don't have to :P

Edit by strazer (Please use the Modify button instead of double-posting.):

I forgot: the only problem is you can't let the player set the music volume, because the script wouldn't work :( ; anyway it's easy to solve it, i'll do it (not today :P).

oh, another thing: the lawith nst part of the script works with a room with "normal" as music volume; of cours you can easily fix the script to fit any sound level  ;)
#47
thanks for your help CJ and monkey_05_06!
I did it! i'll post the code in this thread, because the code is supposed to be a solution for the emulation of the iMuse system in ags:

http://americangirlscouts.org/bbc.com/yabb/index.php?topic=23221.40
#48
Maybe I didi it! Just need to improve the script...
I'll post it as soon as I finish  ;)
#49
so there isn't any way to solve the problem?  :(
#50
I think i'll try the funk-a-delic system :(
#51
It doesn't work...
Anyway i don't want to use "wait", because it would block all the other script
#52
Music3 isn't the problem, the script works, but music2 start from the beginning, not from the position i put in seekMP3PosMillis.
#53
I'm trying to make an audio system similar to iMuse, but i have a problem:

Since there's olways that break, using the goto functions, i want to put a bar of silence between the two tracks, so the second one would start from the same position of the other one, and nobody would notice the break;

I used a blank midi to make the sound stop, and the code is this:

Code: ags

iPos=GetMP3PosMillis(); // music1 is playing
SetMusicRepeat(0);
PlayMusic(3); // the blank midi
SetMusicRepeat(1);
PlayMusicQueued(2);
SeekMP3PosMillis(iPos);


the problem is that seekMP3PosMillis doesn't seem to work when using PlayMusicQueued!
In fact if i just use PlayMusic(2), it works, but the script doesn't wait for music3 to finish.

Is this a known bug?
#54
Quote from: Nikolas on Mon 31/10/2005 12:46:29
You could keep this track in MP3 format and have another "empty" track in WAv form. The second WAV form could be only one bar. This way you wouldn't need to track the MP3 or make it into WAV, thus wasting space and quality

Since we don't need to fade it, couldn't the empty track be a midi, so we wouldn't (at least i hope) slow the engine? Using a wav could work, but if we're also using fx, it could be a problem.
#55
I just noticed this problem, and i relly need to anti-alias sprites with alpha channel! :'(
Can you help me? When will this problem be solved? If it'll take too much, can you at least tell me if there's a way i can solve it?


Thanks for this great program CJ!
SMF spam blocked by CleanTalk