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 > Warcraft III Modding > Developer's Corner > Triggers & Scripts
User Name
Password
Register Rules Get Hosted! Chat Pastebin FAQ and Rules Members List Calendar



Reply
 
Thread Tools Search this Thread
Old 12-06-2008, 12:27 PM   #1
marshall
User
 
Join Date: Aug 2003
Posts: 104

marshall has little to show at this moment (1)

Question Playing interface announcements (e.g. "Inventory is full")

I have a spell that creates an item in the unit's inventory.
If the inventory is already full, I presently just display some text saying "inventory is full".
What I would like to do is have the normal announcement message and sound play, as if the user had right-clicked on an item on the ground.

I tried issuing a smart order to the unit to pick up a dummy item - this doesn't achieve anything.

I searched for the various interface sounds in the Sound manager so that I could try and do it all manually but these sounds do not appear to be listed.

Any ideas how this can be achieved?
marshall is offline   Reply With Quote
Sponsored Links - Login to hide this ad!
Old 12-06-2008, 12:32 PM   #2
abriko
User
 
abriko's Avatar
 
Join Date: Nov 2002
Posts: 684

Submissions (22)

abriko is a jewel in the rough (159)abriko is a jewel in the rough (159)

Default

The sound is listed :
Human sound : Sounds\Interface\Warning\Human\KnightInventoryFull1.wav
... the others are just below.
__________________
abriko is offline   Reply With Quote
Old 12-06-2008, 12:55 PM   #3
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

http://www.wc3campaigns.net/showthread.php?t=101260
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 12-06-2008, 01:53 PM   #4
marshall
User
 
Join Date: Aug 2003
Posts: 104

marshall has little to show at this moment (1)

Default

Thanks guys. The text shows up great. The only trouble I'm having now is that I can't get the sound to play:

Collapse JASS:
function SimError takes player ForPlayer, string msg, sound error returns nothing
    set msg="\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n|cffffcc00"+msg+"|r"
    if (udg_GameLocalPlayer == ForPlayer) then
        call ClearTextMessages()
        call DisplayTimedTextToPlayer(ForPlayer, 0.51, 0.96, 2.00, msg)
        call StartSound(error)
    endif
    set ForPlayer = null
endfunction

function Trig_InitSounds_Actions takes nothing returns nothing
    call DestroyTrigger(GetTriggeringTrigger())
    set udg_SoundInventoryFull[udg__TEAM_GOOD] = CreateSound("Sound\\Interface\\Warning\\NightElf\\SentinelInventoryFull1.wav",false,false,false,10,10, null)
endfunction

call SimError(GetOwningPlayer(uCaster), "Inventory is full.", udg_SoundInventoryFull[udg__TEAM_GOOD])

Any thoughts on what I've got wrong?
marshall is offline   Reply With Quote
Old 12-06-2008, 05:31 PM   #5
Vexorian
Free Software Terrorist
 
Vexorian's Avatar


Technical Director
 
Join Date: Apr 2003
Posts: 14,898

Submissions (37)

Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)Vexorian has a reputation beyond repute (1062)

Hero Contest #3 - 2nd Place

Default

wow why did you change SimError like that? It was already working fine without the extra complication.
__________________
Zoom (requires log in)Wc3 map optimizer 5.0
Someone should fix .wav sound in this thing.
Zoom (requires log in)JassHelper 0.A.2.A
Turns your simple code into something that is complicated enough to work.
Faster != more useful
Vexorian is offline   Reply With Quote
Old 12-06-2008, 07:05 PM   #6
marshall
User
 
Join Date: Aug 2003
Posts: 104

marshall has little to show at this moment (1)

Default

Not sure I understand. The globals/library stuff is something to do with JassHelper I believe, which I haven't even started looking at yet. I wanted something simple and the ability to choose a different sound depending on what called SimError. The only other changes were to do with leaks (at least, my understanding is that simply comparing GetLocalPlayer() to a player var would leak - perhaps I'm wrong about that).

It works fine if I use CreateSoundFromLabel("InterfaceError"...) but not if I use CreateSound("[path]"...)
That suggests that there's something wrong with my use of CreateSound but I can't figure out what it is.

Last edited by marshall : 12-06-2008 at 07:07 PM.
marshall is offline   Reply With Quote
Old 12-06-2008, 10:15 PM   #7
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

Just use SimError and don't modify it. The sound it uses should be fine, unless there's something radically different about the full inventory sound...?

And player variables don't leak because they're global objects.
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 12-07-2008, 01:03 PM   #8
marshall
User
 
Join Date: Aug 2003
Posts: 104

marshall has little to show at this moment (1)

Default

I want to hear "Inventory is full", not an error bleep. The original SimError doesn't allow you to choose a different sound.

I need to know why my use of CreateSound is not working.

I know that player objects don't leak, but surely the variables themselves do?
marshall is offline   Reply With Quote
Old 12-07-2008, 11:45 PM   #9
cleeezzz
User
 
Join Date: Apr 2008
Posts: 45

cleeezzz has little to show at this moment (0)

Default

udg_SoundInventoryFull[udg__TEAM_GOOD]

what did you set that to
cleeezzz is offline   Reply With Quote
Old 12-08-2008, 05:02 PM   #10
marshall
User
 
Join Date: Aug 2003
Posts: 104

marshall has little to show at this moment (1)

Default

Quote:
Originally Posted by marshall
Collapse JASS:
set udg_SoundInventoryFull[udg__TEAM_GOOD] = CreateSound("Sound\\Interface\\Warning\\NightElf\\SentinelInventoryFull1.wav",false,false,false,10,10, null)
and udg__TEAM_GOOD is 1.

I've searched around for values for the final parameter 'eaxSetting' but nothing I try works. No idea if that is the problem or not?

Last edited by marshall : 12-08-2008 at 05:03 PM.
marshall is offline   Reply With Quote
Old 12-13-2008, 08:17 PM   #11
marshall
User
 
Join Date: Aug 2003
Posts: 104

marshall has little to show at this moment (1)

Default

So nobody knows how to use CreateSound() ?
marshall is offline   Reply With Quote
Old 12-14-2008, 04:00 AM   #12
Pyrogasm
Lackadaisically Absent.
 
Pyrogasm's Avatar


Respected User
 
Join Date: Sep 2006
Posts: 4,523

Submissions (9)

Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)Pyrogasm is a splendid one to behold (638)

Hero Contest - Fourth place

Send a message via ICQ to Pyrogasm Send a message via AIM to Pyrogasm Send a message via MSN to Pyrogasm Send a message via Yahoo to Pyrogasm
Default

I've only ever copied the CreateSoundFromLabel() lines that you can find if you save your map with some sound used, then open it with an MPQ editor and extract war3map.j
__________________
Quote:
Originally posted by Rising_Dusk
Your spells are mostly ignored because they are not very cool so we aren't very excited to review/approve them, but you are incredibly persistent and won't give us an excuse to graveyard it. That is generally what results in a resource being ignored for a long time.

The Spell Request Thread Done for, unless someone else wants to revive it...
It lasted a damn long time.

Please; Ask for Help Appropriately














Quote:
Originally posted by Kyrbi0
Huh. Almost makes me wish I had a girlfriend, to take advantage of today (wait, no, that's not what I meant... I mean, take advantage of the fact that it is international women's day... gah, never mind).
Quote:
Originally posted by Pyrogasm
Rome may not have been built in a day, but the Romans sure as hell didn't say "look at this great city we built guys!" when they had nothing more than a bit of stone and some cottages.
Pyrogasm is offline   Reply With Quote
Old 12-14-2008, 04:06 AM   #13
Ammorth
I blink, therefore I am.
 
Ammorth's Avatar
 
Join Date: Sep 2006
Posts: 1,812

Submissions (10)

Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)Ammorth is a glorious beacon of light (461)

Default

set SoundHandleVariable = CreateSound(YourPath, false, false, true, 200, 200, "")
These are the arguments used for interface sounds (taken from blizzard.j)
__________________
Ammorth is offline   Reply With Quote
Old 12-14-2008, 10:46 PM   #14
marshall
User
 
Join Date: Aug 2003
Posts: 104

marshall has little to show at this moment (1)

Default

Thanks guys, I'm doing it Pyrogasm's way and can now see why my earlier attempt wasn't working.
marshall 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 01:31 PM.


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

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