Ulysses

General => Developers Corner => Topic started by: emilhem on December 29, 2012, 01:25:27 PM

Title: [SOLVED] FastDL for an addon
Post by: emilhem on December 29, 2012, 01:25:27 PM
So I've been trying for sometime to make FastDL work.

This is what works:

This is what's not working:

So I basically made an addon that doesn't do anything but should send an audiofile to the client.

The addon have a lua file in garrysmod/addons/test/lua/autorun/test.lua that have this content:
Code: [Select]
if SERVER then
AddCSLuaFile("autorun/test.lua")
end
resource.AddFile("sound/file_test.mp3")

The audiofile is in garrysmod/addons/sound/file_test.mp3

Anyone got a solution for my problem?

EDIT:

I found a solution myself.

File attached is a addon that does nothing but downloads a sound file to the client.

Helpful links:
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/index5809.html
http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf8be.html
Title: Re: FastDL for an addon
Post by: nathan736 on December 29, 2012, 02:29:56 PM
gmod cant send  addon files to the client sorry you must move the files from the servers addon folder to the actual sound dir for it to function correctly  as adding any resource files  refers to sound model gamemode meteral or map  you cant  make clients download any addons as far as i know using fast dl
edit this is the solution that is easyer to read
Emilhem, what Nathan is trying to say but even I might misunderstand if I wasn't already educated as to the ways of addons folders being 'virtual' is highlighted in bold in our FAQ.
http://forums.ulyssesmod.net/index.php/topic,3072.0.html

Though the FAQ specifically mentions ULX's way of force downloads....the 'path' setup of lua addresource or our download.txt file is no different.
You just can't place 'addon' in the path and have it work.
Addon is a virtual path.
When nathan states unpack, it means you'd need to take
/addons/myaddon/sound/blah
/addons/myaddon/model/blah
from your game server and place
/sound/blah
/model/blah
on your FastDL server.
Title: Re: FastDL for an addon
Post by: emilhem on December 29, 2012, 02:50:31 PM
I don't think you read my topic. The title is misleading a bit maybe.

I just want the client to be able to download files such as sounds, models, materials, etc from a server addon. IE gamecontent for that addon.
Title: Re: FastDL for an addon
Post by: nathan736 on December 29, 2012, 03:26:20 PM
you would need to unpack the addon and move the  files onto the server for them to be added to the download correctly i read it fine  i think i was misunderstood
YOU CAN NOT ADD any files in the ADDON FOLDER useing  server to client download as far as i know or have ever bothered testing unless garry changed it
 Ps: why would you do it anyways
Title: Re: FastDL for an addon
Post by: JamminR on December 29, 2012, 04:37:45 PM
Emilhem, what Nathan is trying to say but even I might misunderstand if I wasn't already educated as to the ways of addons folders being 'virtual' is highlighted in bold in our FAQ.
http://forums.ulyssesmod.net/index.php/topic,3072.0.html

Though the FAQ specifically mentions ULX's way of force downloads....the 'path' setup of lua addresource or our download.txt file is no different.
You just can't place 'addon' in the path and have it work.
Addon is a virtual path.
When nathan states unpack, it means you'd need to take
/addons/myaddon/sound/blah
/addons/myaddon/model/blah
from your game server and place
/sound/blah
/model/blah
on your FastDL server.
Title: Re: FastDL for an addon
Post by: emilhem on December 30, 2012, 02:21:41 AM
I've done that already...

The fastdl already works for the addons that have it built in. Like some wiremod stuff. I want to make this one weaponpack's models (it's not a .GMA file! It's a legacy addon.) get sent to the client when he joins.

My fastdl link: http://gangnamstylegaming.com/fastdl/

Ps: why would you do it anyways
Because people doesn't want to run around with errors as weapons.  ::)
Title: Re: FastDL for an addon
Post by: nathan736 on December 30, 2012, 08:12:16 AM
emilhem you are going to need to do the following
1) shift all models and what not that  the addon uses to the normal dir
2)add resource files so fast dl will work
3) tell me when you got this all done

Ps: legacy addons are not much different from normal things you would add to a server

Pss: wire mod works in the addon folder because its assuming the users must have it for it to work.
Title: Re: FastDL for an addon
Post by: emilhem on December 30, 2012, 10:35:12 AM
This is what I did:
I added resource.AddFile( [filenamehere] ) for every single file I wanted to add. (Helpful link: http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf8be.html (http://maurits.tv/data/garrysmod/wiki/wiki.garrysmod.com/indexf8be.html))
The files such as model files, sound files, etc were already fixed on the fastdl server.

Now everything is working.

Updated topic title to solved.