Graal Forums  

Go Back   Graal Forums > Development Forums > NPC Scripting
FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 10-31-2011, 10:36 PM
Elk Elk is offline
Sr Marketing Strategist
Elk's Avatar
Join Date: Nov 2005
Location: Deerland
Posts: 3,829
Elk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant futureElk has a brilliant future
Send a message via ICQ to Elk Send a message via AIM to Elk Send a message via MSN to Elk Send a message via Yahoo to Elk
Crossfade

If I have an URL loopplayed on an overworld, and I want it to crossfade into the Inn theme once I enter the Inn, is there a possability to do so with a script? Please let me know!
Reply With Quote
  #2  
Old 10-31-2011, 11:15 PM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Might be able to rig something together using gani sounds (good luck). Other than that, no.
__________________
Quote:
Reply With Quote
  #3  
Old 10-31-2011, 11:24 PM
0PiX0 0PiX0 is offline
Coder
0PiX0's Avatar
Join Date: Jan 2011
Posts: 130
0PiX0 is a jewel in the rough0PiX0 is a jewel in the rough
Rather than streaming the file from a webserver every time, try downloading it as a game file.
HTML Code:
requesturlasgamefile(str, str, int, bool) - returns object - works similar to redirects in the folder configuration: you can use this function to download files from the web and treat them like files downloaded from the server; parameters are the url, the download filename, modification time (0 for current), and if the you want to force download (true/false), otherwise it will only download if the web server file changed
I know file size limitations are often exceeded with mp3 files. If you set up grattpd and have the music file available on your server, you should be able to download it to the client with requesturlasgamefile after setting serverr.ip and serverr.port from grattpd. Alternatively see if Stefan will enable large file downloads on your server.

As for the crossfade effect, that might be possible if you use 2 animations that play 2 different songs, and moved them to positions relative to the screen focus. But, then you would have to base your entire music system on animations.

I did a bit of fiddling with $pref::audio::mp3volume to see if it was possible to fade out one song, and fade into a new one, but it seems that the actual audio volume output doesn't update until you open the Options window (at least on v6). People probably don't want their options messed with anyway.
__________________
Reply With Quote
  #4  
Old 10-31-2011, 11:31 PM
oo_jazz_oo oo_jazz_oo is offline
Jazz teh Awesome
oo_jazz_oo's Avatar
Join Date: Jul 2006
Location: California
Posts: 596
oo_jazz_oo is a jewel in the roughoo_jazz_oo is a jewel in the rough
Send a message via MSN to oo_jazz_oo
Quote:
Originally Posted by Elk View Post
If I have an URL loopplayed on an overworld, and I want it to crossfade into the Inn theme once I enter the Inn, is there a possability to do so with a script? Please let me know!
Could do something like this when entering a new level.
PHP Code:
//#CLIENTSIDE
function onPlayerEnters() {
  for(
temp.1temp.0temp.-= .1) {
    
setmusicvolume(temp.itemp.i);
    
sleep(.05);
  }
  
stopmidi();
  
playlooped("newsong");

Then could always use do another small loop to increase the volume of the second song. Not exactly crossfade, but, close.
__________________

Reply With Quote
  #5  
Old 10-31-2011, 11:36 PM
0PiX0 0PiX0 is offline
Coder
0PiX0's Avatar
Join Date: Jan 2011
Posts: 130
0PiX0 is a jewel in the rough0PiX0 is a jewel in the rough
I didn't know setmusicvolume existed. :o Cool.
__________________
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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:49 PM.


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