Ambrosia Garden Archive
    • stop music from looping


      How do I stop music from looping? Anyone?

      I trigger an mp3 file using a map event and I want it to only play once. Starting an mp3 file without sound on entering the map and checking the play only during ... checkbox in the play sound event does not work.

      TIA

      ------------------

    • try an animation (with white picts..ask Mr.Owl i mean Stark)
      record yur pieces total playing time
      figure out the proper frame delay rate
      (a delay of 3 is approximately one second per frame...you see the world at minimum aobut 32 frames a second)
      let's say its a 5 minute song, 60(sec) * 5 = 300(sec) --> 300 * 3(per sec frame delay) = ((900( total frame delay , if animation were one frame 5min long)))

      we could technically have a 300 frame animation with a 3frame delay..bad idea
      divide 300 by a manageable number, let's say by 3
      (...think algebra what you do to one side of an equation you must do to both sides, so..)
      so you must multiply the delay by three, so you end up with 100 frames that last 3 times as long(delay of 9) in order to balance the equation.

      consult a math minded person(if its not urself) who likes word problems/can set up & solve systems of equations/linear models.

      this makes for a 100 frame animation, better (but you could reduce it more)...

      1, uh-2, ah 3...3--*{}

      prep complete,now the procedure..

      the first frame, either uses a flag to play the music, or launches an event to play the music, oh no it'll loop.
      choices:
      1.
      the last frame can either switch animation (indeces) which will switch to the next similar index which will play the next piece..(good news delays can vary by index)
      and the very last frame can either go back to the first index or kill itself.

      or
      2.
      add 2 frames to the end (the more frames the shorter the play time inbetween pieces)
      the second to last frame launches the next 'song animation' file.

      the last frame, THE KILL FRAME , this frame will have a flag with the parameter, 'kill myself'...

      trouble shoot: you might need to pad the beginning of the other animation, with a 2 frame index with a delay equal to the previous piec of music..the second frame would have a switch index, the next index would be your main 'song index'

      SONG INDEX..tatsu maki senpu kyaku

      ------------------

      ... I'm like Imhotep but don't flaunt it.

    • Thanx!

      But how much of this is dependant on the speed of the computer you are dealing with?

      I remeber one time working with Flash to create a program whereby people could compose their own music based on samples, but no matter what I tried, it would play different on different machines (and even on the same machine)

      But in this case this could be taken care of by incorporating a long silence at the end of the song.

      ------------------

    • now truth be told, if the machine cannot run the medieval map (the town) successfully and without slowdown, then it will slow down. The medieval project is an acceptable gauge of the engine's bare minimum capability + 1.

      the frame rate i CGE will not increase, ever, its capped at 30 frames per second, and When graphics routines, the engine must copy the image offscreen then paste it to the visible area. You are pasting(what CGE considers to be) nothing to the screen, white cells, and on top of that you have lessened the demand to do nothing, mind you it must still go through the process, else it wouldn't execute at all. SO it should be pretty dependable. If you're willing to build this, i'm sure some of the board members wouldn't mind inserting the source files into there standby of the medieval demo project folder that they all (should) keep on hand for testing out new ideas.

      random:
      assume you use the 2nd method that uses the KILL FRAME (which incidentally eliminates a truly random queue).
      Now instead of there being 2 frames make it only one,
      this last frame calls an event.
      this event contains a stamp control(which means that the previous song animation would have to be placed by a stamp control as well, likely in the initialization event, or in the event that would cue the music. Say the main villain walks in, then play his theme music! See ***), that kills the previous stamp/animation file. it can in the same stamp control launch the next stamp onto the map, continuing the loop.

      *** Let's say you have characters who demand an introduction (sound) to be played when in range, equip them with a spell, the spell has 0 damage and they cast it on themselves, the spell however can only be cast when a global equals 1,
      (which is better than using encounterinprogress, because you might have multiple npcs present and only want to signify the presence of one)
      the event link for cast plays the sound.

      the uses of this can be used during combat, but has its best uses for ingame cutscenes/dialog.

      now if oyu had a piece of ambient music, which most intro MUSIC could possibly be, nothing too specific, looping etc, you could possibly use;

      the spell rounds to time the length the piece should play, and then in the effects removed event link have a play music action that plays 'NONE'
      (this is how you stop a piece of music in general but is useless because the engine has no timer function other than wait, which completely halts the game)

      or if the music should play until something happens simply have a play music action play 'NONE', at that time. Like let's say you have a scene, where the character is walking down the street and the ambient music of birds chirping and crickets and such is playiung, and then suddenly a black suburban 3 wheels around the corner and 6 cats dressed in night shade jump out and sling oyu into the van like mashed potatos. Right when they hop out might be a good time to switch to soimething a little less cheery and more 'Muhuhahahaaaa'.

      what not, ad mnauseum,etcetera, furthermore, henceforth, so forth so on, exeunt '...'

      ------------------

      ... I'm like Imhotep but don't flaunt it.

      { edit }

      (This message has been edited by ellrx (edited 06-12-2003).)