Thread: Sending plugin-specific resources to players

Results 1 to 9 of 9
  1. #1
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,596

    Sending plugin-specific resources to players

    I made a few custom sounds for a server plugin, but these sounds aren't transferred to clients when they join. Is there some sort of server-wide or plugin-specific .res file where you can list resources like these?
    Love,
    w00tguy

  2. #2
    Registered User
    Join Date
    Jan 2016
    Posts
    23

    Re: Sending plugin-specific resources to players

    Try precaching it, not sure if possible with AS because there is no scripting reference yet (EDIT: just found out that there is, uploaded ~1 hour ago). Anyway, the prototype looks as such (taken from HLSDK):
    PHP Code:
    int            (*pfnPrecacheSound)            (const chars); 
    Takes only 1 argument, path to the sound file.
    Try g_EngineFuncs.PrecacheSound in PluginInit (possibly MapInit?). It should be relative to $moddir/sound folder.
    Last edited by KliPPy; 25-01-2016 at 03:00 PM.

  3. #3
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,596

    Re: Sending plugin-specific resources to players

    I should have mentioned I was already precaching the sounds in MapInit() using this function:

    g_SoundSystem.PrecacheSound(soundPath);

    Edit: I should also probably mention that I'm testing this on a LAN listen server.
    Last edited by w00tguy123; 25-01-2016 at 03:26 PM.
    Love,
    w00tguy

  4. #4
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: Sending plugin-specific resources to players

    You cannot force plugin resources to be downloaded to players. If and when we allow this, players will have the option not to allow it to prevent plugins from downloading loads of content.

  5. #5
    Registered User
    Join Date
    Jan 2016
    Posts
    23

    Re: Sending plugin-specific resources to players

    Quote Originally Posted by Solokiller View Post
    You cannot force plugin resources to be downloaded to players. If and when we allow this, players will have the option not to allow it to prevent plugins from downloading loads of content.
    What's the reason behind not allowing plugins to precache models and sounds? "to prevent plugins from downloading loads of content" doesn't seem reasonable if you ask me. There are other hackish ways of accomplishing it anyway. If someone doesn't want their server to have loads of models/sounds precached, they just won't install that plugin, simple as that.

  6. #6
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: Sending plugin-specific resources to players

    It's not up to the server operator to decide whether players should be downloading content unrelated to maps. That choice should be left up to the player.

  7. #7
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,596

    Re: Sending plugin-specific resources to players

    My first reaction is place these files in every map .res file on my server, but that would bypass that possible future option.

    If I posted a tool that does this automatically, would it be removed? I don't want to be a scumbag, but I'm sure others will want to use custom sounds/models/etc. like with metamod/AMX plugins.
    Love,
    w00tguy

  8. #8
    Banned Solokiller's Avatar
    Join Date
    Sep 2004
    Location
    Belgium
    Posts
    3,314

    Re: Sending plugin-specific resources to players

    We are considering making res files obsolete. The idea is that map precaches are always sent, plugin precaches are sent only if the player wants it. Right now, it only gets sent if the res file specifies it.

  9. #9
    func_vehicle enthusiaist w00tguy123's Avatar
    Join Date
    Dec 2006
    Location
    U.S. West
    Posts
    1,596

    Re: Sending plugin-specific resources to players

    Alright, that makes sense. I'll just modify the .res files for the time being.
    Love,
    w00tguy

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •