• Print

Author Topic: Not having to download playermodels when first joining a server  (Read 4594 times)

0 Members and 1 Guest are viewing this topic.

Offline Dharmvir Sidhu

  • Newbie
  • *
  • Posts: 18
  • Karma: 1
    • OMENS Gaming
Not having to download playermodels when first joining a server
« on: January 01, 2015, 12:19:53 am »
So we all know the feeling of joining a server for the first time, and having to wait for all the downloads to finish so we can play right? Well I want to cut that down on my server, and I know that a big portion of that is  just player models.

So what I want to do is I want the player who are connecting to still get all the addons, EXCEPT for all the playermodels. They can download the playermodels later by choice in game by using a command such as !workshop (code is at the bottom) which will take them to a steam collection and they are able to click subscribe to all. Otherwise, they could just not download the playermodels, otherwise having some players appear as bright red "errors".

I have seen this done on an old server I played on, so I attempted it for myself. I removed all of the playermodels from the workshop collection linked to the startup, and also from addons folder but still however keeping the playermodels in the pointshop, and then deleted all my addons and tried to join the server. I only downloaded the addons that were required and not the playermodels, so far so good. So I went into game, and someone appeared as an error, so i typed !workshop, subscribed, got all the models, then it was fine. HOWEVER, whenever a player with a custom playermodel died, their body would just disappear into thin air, hence you not being able to identify them, hence ruining the game.

From that, I tried to fix it by adding the playermodel folders back into my addons folder, but however now i would just be downloading the playermodels while starting up, so that may have fixed the body disspearing problem, but that did require me to download all the playermodels from the host itself making things even slower. So I next tried to keep only the lua folder of the playermodel folder that would contain the file called "modelname.lua" (example ironman.lua) while deleting the materials and models section of the playermodel folder, this did not require me to download the playermodel at the start, but the body would still dissapear at the end.

For anyone that does know how, could you please guide me on the right path? If this is too long of a process that you do not want to type out, feel free to pm me and ill send you my steam/skype.

Thanks in advance,
dharmvir

Code: Lua
  1. function workshopCommand( pl, text, teamonly )
  2.                     if (text == "!workshop") then
  3.                             pl:SendLua([[gui.OpenURL("http://steamcommunity.com/sharedfiles/filedetails/?id=366697947")]]) -- Change ADDRESS to your chosen page.
  4.                             for k, v in pairs(player.GetAll()) do v:ChatPrint( "Player " .. pl:Nick() .. " is looking at OMENS TTT Workshop" )
  5.  
  6.                 end
  7.         end
  8. end
  9. hook.Add( "PlayerSay", "Chat", workshopCommand )
  10.  
« Last Edit: January 01, 2015, 04:22:55 pm by Dharmvir Sidhu »

Offline Bytewave

  • Respected Community Member
  • Hero Member
  • *****
  • Posts: 718
  • Karma: 116
  • :)
    • My Homepage
Re: Not having to download playermodels when first joining a server
« Reply #1 on: January 01, 2015, 11:30:29 am »
Well, a couple things:
  • Are you running ULX? If so, this command could easily be simplified.
  • Your hook Identifier, "Chat", is highly nondescript and not at all unique. There's a good chance you could break chat.
  • Your hook callback function is different than the one you've defined.
  • Avoid using SendLua. Instead, try network messages.

Onto your issue, what gamemode are you running? Does the player model you have even support ragdolling (some don't)?
« Last Edit: January 01, 2015, 11:32:47 am by Bytewave »
bw81@ulysses-forums ~ % whoami
Homepage

Offline Dharmvir Sidhu

  • Newbie
  • *
  • Posts: 18
  • Karma: 1
    • OMENS Gaming
Re: Not having to download playermodels when first joining a server
« Reply #2 on: January 01, 2015, 04:22:29 pm »
Yes, I am running ulx

About the code, I just took the donate command someone had previously posted on here, and edited it to show up a workshop link instead of a donate link (but i didnt catch the other part, will fix)

I am currently running TTT, and yes the playermodels do support ragdolling, as I do use them already, and have tested ragdoll on them

  • Print