Renegade Public Forums
C&C: Renegade --> Dying since 2003™, resurrected in 2024!
Home » Renegade Discussions » Mod Forum » Commands->Monitor_Sound
Commands->Monitor_Sound [message #470434] Sun, 01 July 2012 12:13 Go to next message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
Well title n stuff explains it. Would be cool if TT would fix it making it work in SSGM/Multiplay? Dunno if this is the right place to put this topic. So this would actually be sent to the object: CUSTOM_EVENT_SOUND_ENDED.

I assume this is the right way to do it:

int SoundID = Commands->Create_2D_WAV_Sound("grunt_grunt.wav");
Commands->Monitor_Sound(obj, SoundID);
(obj = script owner)

and then in Custom event do something on CUSTOM_EVENT_SOUND_ENDED.

But it doesnt seem to trigger the Custom nor the Action_Complete any time.


Also Known As: Neijwiert
Re: Commands->Monitor_Sound [message #470642 is a reply to message #470434] Tue, 03 July 2012 10:36 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3813
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
It might not work with WAV, try it with a preset instead, if that doesn't work then I'm unsure if it works at all.

Re: Commands->Monitor_Sound [message #470650 is a reply to message #470434] Tue, 03 July 2012 12:52 Go to previous messageGo to next message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
Did try presets too, didnt work. Doesn't seem to work at all but it has been added to TODO for tt team to investigate Smile

Also Known As: Neijwiert
Re: Commands->Monitor_Sound [message #470651 is a reply to message #470650] Tue, 03 July 2012 13:36 Go to previous messageGo to next message
Jerad2142 is currently offline  Jerad2142
Messages: 3813
Registered: July 2006
Location: USA
Karma: 6
General (3 Stars)
It'll probably turn out that create_sound actually returns an sound object or something.

Re: Commands->Monitor_Sound [message #470654 is a reply to message #470434] Tue, 03 July 2012 13:51 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
I'm sure I've used that function before... if i think on sometime I will check how I set it up to work....

http://steamsignature.com/card/1/76561197975867233.png
Re: Commands->Monitor_Sound [message #470734 is a reply to message #470434] Wed, 04 July 2012 13:54 Go to previous messageGo to next message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
Then the big question remains why do all the commands that create a certain sound return an int?

Also Known As: Neijwiert
Re: Commands->Monitor_Sound [message #470737 is a reply to message #470734] Wed, 04 July 2012 14:01 Go to previous messageGo to next message
Ethenal is currently offline  Ethenal
Messages: 2532
Registered: January 2007
Location: US of A
Karma: 0
General (2 Stars)

Troll King wrote on Wed, 04 July 2012 15:54

Then the big question remains why do all the commands that create a certain sound return an int?

That is a good question, and probably has something to do with what you seek (Monitor_Sound). I would presume if it's an int, it could be some sort of id for that particular sound (maybe per actual sound object, and not per possible sound that can be played).


-TLS-DJ-EYE-K wrote on Mon, 18 March 2013 07:29

Instead of showing us that u aren't more inteligent than a Toast, maybe you should start becomming good in renegade Thumbs Up

Re: Commands->Monitor_Sound [message #470738 is a reply to message #470434] Wed, 04 July 2012 14:05 Go to previous messageGo to next message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
Hehe to report to you I'm CERTAIN that it needs an ID becouse I'm currently decompiling several Westwood scripts and they use the Commands->Monitor_Sound aswell. they take that int that comes from creating the sound. Then they wait for the custom CUSTOM_EVENT_SOUND_ENDED. but that does not appear to work in mp

Also Known As: Neijwiert
Re: Commands->Monitor_Sound [message #470746 is a reply to message #470434] Wed, 04 July 2012 17:27 Go to previous messageGo to next message
jonwil is currently offline  jonwil
Messages: 3557
Registered: February 2003
Karma: 0
General (3 Stars)

The value you pass to Monitor_Sound needs to be a value returned from a command like Create_Sound or Create_2D_Sound.

CUSTOM_EVENT_SOUND_ENDED is definatly the right way to listen for it. Note that if the sound loops, you do NOT get the message.


Jonathan Wilson aka Jonwil
Creator and Lead Coder of the Custom scripts.dll
Renegade Engine Guru
Creator and Lead Coder of TT.DLL
Official member of Tiberian Technologies
Re: Commands->Monitor_Sound [message #470758 is a reply to message #470434] Thu, 05 July 2012 00:07 Go to previous messageGo to next message
iRANian is currently offline  iRANian
Messages: 4308
Registered: April 2011
Karma: 0
General (4 Stars)
See the JFW_BuildingStateSpeaker script for an example.

Long time and well respected Renegade community member, programmer, modder and tester.

Scripts 4.0 private beta tester since May 2011.

My Renegade server plugins releases
Re: Commands->Monitor_Sound [message #470763 is a reply to message #470434] Thu, 05 July 2012 03:19 Go to previous messageGo to next message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
Like I said I did all of the above, non-looping and it just will not send ANY custom.

EDIT: I completly decompiled M00_BuildSound_Controller, does not work the way it should.

EDIT2: Why doesn't "grunt_grunt.wav" work then? Or however that .wav was called. It isn't a looping sound.


Also Known As: Neijwiert

[Updated on: Thu, 05 July 2012 03:21]

Report message to a moderator

Re: Commands->Monitor_Sound [message #470765 is a reply to message #470434] Thu, 05 July 2012 04:29 Go to previous messageGo to next message
danpaul88 is currently offline  danpaul88
Messages: 5795
Registered: June 2004
Location: England
Karma: 0
General (5 Stars)
Have you tried using actual sound presets instead of WAV files?

http://steamsignature.com/card/1/76561197975867233.png
Re: Commands->Monitor_Sound [message #470774 is a reply to message #470434] Thu, 05 July 2012 09:14 Go to previous message
Troll King is currently offline  Troll King
Messages: 56
Registered: June 2012
Location: Netherlands
Karma: 0
Recruit
Quote:

Did try presets too, didnt work. Doesn't seem to work at all but it has been added to TODO for tt team to investigate Smile


Also Known As: Neijwiert
Previous Topic: crypt
Next Topic: How can I loop over all weapon definitions?
Goto Forum:
  


Current Time: Mon Dec 23 15:08:15 MST 2024

Total time taken to generate the page: 0.01304 seconds