wc3campaigns
WC3C Homepage - www.wc3c.netUser Control Panel (Requires Log-In)Engage in discussions with other users and join contests in the WC3C forums!Read one of our many tutorials, ranging in difficulty from beginner to advanced!Show off your artistic talents in the WC3C Gallery!Download quality models, textures, spells (vJASS/JASS), systems, and scripts!Download maps that have passed through our rigorous approval process!

Go Back   Wc3C.net > Resources > Code Resources > Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 09-05-2009, 12:29 PM   #46
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

I am almost 100% sure that it is still a problem and that those were false rumors. Does anyone know if TriggerExecute starts a new thread or not? I seem to still be getting errors for first-time playing in this current build of SoundUtils when applied to my maps.
__________________
Rising_Dusk is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 09-05-2009, 12:55 PM   #47
Captain Griffen
Dread Lord of the Cookies
 
Captain Griffen's Avatar


Content Director
 
Join Date: Sep 2003
Posts: 5,375

Submissions (2)

Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)Captain Griffen is a glorious beacon of light (497)

Approved Map: Warlords[Quicksilver #2] - 1st Place

Default

TriggerExecute starts a new thread. You can crash it, you can wait in it, etc.
__________________
Quote:
Originally Posted by Earth-Fury
Griffen is correct, you are not.
Quote:
[13:32] <Akolyt0r> hmm.. stil i want to have some unused women
Captain Griffen is offline   Reply With Quote
Old 09-05-2009, 01:04 PM   #48
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Hrmm... I must do more testing.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-05-2009, 06:14 PM   #49
Bobo_The_Kodo
oO
 
Bobo_The_Kodo's Avatar
 
Join Date: Jul 2008
Posts: 580

Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)Bobo_The_Kodo has a spectacular aura about (109)

Default

It is only a problem when KillSoundWhenDone(<sound>) is done on it that it won't play the first time in my experience.

Last edited by Bobo_The_Kodo : 09-05-2009 at 06:14 PM.
Bobo_The_Kodo is offline   Reply With Quote
Old 09-12-2009, 02:22 PM   #50
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Collapse JASS:
//* mp3 files can be used as 3D sounds in the specific case where your computer
//* supports "Dolby Surround" and that option is selected in your WC3's Sound
//* Options. In the event that your computer doesn't support this, you will need
//* to use .wav files for your 3D sounds. This limitation makes .wav sounds
//* important for the general mapmaker, since they run both with and without
//* Dolby Surround. This library supports sounds of either type.
I managed to figure that out with some testing and help from one Bobo_The_Kodo. (Thanks!) So it seems that mp3s do work for 3D sounds in that specific case, but not in other cases. That means that 3D sounds you make working depends on system specs, but if you use .wav files it plays on all setups with 3D sounds enabled. That makes .wav files important. Anyways, the library supports both.

Also, updated the library to always play a sound after a 0.001 callback. For whatever reason, this makes 3D sounds play more often and reduces the inexplicable chance for them to not play. (I got 92 plays of 100 instead of the previous 64 plays out of 100 with the old method of using a new thread) Why it sometimes fails is still beyond me, because the code is running fine, it is as if WC3 just doesn't transmit data to my speakers or something.

Anyways, I believe this form of SU is the best it can be. I still welcome suggestions and such, however.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-12-2009, 03:41 PM   #51
Troll-Brain
User
 
Join Date: Oct 2006
Posts: 1,490

Submissions (1)

Troll-Brain has a spectacular aura about (134)

Default

Can't you get if a sound will be played or not with these functions ?
Collapse JASS:
native GetSoundIsLoading            takes sound soundHandle returns boolean
native GetSoundIsPlaying            takes sound soundHandle returns boolean

Just a thought, i didn't test them.
Troll-Brain is offline   Reply With Quote
Old 09-12-2009, 05:27 PM   #52
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

You could use TimedLoop, however you would need to remake SoundUtils and it would be a bad idea.

Also, why not make this also work for musics?
I mean, it is annoying when someone wants to play a LIST of musics in wc3 and we can't or need extensive triggers with waits to do it.
You could add this simple feature.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 09-12-2009, 05:40 PM   #53
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

In my experience, music is not difficult enough to handle to merit any sort of script utility for them.
__________________
Rising_Dusk is offline   Reply With Quote
Old 09-12-2009, 06:55 PM   #54
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Still, it is something you would do in a few minutes and it would improve the use of your system by the users. Just an opinion though.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 09-12-2009, 07:24 PM   #55
Karawasa
Element Tower Defense
 
Karawasa's Avatar
 
Join Date: Feb 2006
Posts: 1,094

Submissions (2)

Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)Karawasa has a spectacular aura about (78)

Approved Map: Tropical TagApproved Map: Element TD

Send a message via AIM to Karawasa Send a message via MSN to Karawasa
Default

Quote:
Originally Posted by Flame_Phoenix
I mean, it is annoying when someone wants to play a LIST of musics in wc3 and we can't or need extensive triggers with waits to do it.
You could add this simple feature.

Who wants to play a list of music!? Do you realize how much space these files take up? I can assure you that a "playlist" would bump you right up to 8 MB, and from there you can kiss BNET goodbye. Now if you're making a singleplayer map, that's a different story.
__________________

Element Tower Defense - Premier WC3 Custom Game
Karawasa is offline   Reply With Quote
Old 09-12-2009, 07:39 PM   #56
Flame_Phoenix
retired coder | real ilfe
 
Flame_Phoenix's Avatar
 
Join Date: Mar 2007
Posts: 2,208

Submissions (10)

Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)Flame_Phoenix has a spectacular aura about (90)

Send a message via MSN to Flame_Phoenix
Default

Quote:
Who wants to play a list of music!?
I want =)
And I don't need imported music to make it nice. My map has a list of 4 musics that are rarely heard:
- Wc3 Tauren Rock
- Wc2 music theme
- can't remember the other 2 ones xD

They are all in game, but few people know them, which is why I use them =D
Thus, I believe this would be a valuable addition.
__________________
Check out my tutorials at:
1-Creating a Hero Tavern
2-Complete Icon Tutorial - ALL about Icons
3-Making a spell in vJass - Practice Session 1
Check out all my current spells at here
Finally, check my project:
Castle vs Castle Flame Edition
Flame_Phoenix is offline   Reply With Quote
Old 10-17-2009, 03:07 AM   #57
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

I am glad someone made this script, since it is extremely useful. It's been sitting here idle in this thread for a while, though, and I think it's time to get it approved.

Here are a list of my issues with it, as someone who wants to use the script:
  • It doesn't look like it'll work correctly with looping sounds. Needs a ReleaseSound() function.
  • It should be possible to avoid running a 0.001 sec timer every time the sound plays; it is only necessary if it's played at the same time as it was created.
  • I would prefer for DefineSound to return a "Sound" rather than an integer, this makes it easier to keep track of if you can write: local Sound s = DefineSound(...)
  • DefineSound takes an assload of parameters, and several of them aren't normally needed. DefineSound could become DefineSoundEx, whereas DefineSound could be a function with fewer parameters that calls DefineSoundEx using some default parameters.
  • There needs to be a way to get a sound for editing without playing it, something like GetSound().
  • It would be nice to have a RunSoundOnUnit function.
  • Are you sure everything works fine when used in GetLocalPlayer() blocks?
grim001 is offline   Reply With Quote
Old 10-17-2009, 02:44 PM   #58
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by grim001
It doesn't look like it'll work correctly with looping sounds. Needs a ReleaseSound() function.
Agreed. It was an oversight that I'll fix.
Quote:
Originally Posted by grim001
It should be possible to avoid running a 0.001 sec timer every time the sound plays; it is only necessary if it's played at the same time as it was created.
That's a good point. I'll do that too. (Or at least test and see if it works)
Quote:
Originally Posted by grim001
I would prefer for DefineSound to return a "Sound" rather than an integer, this makes it easier to keep track of if you can write: local Sound s = DefineSound(...)
Whoa, whoa, wait. I mean, that kind of kills the idea of defining a sound at all. You define a sound so that later on, you just call RunSound on the integer and it runs a new instance of that sound. (Which in itself is a sound variable) Thus, the soundRef that DefineSound returns is actually more like a SoundType variable. If I make DefineSound return a sound, it'd completely change the functionality of the script (and be a heck of a lot less useful to me). I specifically made it this way because it saves sooo much development time in my map that needs it.
Quote:
Originally Posted by grim001
DefineSound takes an assload of parameters, and several of them aren't normally needed. DefineSound could become DefineSoundEx, whereas DefineSound could be a function with fewer parameters that calls DefineSoundEx using some default parameters.
I agree with you, I'm just kind of dreading having to go through my map and changing it everywhere. xD
Quote:
Originally Posted by grim001
There needs to be a way to get a sound for editing without playing it, something like GetSound().
Why? There is nothing you could do to it that would be useful at all. The only thing you do with sounds should be playing them. If you need to change any values in the sound, you can do it immediately after it has been played and it all works fine.
Quote:
Originally Posted by grim001
It would be nice to have a RunSoundOnUnit function.
Wouldn't you just, say, use RunSound in a scope initializer or something like that?
Quote:
Originally Posted by grim001
Are you sure everything works fine when used in GetLocalPlayer() blocks?
I haven't really tested it because I don't need local sounds in my map, but I suspect there might be some issues... It'd probably desync the sound stack, now that I think about it. Not really sure what to do about that, though, I will probably have to introduce a RunSoundForPlayer or something function that does things a little differently. Might have to always create sounds dynamically in that case. (And then only handle them in the local block, of course)
__________________
Rising_Dusk is offline   Reply With Quote
Old 10-17-2009, 08:47 PM   #59
grim001
requires vJass
 
grim001's Avatar


Code Moderator
 
Join Date: Nov 2006
Posts: 1,540

Submissions (10)

grim001 is just really nice (277)grim001 is just really nice (277)

Send a message via AIM to grim001
Default

Quote:
Originally Posted by Rising_Dusk
Whoa, whoa, wait. I mean, that kind of kills the idea of defining a sound at all. You define a sound so that later on, you just call RunSound on the integer and it runs a new instance of that sound.
I don't mean returning a native sound, I mean "Sound" like a struct name. It's just a cosmetic thing that would allow you to label it as a "Sound" or "SoundType" or "SoundDef" instead of an integer. But if you don't want to do that, it doesn't really matter.

Quote:
Originally Posted by Rising_Dusk
Why? There is nothing you could do to it that would be useful at all. The only thing you do with sounds should be playing them.
Now that I think about it, it wouldn't really make sense to pass it an integer and retrieve a sound unless that sound was currently playing, since it only decides which sound to play at the moment it starts playing...

Quote:
Originally Posted by Rising_Dusk
Wouldn't you just, say, use RunSound in a scope initializer or something like that?
The majority of sounds get played on units. It's just more intuitive to type RunSoundOnUnit(Sound, SomeUnit) than AttachSoundToUnit(RunSound(Sound), SomeUnit). It would basically be a wrapper function, but I think it's handy, and it would inline.

Quote:
Originally Posted by Rising_Dusk
I haven't really tested it because I don't need local sounds in my map, but I suspect there might be some issues... It'd probably desync the sound stack, now that I think about it. Not really sure what to do about that
You could actually just turn the volume to 0 for all other players using a wrapper function, I bet.

Last edited by grim001 : 10-17-2009 at 08:48 PM.
grim001 is offline   Reply With Quote
Old 10-17-2009, 08:55 PM   #60
Rising_Dusk
Obscurity, the Art


Projects Director
Project Leader: OD
 
Join Date: Feb 2006
Posts: 9,729

Submissions (27)

Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)Rising_Dusk has a reputation beyond repute (1192)

Hero Contest #3 - 1st PlaceApproved Map: Desert of ExileApproved Map: Advent of the ZenithHero Contest #2 - 1st PlaceHero Contest - Third place>

Send a message via AIM to Rising_Dusk Send a message via MSN to Rising_Dusk
Default

Quote:
Originally Posted by grim001
I don't mean returning a native sound, I mean "Sound" like a struct name. It's just a cosmetic thing that would allow you to label it as a "Sound" or "SoundType" or "SoundDef" instead of an integer. But if you don't want to do that, it doesn't really matter.
Ohh, I see. Hrm, yes, I suppose I could make the struct not private and let the user define it as they want to. I like the usage of integers mostly because it coincides with what Blizzard does with their VARIABLE_TYPE globals. I'm all about emulating Blizzard whenever possible (with less fail, of course) so it's easier for people to follow.
Quote:
Originally Posted by grim001
The majority of sounds get played on units. It's just more intuitive to type RunSoundOnUnit(Sound, SomeUnit) than AttachSoundToUnit(RunSound(Sound), SomeUnit). It would basically be a wrapper function, but I think it's handy, and it would inline.
Yeah I'll definitely add the RunSoundOnUnit function, no worries about that. What I was saying was about your asking for RunSoundOnInit, though. Apparently I misread and thought your Unit was Init. :p
Quote:
Originally Posted by grim001
You could actually just turn the volume to 0 for all other players using a wrapper function, I bet.
That's actually a really good idea and would totally work.

EDIT:
I did all the fixes, but I want to test the library a bit to make sure it does all that it is supposed to do before updating the first post.
__________________

Last edited by Rising_Dusk : 10-18-2009 at 03:39 AM.
Rising_Dusk is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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


All times are GMT. The time now is 12:49 PM.


Affiliates
The Hubb The JASS Vault Clan WEnW Campaign Creations Clan CBS GamesModding Flixreel Videos

Powered by vBulletin (Copyright ©2000 - 2018, Jelsoft Enterprises Ltd).
Hosted by www.OICcam.com
IT Support and Services provided by Executive IT Services