• Materials don't get loaded properly
    24 replies, posted
Hello, I'm using a texture for my custom gun, but it doesn't get loaded. It's definitly not broken, when I add it manually it shows without a problem. Also the clientside_crashlog doesn't show anything. When "downloaded" by the server, the folder gets created but not the files. Here's my add-code: [CODE] -- Materials resource.AddFile("materials/models/weapons/v_models/Havoc Deagle/bullet.vmt") resource.AddFile("materials/models/weapons/v_models/Havoc Deagle/grip.vmt") resource.AddFile("materials/models/weapons/v_models/Havoc Deagle/main.vmt") resource.AddFile("materials/models/weapons/w_models/Havoc Deagle/bullet.vmt") resource.AddFile("materials/models/weapons/w_models/Havoc Deagle/grip.vmt") resource.AddFile("materials/models/weapons/w_models/Havoc Deagle/main.vmt")[/CODE] Here's the v_models folder: [IMG]http://puu.sh/5Jhdo.png[/IMG] Thanks for help! Lg
You have got a space between "Havoc Deagle", I think that might be an issue. Try putting _ between these 2 words in the code aswell as changing the folders name so its Havoc_Deagle. Also, you have to send VTF files aswell and all the files you are adding via resource.AddFile are VMT lol.
[QUOTE=Netheous;43145776]Also, you have to send VTF files aswell and all the files you are adding via resource.AddFile are VMT lol.[/QUOTE] VTF file are automatically included when using resource.AddFile. [QUOTE=Wiki]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.[/QUOTE]
[QUOTE=samm5506;43145799]VTF file are automatically included when using resource.AddFile.[/QUOTE] Yeah, what about the space though? I don't think it should be like that, none of materials I have are like that too.
I think it might be one of those FastDL 404 problems.
Isn't the path, so the space too, also in the .mdl files?
[QUOTE=Nakroma;43145892]Isn't the path, so the space too, also in the .mdl files?[/QUOTE] It is. But it is fixable via hexing a model.
[QUOTE=Robotboy655;43145935]It is. But it is fixable via hexing a model.[/QUOTE] Well... uhm... yeah... hexing... is this difficult or is there a tutorial for that?
[QUOTE=Nakroma;43145956]Well... uhm... yeah... hexing... is this difficult or is there a tutorial for that?[/QUOTE] There are like a million of tutorials everywhere, YouTube, Gamebanana, etc. Just google it.
[QUOTE=Robotboy655;43145959]There are like a million of tutorials everywhere, YouTube, Gamebanana, etc. Just google it.[/QUOTE] OK thanks, I'll try it out.
[QUOTE=samm5506;43145799]VTF file are automatically included when using resource.AddFile.[/QUOTE] VMT files don't have to use VTFs with the same name, if you look at the folder he's got in his picture you can see that the "Golden 2 tone.vtf" is not the same file name as any of the VMTs, therefore they will not be added to the FastDL. You should actually read things you quote.
[QUOTE=OzymandiasJ;43146417]VMT files don't have to use VTFs with the same name, if you look at the folder he's got in his picture you can see that the "Golden 2 tone.vtf" is not the same file name as any of the VMTs, therefore they will not be added to the FastDL. You should actually read things you quote.[/QUOTE] The Golden***.vtf's are included in the main.vmt
[QUOTE=Nakroma;43146588]The Golden***.vtf's are included in the main.vmt[/QUOTE] Then you need to resource.AddSingleFile them seperately, because just resource.AddFileing the VMT doesn't cover it.
Hey, The textures are working as intended now(Thanks to everyone). But now I have a problem, and I dunno if it's the model or the code: [IMG]http://puu.sh/5JqlG.jpg[/IMG] Would be cool if someone knows to fix this lol. Lg
You gotta recompile the world model and fix it. ( There's a tutorial on YT ) Or use SWEP:DrawWorldModel to reposition it.
Damn it, I provided the answer (or partial, other than hexing) - yet I've received 2 disagrees. Cruel world.
[QUOTE=Netheous;43148561]Damn it, I provided the answer (or partial, other than hexing) - yet I've received 2 disagrees. Cruel world.[/QUOTE] You got the disagrees for "Also, you have to send VTF files aswell and all the files you are adding via resource.AddFile are VMT lol." which is incorrect information.
Yeah I'm ATM trying to do that. Im following this tutorial: [url]http://www.youtube.com/watch?v=92ougL615D0[/url] Is there anyway to not use XSI Mod Tool, because it won't wanna start :/ Lg
You can use 3ds max.
I can't even install 3ds max... direct error: communication failur. Can't I use blender or something? Edit: Has someone the time to help me with DrawWorldModel :/?
This is what I use in my SWEP base: [code] SWEP.FixWorldModel = false SWEP.FixWorldModelPos = Vector( 0, 0, 0 ) SWEP.FixWorldModelAng = Angle( 0, 0, 0 ) SWEP.FixWorldModelScale = 1 function SWEP:DoFixWorldModel() if ( IsValid( self.Owner ) ) then local att = self.Owner:GetAttachment( self.Owner:LookupAttachment( "anim_attachment_RH" ) ) if ( !att ) then return end local pos, ang = att.Pos, att.Ang ang:RotateAroundAxis( ang:Forward(), self.FixWorldModelAng.p ) ang:RotateAroundAxis( ang:Right(), self.FixWorldModelAng.y ) ang:RotateAroundAxis( ang:Up(), self.FixWorldModelAng.r ) pos = pos + ang:Forward() * self.FixWorldModelPos.x + ang:Right() * self.FixWorldModelPos.y + ang:Up() * self.FixWorldModelPos.z self:SetModelScale( self.FixWorldModelScale, 0 ) self:SetRenderOrigin( pos ) self:SetRenderAngles( ang ) else self:SetRenderOrigin( self:GetNetworkOrigin() ) self:SetRenderAngles( self:GetNetworkAngles() ) end end function SWEP:DrawWorldModel() if ( self.FixWorldModel ) then self:DoFixWorldModel() end self:DrawModel() end[/code]
[QUOTE=Robotboy655;43150124]This is what I use in my SWEP base: [code] SWEP.FixWorldModel = false SWEP.FixWorldModelPos = Vector( 0, 0, 0 ) SWEP.FixWorldModelAng = Angle( 0, 0, 0 ) SWEP.FixWorldModelScale = 1 function SWEP:DoFixWorldModel() if ( IsValid( self.Owner ) ) then local att = self.Owner:GetAttachment( self.Owner:LookupAttachment( "anim_attachment_RH" ) ) if ( !att ) then return end local pos, ang = att.Pos, att.Ang ang:RotateAroundAxis( ang:Forward(), self.FixWorldModelAng.p ) ang:RotateAroundAxis( ang:Right(), self.FixWorldModelAng.y ) ang:RotateAroundAxis( ang:Up(), self.FixWorldModelAng.r ) pos = pos + ang:Forward() * self.FixWorldModelPos.x + ang:Right() * self.FixWorldModelPos.y + ang:Up() * self.FixWorldModelPos.z self:SetModelScale( self.FixWorldModelScale, 0 ) self:SetRenderOrigin( pos ) self:SetRenderAngles( ang ) else self:SetRenderOrigin( self:GetNetworkOrigin() ) self:SetRenderAngles( self:GetNetworkAngles() ) end end function SWEP:DrawWorldModel() if ( self.FixWorldModel ) then self:DoFixWorldModel() end self:DrawModel() end[/code][/QUOTE] Oh my god, thank you. The model is still a bit offset but I can fix that, thank you very much!
I was actually unaware of this method and might need this sometime in the future; thanks robot
Hey, So I don't want open another thread, so I'll ask here again. I know this model I use is pretty shit, we're talking about the same as above. So I've got the problem, when I rightclick to zoom in, the model moves right out of the screen :/ Anyone knows what actually causes this or can I fix it(I guess it's the model again, since I tried messing with the code as much as possible). Lg
you need to properly set the ironsight
Sorry, you need to Log In to post a reply to this thread.