Jump to content

[Question] Applying custom textures to 3Ds max objects


kieran

Recommended Posts

I am fairly new to 3Ds max and I am trying to create a simple object with a texture.  I followed a whole bunch of tutorials on YouTube and so far the col and dff files show in game...  But the object is bright white, even when I turn the brightness right down or use an image that's nearly black from the hue being so low.

I done a quick search on forums and found out you need UV Wrapping?  I have no clue how this effects textures so it would be nice if someone explained what it is and how it works...  Also I am not sure if I am using txd workshop right, got the image in, but no alpha/mask image shows.

I made a custom object, applied a 2 sided custom texture, exported dff/cst files with SA Tools, made the col file from cst choosing metal floor for it, then I just imported an image into txd workshop and saved it as a compressed .txd file, also done the obvious and loaded it all with the following script.  If anyone can see where I'm going wrong it would be much appreciated. :D\

meta.xml

Spoiler

<meta>
	<info author="kieranb" type="script" name="test" description="Some test file." />
    <download_priority_group>0</download_priority_group>
    <min_mta_version client="1.5.5" server="1.5.5" />
	<script src="client.lua" type="client" />
	<file src="B.dff"/>
	<file src="B.col"/>
	<file src="B.txd"/>
</meta>

 

client.lua

Spoiler

addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource() ),
	function ()
	local txd = engineLoadTXD ( "B.txd", true )
		engineImportTXD ( txd, 10710 )
	
	local dff = engineLoadDFF ( "B.dff", 0 )
		engineReplaceModel ( dff, 10710 )
	
	local col = engineLoadCOL ( "B.col" )
		engineReplaceCOL ( col, 10710 )
	
	engineSetModelLODDistance(10710, 500)
end)

 

 

Edited by kieran
Link to comment
  • MTA Anti-Cheat Team
On 30-5-2018 at 18:04, kieran said:

But the object is bright white

The object looks like that because there's no proper material applied to the object(s) in element tree of DFF. In 3DS, press the M key, pencil icon, and then click the surface that is white. The apparent color in 3DS viewport or material ID overview is irrelevant at this point, just click the appropiate material ID and then in bitmap selection, clear the *.tga just to rename it, please note that ordinarily the "tga" materials are loaded right from the TXD, so if a texture name in your TXD is for example "blackandwhite", then you enter "blackandwhite.tga" into the 3DS material bitmap name. Now, aslong this single material ID covers enough of the DFF object's surface, the TXD's texture will load on the model's surface covered by that material ID, so if there's multiple mat ID's you should select the proper one for each, as the TXD should contain all that are neccesary.

Let me remind you that most failure are made with invalid references from bitmap texture material name to the textures contained within a TXD.. if a DFF element has a bitmap with name.tga, it expects to load "name" image from TXD, and if its not present, then it simply wont load. These are very common inconsistencies, sometimes there's 15 textures in a TXD and the DFF is only configured (requires) to load 7 that are in the TXD, and sometimes the required, functional textures are present in the TXD but the material (bitmapname.tga) naming doesn't match what the DFF expects, due to lack of communication by several modellers having worked on the same files.

You can also export textures as TGA from TXD (for example with Magic.TXD) and then open it in the material library of 3DS, as straightforward .TGA file. This is recommended to load the right bitmap or rendering values, if your TXD seems to have problem loading the right material in.

Also make sure that your exporter and general material settings are set to GTA renderware material type (most commonly called "RW_Mtl" or "GTA_Mtl") before applying the specific bitmap/tga/TXD relayed textures to it and expecting it to work. If you're using 3DS, I personally recommend you to use http://gtaforums.com/topic/838479-dff-importer-and-exporter-for-3ds-max and the included GTA material.

Link to comment

Thanks @Dutchman101, done a quick test file and came up with the object below. :D But I have one final question...  How do you make the texture so it can be seen from the inside? (it's invisible from inside) Should I face flip and just put the new object inside or is there an easier way?

iWFNmlD.png

Edited by kieran
Link to comment
  • MTA Anti-Cheat Team
1 hour ago, kieran said:

How do you make the texture so it can be seen from the inside? (it's invisible from inside)

Add a second layer underneath the exterior's surface, and then apply another or the same texture as material to the material ID for that new layer.

Link to comment
2 hours ago, CodyJ(L) said:

setElementDoubleSided

Adding a second layer is a waste of polys unless you intend on adding another texture or different lighting.

That works sure, but not by default, you can't set an object ID to double-sided, only a named object created in a script....  I think Dutchman has the best idea...  But I was wondering how to add another layer of polys for slightly more complex objects that you might have extruded and are hard to create again, any easy way of turning an object inside out?  The likes of making a double-sided material into just polys?  Or even better, any ways of setting an object to be double-sided by default?

Edited by kieran
Link to comment

@CodyJ(L) Thanks so much, it's embarrassing but I still have one question...  Should be last one, at least for a while haha! 

Do you know how I can export a group as a col?  I made a house with many different objects, grouped them, exported dff (so only one dff was exported and not many)...  But I can't find out how to properly export a group of objects as 1 col file, I keep getting the message "Please re-install export_steve_col_script.ms script!" but I have no clue what that is, it was working fine until I tried exporting a group of objects with SA Tools, seems it doesn't like it.

Link to comment

you should try to reinstall that script, also it should work normally. ill explain how to export collision. first go to your Utillities, go to Kam's GTA script. press on collision IO, once you have done that. you should see on your left hand side a bar, click on Collision mesh and click on your object (it doesnt matter which object as long as they are connected, also check if your objects x y z are at 0,0,0) and then if you have a car (for example) you can press on shadow mesh and do the same. COL3 should be selected. and then write a name above export. and then export the file.

PS: download kams script via gtagarage.com

Edited by Taurus
Link to comment
  • 4 weeks later...
On 6/10/2018 at 16:50, Taurus said:

you should try to reinstall that script, also it should work normally. ill explain how to export collision. first go to your Utillities, go to Kam's GTA script. press on collision IO, once you have done that. you should see on your left hand side a bar, click on Collision mesh and click on your object (it doesnt matter which object as long as they are connected, also check if your objects x y z are at 0,0,0) and then if you have a car (for example) you can press on shadow mesh and do the same. COL3 should be selected. and then write a name above export. and then export the file.

PS: download kams script via gtagarage.com

I have both SA Tools and kams script, there is now no problems with collision files, only dff and txd, check this topic for a more detailed explanation to how I made the object, applied textures etc....  I do not know where I am going wrong :/

 Also thanks for help with kams, that col system confused me a lot.

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...