AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Server side player models. (https://forums.alliedmods.net/showthread.php?t=226300)

Remy Lebeau 09-16-2013 04:05

Server side player models.
 
I'm mucking around a bit trying to setup custom (server side) player models.

I'm running into a problem at the very first hurdler. My setup is very simply:

I have a local LAN server setup to test on, I'm installing models from s-low.net directly onto the server (eg, cstrike/models/player and cstrike/materials/models/player), and then coding a basic plugin to change people's models when they join.

If I then manually install the models on my client computer, it works fine.

If I don't manually install the models, I get a big red error sign instead of the model, and on checking, the model is NOT being downloaded from the server to the client. I don't really know what is going on! Is there a command that tells the client to download content? I've checked my client settings, and it is set to download all content from server... I don't have anything like a highspeed download server setup, so I assume that should mean stuff gets downloaded directly...

Anyone have any ideas? I'm stumped!

andi67 09-16-2013 04:17

Re: Server side player models.
 
Check your paths you have setup for the models.....

Remy Lebeau 09-16-2013 04:28

Re: Server side player models.
 
Can you be more specific? As I said: if I manually install the models on both server and client, then it works fine.

The problem is that the client is not downloading the models from the server if they are not present...

edit: here is an example

C:\srcds\css\cstrike\models\player\slow\jamis \mkvsdcu\batman\slow_pub_v2.mdl
C:\srcds\css\cstrike\models\player\slow\jamis \mkvsdcu\batman\slow_pub_v2.dx80.vtx
C:\srcds\css\cstrike\models\player\slow\jamis \mkvsdcu\batman\slow_pub_v2.dx90.vtx
C:\srcds\css\cstrike\models\player\slow\jamis \mkvsdcu\batman\slow_pub_v2.phy
C:\srcds\css\cstrike\models\player\slow\jamis \mkvsdcu\batman\slow_pub_v2.sw.vtx
C:\srcds\css\cstrike\models\player\slow\jamis \mkvsdcu\batman\slow_pub_v2.vvd

I also have materials files in
C:\srcds\css\cstrike\materials\models\player\ slow\jamis\mkvsdcu\batman

I then use the code:
Code:

public OnMapStart()
{
    PrecacheModel("models/player/slow/jamis/mkvsdcu/batman/slow_pub_v2.mdl", true);
}


public OnWar3EventSpawn( client )
{
    SetEntityModel(client, "models/player/slow/jamis/mkvsdcu/batman/slow_pub_v2.mdl");
}

All I see are giant error signs! However, if I use a model that I KNOW I already have on my client computer, it works fine.

rswallen 09-16-2013 04:58

Re: Server side player models.
 
PrecacheModel() only tells the client/server to load the file into memory.
In order to force clients to download missing models/materials/etc, you need to use AddFileToDownloadsTable()

Remy Lebeau 09-16-2013 05:16

Re: Server side player models.
 
Quote:

Originally Posted by rswallen (Post 2035558)
PrecacheModel() only tells the client/server to load the file into memory.
In order to force clients to download missing models/materials/etc, you need to use AddFileToDownloadsTable()

That looks promising! Do I need a separate entry for each file in the model / material folders for a particular model?

rswallen 09-16-2013 05:26

Re: Server side player models.
 
Quote:

Originally Posted by Remy Lebeau (Post 2035564)
That looks promising! Do I need a separate entry for each file in the model / material folders for a particular model?

Yeah, one for each file involved in rendering a particular model

Remy Lebeau 09-16-2013 05:26

Re: Server side player models.
 
Also - do I need something similar for custom maps? Or do they get downloaded automatically?

Thanks so much for that help, I was starting to go bananas!

Now to learn how to get a fast d/l server setup :D

xf117 09-16-2013 05:36

Re: Server side player models.
 
You don't need that for custom maps.

Remy Lebeau 09-16-2013 05:45

Re: Server side player models.
 
You guys rock my world.

Since you're being so awesome - do you know of a way I can test whether files are being downloaded from my game server or from my high speed server?

xf117 09-16-2013 05:59

Re: Server side player models.
 
I guess you can put archived files in fast dl (bz2). And look for a file name of a file you download.
Or try a really big file. Server has a restriction on file size if you download it directly.


All times are GMT -4. The time now is 08:52.

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