1. Post #1
    l4d2's Avatar
    December 2010
    169 Posts
    Hi! Is it possible to have these materials in Tool Gun? If it is, can someone do that? I will be very grateful. Greetings from Poland!
    http://www.garrysmod.org/downloads/?a=view&id=30145
    Reply With Quote Edit / Delete Reply Windows XP Poland Show Events Dumb Dumb x 1 (list)

  2. Post #2
    l4d2's Avatar
    December 2010
    169 Posts
    Bump

  3. Post #3
    l4d2's Avatar
    December 2010
    169 Posts
    Bla bla bla bla Bump

  4. Post #4
    Gold Member
    Hyper Iguana's Avatar
    March 2011
    641 Posts
    -snip-

  5. Post #5
    l4d2's Avatar
    December 2010
    169 Posts
    Stop sniping around and do something. For science. You monster.
    Reply With Quote Edit / Delete Reply Windows XP Poland Show Events Dumb Dumb x 2 (list)

  6. Post #6

    July 2011
    3 Posts
    Hi, if you know any basics about editing lists in a lua file, you can edit this file and add the appropriate materials you want near the middle:

    TOOL.Category = "Render"
    TOOL.Name = "#Material"
    TOOL.Command = nil
    TOOL.ConfigName = ""


    TOOL.ClientConVar[ "override" ] = "debug/env_cubemap_model"

    local function SetMaterial( Player, Entity, Data )

    if ( SERVER ) then
    Entity:SetMaterial( Data.MaterialOverride )
    duplicator.StoreEntityModifier( Entity, "material", Data )
    end

    return true

    end
    duplicator.RegisterEntityModifier( "material", SetMaterial )

    function TOOL:LeftClick( trace )

    if !( trace.Entity && // Hit an entity
    trace.Entity:IsValid() && // And the entity is valid
    trace.Entity:EntIndex() != 0 // And isn't worldspawn
    ) then return end

    local mat = self:GetClientInfo( "override" )
    SetMaterial( self:GetOwner(), trace.Entity, { MaterialOverride = mat } )
    return true

    end



    function TOOL:RightClick( trace )

    if !( trace.Entity && // Hit an entity
    trace.Entity:IsValid() && // And the entity is valid
    trace.Entity:EntIndex() != 0 // And isn't worldspawn
    ) then return end

    SetMaterial( self:GetOwner(), trace.Entity, { MaterialOverride = "" } )
    return true

    end

    list.Add( "OverrideMaterials", "models/wireframe" )
    list.Add( "OverrideMaterials", "debug/env_cubemap_model" )
    list.Add( "OverrideMaterials", "models/shadertest/shader3" )
    list.Add( "OverrideMaterials", "models/shadertest/shader4" )
    list.Add( "OverrideMaterials", "models/shadertest/shader5" )
    list.Add( "OverrideMaterials", "models/shiny" )
    list.Add( "OverrideMaterials", "models/debug/debugwhite" )
    list.Add( "OverrideMaterials", "Models/effects/comball_sphere" )
    list.Add( "OverrideMaterials", "Models/effects/comball_tape" )
    list.Add( "OverrideMaterials", "Models/effects/splodearc_sheet" )
    list.Add( "OverrideMaterials", "Models/effects/vol_light001" )
    list.Add( "OverrideMaterials", "models/props_combine/stasisshield_sheet" )
    list.Add( "OverrideMaterials", "models/props_combine/portalball001_sheet" )
    list.Add( "OverrideMaterials", "models/props_combine/com_shield001a" )
    list.Add( "OverrideMaterials", "models/props_c17/frostedglass_01a" )
    list.Add( "OverrideMaterials", "models/props_lab/Tank_Glass001" )
    list.Add( "OverrideMaterials", "models/props_combine/tprings_globe" )
    list.Add( "OverrideMaterials", "models/rendertarget" )
    list.Add( "OverrideMaterials", "models/screenspace" )
    list.Add( "OverrideMaterials", "brick/brick_model" )
    list.Add( "OverrideMaterials", "models/props_pipes/GutterMetal01a" )
    list.Add( "OverrideMaterials", "models/props_pipes/Pipesystem01a_skin3" )
    list.Add( "OverrideMaterials", "models/props_wasteland/wood_fence01a" )
    list.Add( "OverrideMaterials", "models/props_foliage/tree_deciduous_01a_trunk" )
    list.Add( "OverrideMaterials", "models/props_c17/FurnitureFabric003a" )
    list.Add( "OverrideMaterials", "models/props_c17/FurnitureMetal001a" )
    list.Add( "OverrideMaterials", "models/props_c17/paper01" )
    list.Add( "OverrideMaterials", "models/flesh" )

    // phx
    list.Add( "OverrideMaterials", "phoenix_storms/metalset_1-2" )
    list.Add( "OverrideMaterials", "phoenix_storms/metalfloor_2-3" )
    list.Add( "OverrideMaterials", "phoenix_storms/plastic" )
    list.Add( "OverrideMaterials", "phoenix_storms/wood" )
    list.Add( "OverrideMaterials", "phoenix_storms/bluemetal" )
    list.Add( "OverrideMaterials", "phoenix_storms/cube" )
    list.Add( "OverrideMaterials", "phoenix_storms/dome" )
    list.Add( "OverrideMaterials", "phoenix_storms/gear" )
    list.Add( "OverrideMaterials", "phoenix_storms/stripes" )
    list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_green" )
    list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_red" )
    list.Add( "OverrideMaterials", "phoenix_storms/wire/pcb_blue" )

    list.Add( "OverrideMaterials", "hunter/myplastic" )
    // You can begin adding here ***

    function TOOL.BuildCPanel( CPanel )

    // HEADER
    CPanel:SetTooltip( "#Tool_material_desc" )

    CPanel:MatSelect( "material_override", list.Get( "OverrideMaterials" ), true, 0.33, 0.33 )

    end

    Just be sure to save it as "material.lua" and place it in "garrysmod\gamemodes\sandbox\entities\weapons\gmod _tool\stools\"
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Useful Useful x 2Disagree Disagree x 1Friendly Friendly x 1 (list)

  7. Post #7
    l4d2's Avatar
    December 2010
    169 Posts
    And if I didn't want to replace the materials and only add new ones? What do I type in the document? If you help me create a rule is processed, I could have add the new materials myself.
    Reply With Quote Edit / Delete Reply Windows XP Poland Show Events Dumb Dumb x 2 (list)

  8. Post #8

    May 2010
    805 Posts
    And if I didn't want to replace the materials and only add new ones? What do I type in the document? If you help me create a rule is processed, I could have add the new materials myself.
    Then you'd just add
    list.Add( "OverrideMaterials", "SOMEMATERIALDIRECTORYHERE" )
    after where it says // You can begin adding here ***
    Reply With Quote Edit / Delete Reply Windows 7 United Kingdom Show Events Disagree Disagree x 1 (list)

  9. Post #9
    l4d2's Avatar
    December 2010
    169 Posts
    http://www.garrysmod.org/downloads/?a=view&id=30145
    This pack. "Just unzip to 'Garrysmod/Garrysmod'" it says.
    Okay. I did it. I have folder GC Textures unzipped to this directory. I'm trying to add some textures from this folder to my Materials Tool, but it's not working. I made a directory.
    For example: list.Add( "OverrideMaterials", "GC_Textures/wood/Wood_Plywood04" )
    But on materials list I have this "Wireframe" not texture, and it's not working.
    Any Idead? Cas someone tell me where exactly I must put this folder with textures? Then, show me sample directory? Please.

  10. Post #10
    l4d2's Avatar
    December 2010
    169 Posts
    I don't want to bump again. Bump. Please.

  11. Post #11
    Gold Member
    mil0001's Avatar
    January 2010
    479 Posts
    Doesn't it have to be materials/GC_Textures/wood/Wood_Plywood04? Its probably the file naming you got wrong or smething.
    Reply With Quote Edit / Delete Reply Windows 7 Australia Show Events Friendly Friendly x 1 (list)

  12. Post #12
    l4d2's Avatar
    December 2010
    169 Posts
    materials/GC_Textures/wood/Wood_Plywood04 <Unfortunately it's not working
    models/GC_Textures/wood/Wood_Plywood04 <This isn't working too
    I don't have an idea what now.
    Maybe someone else know something?

  13. Post #13
    I love you Danny <3
    Chessnut's Avatar
    August 2011
    2,690 Posts
    Aren't all of them textures, not materials?

  14. Post #14
    l4d2's Avatar
    December 2010
    169 Posts
    Yeah, and I don't understand nothing now. What I must to do, to have them as materials, and in materials tool?

  15. Post #15
    l4d2's Avatar
    December 2010
    169 Posts
    bump

  16. Post #16
    l4d2's Avatar
    December 2010
    169 Posts
    Dam these textures are in VTF, there are also VMT files. WHAT I MUST TO DO TO CONVERT IT TO MATERIALS AND USE IN A GUN?!?!?!?!?!?!?!!?!?!?!?!?!?!?

  17. Post #17
    Fantym420's Avatar
    October 2010
    870 Posts
    I just downloaded the pack and took a look, the materials need to be in

    materials/CustomText/

    I found this info by opening the vmt file(it's just text), the vmt file tells source where the texture is, so extract the materials to where the vmt specifies.

    The line it's on is

    "$basetexture" "CustomText/GC Textures/wood/Wood_Unifnished10"

    So there are two ways to do this, edit all vmt's to point to the new location(all relative to /materials/) or move the materials to the proper folder structure.

    if moved to the proper location the code for the tool will be

    list.Add( "OverrideMaterials", "CustomText/GC Textures/wood/Wood_Unifnished10" )


    hope that helps
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Friendly Friendly x 1 (list)

  18. Post #18
    l4d2's Avatar
    December 2010
    169 Posts
    Man, thanks for the answer. I did what you told me. It's not working for me. Icon of the material is black cube, when I'm trying to set material on sample thing, nothing happens. I put CustomText folder in materials.
    list.Add( "OverrideMaterials", "CustomText/GC Textures/wood/Wood_Unifnished10" ) I tried to set this line for some other materials but it's still not working. Maybe You have any ideas, what now? If not, thanks anyway. You're the only who really tried to help me.

  19. Post #19
    Bamboy's Avatar
    May 2009
    24 Posts
    It's not working because as the download title on garrysmod.org says, "198 Mapping Textures", meaning the textures are meant for use in hammer and not meant for being applied to props as materials. Trying to apply one of these textures to a prop and then applying a color to the prop used to change the color of the same texture that was on the map, but Garry fixed this bug and now replaces it with wireframe.
    Getting these to work on props would require you to change a whole ton of settings in the .vtf and the .vmt files. As to what exactly needs to be changed, I don't know. There is probably a page somewhere on the Valve Developer Wiki that explains how to make a new texture for use on props.

    Any texture modification/making will require you to use VTF Edit. It can be downloaded here for free.

    If you want to make sure that it isn't the lua thats causing the issue, try adding "debug/debugdrawflat". It is a nice full-bright material that isn't effected by world lighting. I'm not entirely sure why it isn't in there already.

    Also, is this list of materials client side or server side? IE, can I change this list and then go onto a server and then it will show the materials I added? (As long as the server has the same materials)
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Friendly Friendly x 1 (list)

  20. Post #20
    l4d2's Avatar
    December 2010
    169 Posts
    Okay, thanks for the information. I don't know nothing about these lists anyway.

  21. Post #21
    Fantym420's Avatar
    October 2010
    870 Posts
    Man, thanks for the answer. I did what you told me. It's not working for me. Icon of the material is black cube, when I'm trying to set material on sample thing, nothing happens. I put CustomText folder in materials.
    list.Add( "OverrideMaterials", "CustomText/GC Textures/wood/Wood_Unifnished10" ) I tried to set this line for some other materials but it's still not working. Maybe You have any ideas, what now? If not, thanks anyway. You're the only who really tried to help me.
    In the material you want to use change the following in the .vmt file

    Try chaning "LightmappedGeneric" to "UnlitGeneric", and removing all extra lines except "$basetexture"

    example, this is the file Asphalt01.vmt

    Before:
    Code:
    "LightmappedGeneric"
    {
    	"$basetexture" "CustomText/GC Textures/Asphalt/Asphalt01"
    	"$bumpmap" "CustomText/GC Textures/Asphalt/Asphalt01_normal"
    	"$surfaceprop" "concrete"
    }
    After:
    Code:
    "UnlitGeneric"
    {
    	"$basetexture" "CustomText/GC Textures/Asphalt/Asphalt01"
    }
    and if that don't work, I'm not sure what's up, If I have some more time I'll try and dig deaper
    Reply With Quote Edit / Delete Reply Windows 7 United States Show Events Winner Winner x 1 (list)

  22. Post #22
    l4d2's Avatar
    December 2010
    169 Posts
    Man, awesome, Asphalt01 is working! I'm gonna to change the rest .vmt's. You're a master! Thanks a lot !!
    Reply With Quote Edit / Delete Reply Windows XP Poland Show Events Friendly Friendly x 1 (list)