Graal Forums  

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

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 03-13-2006, 02:29 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Playing Mids on Gmap

I have a script which plays mids on the overworld. Well, for some reason you only hear the sounds if you go into a room, and then go back outside. And it will only play that sound for that level.

Anyway, hopefully someone knows a fix.

I am using stef midis. (stef3/27/32/51 etc.. )
Using play("stef32.mid"); for example.

If you know a fix, don't be scared, please reply. :O
Reply With Quote
  #2  
Old 03-20-2006, 09:46 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Use a system NPC to play the music for each level.

PHP Code:
this.midi = {"stef3""stef23""stef7"};
this.midi.stef3 = {"level2.nw""level3.nw""level4.nw"};
this.midi.stef23 = {"level5.nw""level6.nw""level7.nw""level8.nw"};
this.midi.stef7 = {"level9.nw""level10.nw"};
for (
athis.midi) {
  if (
makevar("this.midi." a).index(player.level) >= 0playlooped(".mid");

Reply With Quote
  #3  
Old 03-20-2006, 10:55 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Yen
Use a system NPC to play the music for each level.

PHP Code:
this.midi = {"stef3""stef23""stef7"};
this.midi.stef3 = {"level2.nw""level3.nw""level4.nw"};
this.midi.stef23 = {"level5.nw""level6.nw""level7.nw""level8.nw"};
this.midi.stef7 = {"level9.nw""level10.nw"};
for (
athis.midi) {
  if (
makevar("this.midi." a).index(player.level) >= 0playlooped(".mid");

I never understood your obsession with makevar().
__________________
Skyld
Reply With Quote
  #4  
Old 03-20-2006, 11:11 PM
Yen Yen is offline
Banned
Yen's Avatar
Join Date: Oct 2005
Location: Nova Scotia, Canada
Posts: 1,085
Yen is an unknown quantity at this point
Send a message via AIM to Yen Send a message via MSN to Yen
Quote:
Originally Posted by Skyld
I never understood your obsession with makevar().
("this.midi." @ a) has only worked for me once.
Reply With Quote
  #5  
Old 03-21-2006, 12:46 AM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Yen
("this.midi." @ a) has only worked for me once.
this.midi.(@ a) or so.
__________________
Skyld
Reply With Quote
  #6  
Old 03-21-2006, 07:55 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Hmm, can you explain exactly what 'makevar' does? It sounds like it would make a variable, but why make a variable that already exists?
Reply With Quote
  #7  
Old 03-21-2006, 08:48 AM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by KuJi
Hmm, can you explain exactly what 'makevar' does? It sounds like it would make a variable, but why make a variable that already exists?
PHP Code:
this.blahani "carrystill";
this.pblah "ani";
this.pani "blah";
setani(makevar(this.pani this.pblah),null); 
would inevitably give you carrystill. old gscript equivalent of #s(#s(something))

It takes a string and returns the variable that the string indicates.
Reply With Quote
  #8  
Old 03-25-2006, 05:35 AM
KuJi KuJi is offline
Banned
Join Date: Apr 2004
Location: Staten Island, New York
Posts: 2,202
KuJi will become famous soon enough
Send a message via ICQ to KuJi Send a message via AIM to KuJi Send a message via MSN to KuJi Send a message via Yahoo to KuJi
Quote:
Originally Posted by jake13jake
PHP Code:
this.blahani "carrystill";
this.pblah "ani";
this.pani "blah";
setani(makevar(this.pani this.pblah),null); 
would inevitably give you carrystill. old gscript equivalent of #s(#s(something))

It takes a string and returns the variable that the string indicates.
So, it merges the variables together?
Reply With Quote
  #9  
Old 03-25-2006, 03:48 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by KuJi
So, it merges the variables together?
It takes a string value (the string value can be stored in variables), and returns the variable of the name of the string value.
Reply With Quote
  #10  
Old 03-25-2006, 04:45 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by jake13jake
It takes a string value (the string value can be stored in variables), and returns the variable of the name of the string value.
Well, a link to the variable.
__________________
Skyld
Reply With Quote
  #11  
Old 03-25-2006, 05:05 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by Skyld
I never understood your obsession with makevar().
It is infinitely clearer than the obscure this.(@) thing!
Reply With Quote
  #12  
Old 03-25-2006, 05:16 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by Loriel
It is infinitely clearer than the obscure this.(@) thing!
I disagree. I find it easier to read over and recognise variable prefixes to identify variables than seeing "makevar".
__________________
Skyld
Reply With Quote
  #13  
Old 03-25-2006, 05:17 PM
Loriel Loriel is offline
Somewhat rusty
Loriel's Avatar
Join Date: Mar 2001
Posts: 5,059
Loriel is a name known to allLoriel is a name known to allLoriel is a name known to allLoriel is a name known to all
Quote:
Originally Posted by Skyld
I disagree. I find it easier to read over and recognise variable prefixes to identify variables than seeing "makevar".
Well, your opinion is wrong.
Clearly.
Reply With Quote
  #14  
Old 03-25-2006, 05:50 PM
jake13jake jake13jake is offline
Former Classic Staff
jake13jake's Avatar
Join Date: Dec 2002
Location: Northwest Vermont
Posts: 1,452
jake13jake will become famous soon enough
Quote:
Originally Posted by Skyld
I disagree. I find it easier to read over and recognise variable prefixes to identify variables than seeing "makevar".
makevar is easier for writing.
this.(@) thing is easier for reading.
makevar, however, is a lot more flexible.
Reply With Quote
  #15  
Old 03-25-2006, 06:35 PM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by jake13jake
makevar is easier for writing.
this.(@) thing is easier for reading.
That is 100% your opinion.

Quote:
Originally Posted by jake13jake
makevar, however, is a lot more flexible.
How do you figure?
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
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 10:12 PM.


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