Graal Forums  

Go Back   Graal Forums > Development Forums > Tech Support
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 02-01-2007, 01:21 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Playlooped not functioning properly!

Quote:
Originally Posted by Stefan View Post
For looping wavs: call playlooped all few moments to update the position of the sound, the volume will automatically be adjusted depending on the position of the npc on the screen
I've tried this and discovered that playlooped only adjusts the volume in relation to the player one time. (when the player enters the level or the npc is created)

This was tested on both a single level and a gmap and both times it's only adjusting the volume once.

NPC Code:
//#CLIENTSIDE
function onCreated() {
setTimer(.05);
}
function onTimeout() {
playlooped("bomb.wav");
setTimer(.05);
}



This is technically supposed to make it so if the player walks away from the npc, it should get quieter... but it only sets the volume of the playlooped the first time. (same with playlooped2)
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #2  
Old 02-01-2007, 12:42 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
HTML Code:
//#CLIENTSIDE
function onCreated()
{
  this.onTimeout();
}
function onTimeout()
{
  playlooped2("bomb.wav", this.x, this.y, 1); //The '1' is the player's distance
}
Should work, not tested.
Reply With Quote
  #3  
Old 02-01-2007, 12:47 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Neither of them work properly. They only adjust volume for the position on the player's initial entry and then no longer do it. The "1" in playlooped2 is the volume I believe.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #4  
Old 02-01-2007, 12:50 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Indeed
Quote:
Plays the specified sound file at location x, y with the specified volume. Volume should be between 0 and 1, if volume is set to 1 default volume is used (depending on how far away the player is).
Reply With Quote
  #5  
Old 02-01-2007, 04:26 PM
Crow Crow is offline
ǝɔɐɹq ʎןɹnɔ
Crow's Avatar
Join Date: Dec 2006
Location: Germany
Posts: 5,153
Crow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond reputeCrow has a reputation beyond repute
Use a gani playing the .wav you want to play. Works. Only problem is -> has to contain a little part of an image, or the gani wont work and it wont play the sound.
Reply With Quote
  #6  
Old 02-01-2007, 09:49 PM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Quote:
Originally Posted by Crow View Post
Use a gani playing the .wav you want to play. Works. Only problem is -> has to contain a little part of an image, or the gani wont work and it wont play the sound.
Actually you can make a totally blank gani, put the sound in there and set it as PARAM1 and use showani to play the sound to everyone on a level... But that's neither here nor there.

I posted this in the bug report area so that this will get fixed, not so that I can find ways to work around things that should be doing what I need done.

I'm sure there are several methods of playing a looped wav, but they all have their faults. (playing them in a gani only works until the player walks out of the level and then the gani disappears, along with the sound) (running a timeout with "play" can also loop a wav but it runs the risk of being choppy or skipping and also the needs the exact length of each wav that you plan to use) etc

I just want playlooped and playlooped2 to work like they should. From what I can make out, they are SUPPOSED to change their volume automatically when the player gets closer or farther from the x/y (if you're calling the command repeatedly in a for loop) Which means each time the command is called it should be updating the volume accordingly. But instead, it's ignoring it after the first time.

As far as I know... the only difference between playlooped and playlooped2 is that playlooped2 allows you to specify an x/y (instead of it being forced to be the npc's x/y) and also let's you set the volume... although I really don't understand that parameter at all... Seeing as how if you set the volume and this thing is supposed to adjust it's volume based on it's position... what difference would it make if you set the volume to .5 when the player is right next to it? Wouldn't it be .9 or 1 or something anyway? The only other thing I can assume is that the volume param in playlooped2 is actually to set the maximum volume that the sound can reach.

Either that, or it does indeed set the volume to whatever you desire and doesn't change due to it's position... which is bad and good. Good because that option is needed, and bad because it's taking away the other option of having the volume adjust based on position.

I wish Stefan would read this thread and reply.
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #7  
Old 02-01-2007, 10:08 PM
Chandler Chandler is offline
Banned
Join Date: Jan 2007
Posts: 656
Chandler will become famous soon enough
Quote:
Originally Posted by konidias View Post
I wish Stefan would read this thread and reply.
I cropped it down.

I noticed why. If you were to do it in a timeout, it'd repeat the same sound. If it's not in a timeout, it'd do it on how far the players distance is from when it was called.
HTML Code:
function onCreated()
{
  this.setImg("block.png");
  setTimer(20);
}
function onTimeout()
{
  this.destroy();
}
//#CLIENTSIDE
function onCreated()
{
  this.onTimeout();
}
function onTimeout()
{
  playlooped2("bomb.wav", this.x, this.y, 1);
  setTimer(0.05);
}
Removing the clientside timeout and only having the playlooped2 would work, but it isn't updated.

Last edited by Chandler; 02-01-2007 at 10:21 PM..
Reply With Quote
  #8  
Old 02-02-2007, 07:44 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
It will be fixed in the next Graal version.
Reply With Quote
  #9  
Old 02-03-2007, 01:29 AM
konidias konidias is offline
Old Bee
konidias's Avatar
Join Date: Jul 2001
Location: Orlando, FL
Posts: 7,222
konidias will become famous soon enough
Send a message via AIM to konidias
Yay! When will that be?
__________________

Put this image in your sig if you support Bomy Island! (g2k1 revision)
play bomberman while you wait!


Reply With Quote
  #10  
Old 02-03-2007, 01:48 AM
Rapidwolve Rapidwolve is offline
Registered User
Join Date: Jul 2006
Posts: 1,241
Rapidwolve is an unknown quantity at this point
Don't ask for any release dates z.z
theyll probobly be broken ='[
Reply With Quote
  #11  
Old 10-22-2010, 03:30 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Bump!
__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
  #12  
Old 10-24-2010, 12:38 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
What? Works in v5, at least for the ocean sound on Kingdoms.
Reply With Quote
  #13  
Old 10-24-2010, 01:16 PM
xXziroXx xXziroXx is offline
Malorian
xXziroXx's Avatar
Join Date: May 2004
Posts: 5,289
xXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant futurexXziroXx has a brilliant future
Quote:
Originally Posted by Stefan View Post
What? Works in v5, at least for the ocean sound on Kingdoms.
Quote:
Originally Posted by Crow View Post
When using play2() or playlooped2() with coordinates, the "direction" of the sound playing doesn't update when the player moves, but stays the same all the time, from the point where the function is called. Not cool. Can't we make this dynamic?

The "problem" is that the sound doesn't update automatically when the player moves. This would ideally be the only thing needed:

PHP Code:
//#CLIENTSIDE
function onCreated()
  
playlooped2("mal_caveambience.wav"this.xthis.y1); 
Then it would continuously refresh the sound strength/direction whenever the player moves, but that's not the case. For it to work, you need to use it in a timeout and run the command over and over again:

PHP Code:
//#CLIENTSIDE
function onCreated()
  
setTimer(.05);
function 
onTimeOut()
{
  
playlooped2("mal_caveambience.wav"this.xthis.y1);
  
setTimer(.05);

__________________
Follow my work on social media post-Graal:Updated august 2025.
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 07:10 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.