ULX

Author Topic: Adding models from different games?  (Read 2890 times)

0 Members and 1 Guest are viewing this topic.

Offline Sophersky

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
  • Fire doesn't destroy, it cleanses.
Adding models from different games?
« on: August 17, 2014, 11:00:28 AM »
I was wondering if there was a way to import a model from, say, TF2, into Gmod and use it in Pointshop. Is this possible?
"Citizen notice. Failure to co-operate will result in permanent off-world relocation." ~ Overwatch

Offline UnderYouFive

  • Newbie
  • *
  • Posts: 28
  • Karma: -5
Re: Adding models from different games?
« Reply #1 on: August 17, 2014, 11:40:42 AM »
Yes it is, you need to find an addon like this http://steamcommunity.com/sharedfiles/filedetails/?id=292523019&searchtext=tf2+player+model then you need this code.
Code: [Select]
ITEM.Name = 'You name here'
ITEM.Price = 250
ITEM.Model = 'models/player/Yourmodelnamehere.mdl'

function ITEM:CanPlayerEquip(ply)
    return ply:Team() ~= TEAM_UNDEAD
end

function ITEM:OnEquip(ply, modifications)
if not ply._OldModel then
ply._OldModel = ply:GetModel()
end

timer.Simple(1, function() ply:SetModel(self.Model) end)
end

function ITEM:OnHolster(ply)
if ply._OldModel then
ply:SetModel(ply._OldModel)
end
end

function ITEM:PlayerSetModel(ply)
ply:SetModel(self.Model)
end

Offline Sophersky

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
  • Fire doesn't destroy, it cleanses.
Re: Adding models from different games?
« Reply #2 on: August 17, 2014, 11:55:33 AM »
I mean is it possible to extract a model like tf2_misc_dir.vpk/models/lilchewchew/lilchewchew.mdl and allow pointshop to use it?
« Last Edit: August 17, 2014, 12:00:12 PM by Sophersky »
"Citizen notice. Failure to co-operate will result in permanent off-world relocation." ~ Overwatch

Offline Neku

  • Hero Member
  • *****
  • Posts: 549
  • Karma: 27
Re: Adding models from different games?
« Reply #3 on: August 17, 2014, 12:05:35 PM »
I don't know how TF2 handles their models, but it looks to be the same as HL2.
Go ahead and give it a shot.
Out of the Garry's Mod business.

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Adding models from different games?
« Reply #4 on: August 17, 2014, 12:08:31 PM »
I'm pretty sure that if you have Team Fortress 2 mounted on a Gmod server, then you can use it as a normal "models/tf2_model_directory/modelname.mdl" in the pointshop, although I have no experience myself with a pointshop.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Sophersky

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
  • Fire doesn't destroy, it cleanses.
Re: Adding models from different games?
« Reply #5 on: August 17, 2014, 12:13:49 PM »
So something like models/lilchewchew/lilchewchew.mdl would work?
"Citizen notice. Failure to co-operate will result in permanent off-world relocation." ~ Overwatch

Offline Decicus

  • Hero Member
  • *****
  • Posts: 552
  • Karma: 81
    • Alex Thomassen
Re: Adding models from different games?
« Reply #6 on: August 17, 2014, 12:19:18 PM »
If it's mounted and the directory from the root dir (TF2/GMod) would be that, then yes, that should in theory work.
Contact information:
E-mail: alex@thomassen.xyz.
You can also send a PM.

Offline Sophersky

  • Newbie
  • *
  • Posts: 12
  • Karma: 0
  • Fire doesn't destroy, it cleanses.
Re: Adding models from different games?
« Reply #7 on: August 17, 2014, 01:03:06 PM »
So the tf2 folder has to be located in the same file where the gmod vpks are?

Edit: This worked, thanks!
« Last Edit: August 17, 2014, 02:02:40 PM by Sophersky »
"Citizen notice. Failure to co-operate will result in permanent off-world relocation." ~ Overwatch