Please login or register.

Login with username, password and session length
Advanced search  

News:

Latest WME version: WME 1.9.1 (January 1st, 2010) - download

Author Topic: Cutting sounds with a mouse click?  (Read 5318 times)

0 Members and 1 Guest are viewing this topic.

Blue_D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 66
  • I'm a llama!
    • View Profile
Cutting sounds with a mouse click?
« on: February 28, 2004, 08:59:40 PM »

Hi, how can i make a sounfile stop playing by clicking with the left mouse button like videos?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Cutting sounds with a mouse click?
« Reply #1 on: February 28, 2004, 11:53:43 PM »

What sound exactly? How do you play the sound?
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Blue_D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 66
  • I'm a llama!
    • View Profile
Re:Cutting sounds with a mouse click?
« Reply #2 on: February 29, 2004, 12:11:30 AM »

Actually I do it like this

Code: [Select]
Game.Interactive = false;
            actor.PlayAnim("actors\pinguino\ll\take.sprite");
            Game.PlayMusic("scenes\musica\22 - praeludium in d major, bwv925.ogg", false);
            StateMusica.NastriRec = true;
            Sleep(55000);

but it has a basic problem: when I save the game, then load, the music starts and I don't want it.

I can use the entity.PlaySound, but I want to play the sound only one time, and be able to cut the music playing in every moment I want to. Now I use a Sleep to synchronize the things.

How can I do it?
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Cutting sounds with a mouse click?
« Reply #3 on: February 29, 2004, 12:21:53 AM »

Well, after you load the game, music should play approximately from the point is was saved before. You can stop music using Game.StopMusic() when some conditions are met.
If I understand it correctly, you need the music playing and the player can either listen to it for 55 seconds of finish it by clicking. Is that right? In that case I'd recommend creating a large invisible window covering the entire screen, with a large invisible button. If the player clicks, he'll actually press the button and you'll be able to stop the music and hide the window.
« Last Edit: February 29, 2004, 12:22:29 AM by Mnemonic »
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Blue_D

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 66
  • I'm a llama!
    • View Profile
Re:Cutting sounds with a mouse click?
« Reply #4 on: February 29, 2004, 12:41:40 AM »

Quote
Well, after you load the game, music should play approximately from the point is was saved before. You can stop music using Game.StopMusic() when some conditions are met.

No, it plays again from the start. Very strange.

Quote
If I understand it correctly, you need the music playing and the player can either listen to it for 55 seconds of finish it by clicking. Is that right? In that case I'd recommend creating a large invisible window covering the entire screen, with a large invisible button. If the player clicks, he'll actually press the button and you'll be able to stop the music and hide the window.

The problem is, that the music plays within a scripted sequence, so the game is "Game.Interactive = false".

Well, I think I can turn on and the again off when clicking the window.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re:Cutting sounds with a mouse click?
« Reply #5 on: February 29, 2004, 10:01:39 AM »

No, it plays again from the start. Very strange.

Strange indeed. There may be a slight inaccuracy but at most a few (three?) seconds.


The problem is, that the music plays within a scripted sequence, so the game is "Game.Interactive = false".

Well, I think I can turn on and the again off when clicking the window.

Yes. Since the window is covering the entire screen, you don't need Interactive = false anymore, because the player cannot click anything anyway. You may even change that window's cursor to the waiting one, so that it *appears* the game is in a non-interactive state.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave
 

Page created in 0.033 seconds with 23 queries.