Send Recources from server to client?

I know how to send lua files, but how can i send models, sound files, materials to them? Also when sending scripts do i need to include only shared or i have to include all the init and cl_init as well?


Thanks… And since i dont want to make another thread and its kinda in the same type of question… I have another short questions:
When your use **Resource.AddFile**on and mdl i know it adds all the other files such as .dx90.vtx, .sw.vtx, .phy, etc… but does it also add the materials/models files that are associated with the model? Or do i have to add them manually?

no. you should also have to add those manually as well.

And here. I came across this about a half an hour ago:


For convenience, this function will automatically add any other files that are related to the selected one, and throw an error if it can’t find them. For example, a .vmt file will automatically add the .vtf with the same name, and a .mdl file will automatically add all .vvd, .ani, .dx80.vtx, .dx90.vtx, .sw.vtx, .phy and .jpg files with the same name, with a separate error for each missing file. If you do not want it to do this, use resource.AddSingleFile.

From the wiki

He was asking if he needs to include the textures, which he does. The stuff you just posted from the wiki he already knew. It is also irrelavant to his question.

All of those extensions are part of the Model, and not part of textures
Models are in a whole different directory and are not paired up with their textures which happens to be in the Textures folder.

So in his case if he was adding soandso.mdl, it would link the dx80.vtx, dx90.vtx, .phy and the vvd’s all with the same name. It does not go and add the material that is normall used with that model. Reason being is that textures are shared and are not specific to any given model, even if they were intended to. Therefore he needs to add soandso.vtf and it will grab the linked .vmt with it so that way he can set the material of soandso.mdl to soandso.vtf.

Oh yeah :stuck_out_tongue: