Raised This Month: $51 Target: $400
 12% 

SM File/Folder Downloader and Precacher


Post New Thread Reply   
 
Thread Tools Display Modes
SWAT_88
SourceMod Donor
Join Date: Jan 2008
Location: Austria
Old 03-13-2010 , 07:55   Re: SM File/Folder Downloader and Precacher
Reply With Quote #161

Quote:
Originally Posted by OtterNas3 View Post
L4D/L4D2

First i wanna say, thanks for sharing the plugin!

Soundfiles get only precached with the "snd_rebuildaudiocache" command, so all clients have to do it to hear sounds, right?
At least that is what i guess after all testing.

First time i was able to hear the sound was after snd_rebuildaudiocache on my client.

Download Mechanism does work nicely btw ^^

Moo,
OtterNas3
I never used sound files, but I don't think you need this command.
For instance saysounds uses sound files without that command.
In my opinion, it would be suffice to put the sound file in the precache section.
__________________

Last edited by SWAT_88; 03-13-2010 at 07:58.
SWAT_88 is offline
OtterNas3
Senior Member
Join Date: Apr 2009
Old 03-14-2010 , 01:40   Re: SM File/Folder Downloader and Precacher
Reply With Quote #162

Hmm i cant get it to work...



Pre done things to cleanup:

Deleted _master_cache on Client, removed custom downloaded soundfiles and build new _master_cache with "snd_rebuildaudiocache"

Download fresh Server trough hldsupdatetool and installed Metamod/Sourcemod

Server running fine, admin status granted!

Server settings:
sv_pure 0, sv_consistency 0


1. Copy sm_downloader.smx to sourcemod/plugins/
2. Copy downloads.ini to sourcemod/configs/

downloads.ini
Code:
//Don't modify or remove the Comment Lines ( // )
//Files (Download Only No Precache)

//Decal Files (Download and Precache)

//Sound Files (Download and Precache)
sound/misc/noob6vs6

//Model Files (Download and Precache)
So the Folder get downloaded with 3 .wav files in it.

3. Copy content to download on webspace and edit server.cfg
sv_downloadurl shows to the correct address!
(Same content on Server folders)

4. Connect to Gameserver (Client has none of these files installed yet)

Blackscreen for like 10-15 secs (Thats the mooment where the download is in progress)

Ingame!

5. Alt+Tab to check if files get downloaded, they do!

6. Use ingame command
"sm_play @me misc/noob6vs6/cu.wav"

Message shows me "Sound played for ...."

And i hear nothing :/

Tested this again with .mp3 files because i read somewhere that mp3 files dont need to be cached, still the same, no sound played!

Also after exit game to dekstop, load game, connect again to server, i can't hear any of the sounds downloaded...

[EDIT]
When i do "snd_rebuildaudiocache" i hear the sounds after new connect.
[/EDIT]

Any ideas?

Cheers,
OtterNas3



[EDIT2]
Ideas:

a) Maybe there is some way of import just new files in the precaching file, with another command for rebuild?


b) Server could send the "snd_rebuildaudiocache" command to connecting player who download a new file for first time.
notes:
That would just annoy the Players a bit.
First black screen on download, then i dunno what it shows when doing the rebuild and it will take too long to do the rebuild...


c) echo code into the "maps/soundcache/_master.cache" file?
notes:
Maybe that way the client just has to reconnect or wait for next map?
I think the file get invalid due to checks?
Write a own cache file like "maps/soundcache/_CUSTOMTITLE.cache" and and use that in game somehow?


d) Some way of overwriting files on download, so you would be able to overwrite that useless "sound/commentary/*" files with custom stuff?


e) What about these "scripts/game_sound_*.txt" files?
notes:
Are they just to configure what is when how played?


That's it for now ^^
[/EDIT2]

Last edited by OtterNas3; 03-17-2010 at 14:24.
OtterNas3 is offline
SWAT_88
SourceMod Donor
Join Date: Jan 2008
Location: Austria
Old 03-17-2010 , 18:43   Re: SM File/Folder Downloader and Precacher
Reply With Quote #163

I looked at the sourcecode of saysounds.
I have noticed that this plugin uses the same commands as my plugin do.
That means: PrecacheSound and AddFileToDownloadsTable.

a.) I don't know any other command. As said above, the precache command should work.
b.) You cannot send any commands to the player. This is prohibited for security reasons. Maybe this command is supported, we can try it.
c.) I never created cache files, therefore I have no clue about it.
d.) AFAIK there is no way to overwrite files with a plugin.
e.) Never used these files ...

My conclusion:
Saysounds uses the same commands as my plugin do, but saysounds doesn't emit sound via sm_play. It uses EmitSoundToClient(SM Function) ...
Maybe this is the problem, I can look up the function sm_play uses in its plugin.

Edit:
sm_play uses playgamesound on the client console.
__________________

Last edited by SWAT_88; 03-17-2010 at 18:49.
SWAT_88 is offline
OtterNas3
Senior Member
Join Date: Apr 2009
Old 03-18-2010 , 06:14   Re: SM File/Folder Downloader and Precacher
Reply With Quote #164

Tested it with saysounds and L4D.
Same test setup like last one.

Still no luck :/

Download files to client, play command without error, anything works nice, but sound not hearable...

snd_rebuildaudiocache after download and next connect it plays fine!

a) Searched long time now, there is no other command for precaching stuff :/

b) You can send commands to players with a plugin! But still the problem of annoying players.
Because of rebuild is build from 0 everytime you run command, it takes up to some minutes on slow machines :/
And you have to make sure to check for files and when all there NOT send command to client again...

c) No possibility to append the hex code segment for soundfiles into the cache file?
You could do a local rebuild on default sounds, save the master cache, insert your custom sounds, make rebuild and then diff the changes (mostly the last lines in the file)
It seems the game reads cache file again on every map change?

d) I thought so :/

e) Looked at them a bit more now.
Files are just for the event scripting, has nothing to do with caching...

Seems it is not that easy to get custom sounds running in L4D/L4D2 :/

Maybe we need a MetaMod plugin for it...

Moo,
OtterNas3
OtterNas3 is offline
Samanosuke3k
New Member
Join Date: Mar 2010
Old 03-18-2010 , 07:48   Re: SM File/Folder Downloader and Precacher
Reply With Quote #165

... Why nobody donate to SWAT??

This is madness!!
Samanosuke3k is offline
SWAT_88
SourceMod Donor
Join Date: Jan 2008
Location: Austria
Old 03-18-2010 , 16:34   Re: SM File/Folder Downloader and Precacher
Reply With Quote #166

Quote:
Originally Posted by Samanosuke3k View Post
... Why nobody donate to SWAT??

This is madness!!
This is a really good idea
Thank you for your donation Samanosuke3k
You're the first person who has donated.
By the way: Welcome to our community.

@OtterNas3:
Does saysounds works on l4d?
__________________

Last edited by SWAT_88; 03-18-2010 at 16:38.
SWAT_88 is offline
OtterNas3
Senior Member
Join Date: Apr 2009
Old 03-19-2010 , 12:14   Re: SM File/Folder Downloader and Precacher
Reply With Quote #167

@swat88

I used this one here http://forums.alliedmods.net/showthread.php?t=82220 and it does work, but also you cant hear the sounds until you did a "snd_rebuildaudiocache" on client machine

Maybe i will donate if we can find a way to get this working ^^

Moo,
OtterNas3
OtterNas3 is offline
eradeejay
Junior Member
Join Date: Mar 2010
Old 03-19-2010 , 13:04   Re: SM File/Folder Downloader and Precacher
Reply With Quote #168

This is because L4D/L4D2 donīt have good support for custom content.
We are waiting a fix since L4D sdk release (one year) and for some reason Valve don`t want to fix the damn game.
We're screwed with mods.
The only way to fix the custom sound is with snd_rebuildaudiocache or you can pass your prepared cache file to the client in .rar or .zip but the client have to uncompress manually (is more faster than rebuild)
eradeejay is offline
SWAT_88
SourceMod Donor
Join Date: Jan 2008
Location: Austria
Old 03-19-2010 , 14:04   Re: SM File/Folder Downloader and Precacher
Reply With Quote #169

Quote:
Originally Posted by eradeejay View Post
This is because L4D/L4D2 donīt have good support for custom content.
We are waiting a fix since L4D sdk release (one year) and for some reason Valve don`t want to fix the damn game.
We're screwed with mods.
The only way to fix the custom sound is with snd_rebuildaudiocache or you can pass your prepared cache file to the client in .rar or .zip but the client have to uncompress manually (is more faster than rebuild)
Thank you for clarifying this question.
Nice suggestion to send the cache-file.
__________________
SWAT_88 is offline
OtterNas3
Senior Member
Join Date: Apr 2009
Old 03-24-2010 , 14:54   Re: SM File/Folder Downloader and Precacher
Reply With Quote #170

The question was already cleared...
Support for custom content isn't that bad!
Only problem is the sound caching what is really annoying for any modder or Server hoster!


Best suggestion would be make downloads with this tool and do a advertise like:

"This Server has custom sounds installed! \n To use/hear the sounds you have to do 'snd_rebuildaudiocache'"


Or:
When client downloaded files (have to check if he really downloaded new files or already had them) we show a menu on connect


Code:
!New soundfiles downloaded!
!Rebuild can take some minutes!

1: Do Soundcache rebuild
2: Do nothing (default)
Would that be possible?



Just my 2 cent
OtterNas3

Last edited by OtterNas3; 03-24-2010 at 15:09.
OtterNas3 is offline
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 -4. The time now is 20:44.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode