SA-MP Forums

Go Back   SA-MP Forums > SA-MP DL Edition > SA-MP 0.3.DL

 
 
Thread Tools Display Modes
Old 01/11/2019, 05:55 PM   #1
Cr0heart
Little Clucker
 
Cr0heart's Avatar
 
Join Date: Oct 2019
Location: Croatia, Zagreb Money: 999,999,999$
Posts: 26
Reputation: 29
Default [SA:MP] How to edit GTA San Andreas object without losing it's lighting

The title says it. Let's start.

Programs needed
- Autodesk 3ds Max 2009 (32-bit or 64-bit depending on your system)
- Map editor
- Alci's IMG Editor 1.5
- kdff program
- TXD Workshop by JernejL and Kam's scripts are provided in the attachments


Open map editor and find object you want to work on.




Let's say I want to edit this house:




Double left-click on it and this window pops up:




After that, we are looking for this:

Model: compmedhos3_lae.dff
Texture: comedhos1_la.txd




Open Alci's IMG Editor 1.5 and go File > Open > gta3.img

In search bar type compmedhos3_lae and comedhos1_la because that are the files we are looking for. If you are willing to export an interior object, open gta_int.img.
Now after you have found them, go Actions > Export and export it where you want. Remember, exporting file must be selected while you are doing this.




Exporting all textures to desktop

For this, you need to have TXD workshop that is provided in the attachments. In TXD workshop go Open TXD and choose your file. In my case that is comedhos1_la. Now do this:



Export to desktop.

After that, you may ask why is it exported to desktop? That's because you need to import textures in 3ds Max, but before that you need to set your project folder from where 3ds max should import stuff (in this case .png files to textures).

(3ds max)


Here choose Desktop because textures are exported to desktop (croatian radna površina)


After that, we have our files exported and ready for importing in 3ds Max. For 3ds Max you need to install the scripts provided in the attachments. Any other exporting script will not work for this kind of thing. If you don't know how to install scripts for 3ds Max, you simply go to your 3ds Max directory (32-bit or 64- bit) and find Scripts folder. You just paste Kam's scripts there.

Restart 3ds Max once you have done that.


Importing in 3ds Max





Select import and this will show up. Choose .png because earlier on, we exported our files to desktop with .png extension.



Press import and choose .dff file, in this case it is compmedhos3_lae.


Selections and applying texture

Sometimes object can't be selected. Here is what you should do:

Right click on it > Create polygons



After that you have polygons created. Remember, some objects don't need to create polygons. You will see that if they appear red on click.

Also, as in Blender, 3ds Max has it's selection modes. Choose to select element.



Okay, now you learned how to select faces in 3ds Max. Time to apply textures to know what are you actually selecting.



Select windows with left click (hold ctrl to select couple of them at once)



Simply, press delete and you have this:


Exporting process

Cool now you have your edited house. Export it.



Very important part is to name the dff, txd and .col the same name!

(kdff)


Remember once you made .col you need to save the new .dff file!

Since you have exported original .txd file, you just need to rename it to the .dff name. No need to create new .txd file with exported .png's because you are doing the same file. Now after all that, you just put it in artconfig.txt.

AddSimpleModel(-1, 3556, -2001, "house.dff", "house.txd");
Numbers colored red really doesn't matter because we made .col file. Just for originallity, put the original ID of the object there!



Attached Files
File Type: zip Kam's scripts 2018 updated by GoldFish.zip (309.4 KB, 5 views)
File Type: zip TXD Workshop.zip (716.0 KB, 1 views)

Last edited by Cr0heart; 03/11/2019 at 03:57 AM.
Cr0heart is offline  
Old 01/11/2019, 06:41 PM   #2
Cr0heart
Little Clucker
 
Cr0heart's Avatar
 
Join Date: Oct 2019
Location: Croatia, Zagreb Money: 999,999,999$
Posts: 26
Reputation: 29
Default Re: [SA:MP] How to edit GTA San Andreas object without losing it's lighting

Possible bugs

This Kam's script version fixed omni lights bug (scroll disappear and in-game crash) so that's not a thing to worry about. But there is a bug with viewport shading (texture applying) that looks like this:



You see the roof is bugged. All you have to do is select the bugged area (element selection) and drag & drop the right texture onto it (in 3ds Max).
Cr0heart is offline  
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Edit object.. iBots Scripting Help 1 09/07/2014 02:19 PM
when i edit from my friends gta san andreas server it writes to the script wrong teamsheetz Server Support 1 02/07/2009 08:27 PM


All times are GMT. The time now is 05:56 PM.


Powered by vBulletin® Version 3.8.6
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.