Author Topic: How to test skin shader in MTA:SA 1.5 version  (Read 2671 times)

Offline TheHacker

  • ***
  • It was all worth it
  • Registered: 08/12/2015
    YearsYearsYears
  • Group: Paralisis
  • Ingame: TheHacker
  • Squad: NeXuS_Squad
How to test skin shader in MTA:SA 1.5 version
« on: 26 01, 2018, 03:33:21 am »
You can in 1.5 without any problems. Simply create a topic named 'skin' in Desktop. Then create meta.xml with this text:
Code: XML
  1. <meta>
  2.  
  3.         <script src="client.lua" type="client"/>
  4.                 <file src="mod.dff" type="server"/>
  5.                 <file src="mod.txd" type="server"/>
  6.                
  7. </meta>

Here is the client.lua:
Code: Lua
  1. local skinID = 11 --replace "11" with your skin ID
  2.  
  3. function applySkin()    
  4.     txd = engineLoadTXD("mod.txd", skinID)      
  5.     engineImportTXD(txd, skinID)  
  6.     dff = engineLoadDFF("mod.dff", skinID)  
  7.     engineReplaceModel(dff, skinID)      
  8. end
  9. addEventHandler("onClientResourceStart", resourceRoot, applySkin)
  10.  
You can re-place those 11 with skin ID. Then get the skin TXD (Edited one) and DFF and then add both of them in the skin folder.

TXD's name should be this: mod.txd
DFF's name should be this: mod.dff
(you can change them but when you change it, change it from meta.xml as well or else it won't work.

Once it is done, put the 'skin' folder here: C:\Program Files (x86)\MTA San Andreas 1.5\server\mods\deathmatch\resources

Then re-open MTA SA and go to Map Editor. Press 'F5' and then press F8 and type 'start skin' and then wait for it to load (which will take around 2 - 3 seconds only) and then use /ss <skin ID>
« Last Edit: 28 01, 2018, 12:39:47 pm by TheHacker »
   
#ForzaJuve | #CR7Juve
The legend, the football king, Cristiano Ronaldo!

Offline DesiigneR

  • Junior Community Member
  • **
  • The Panda
  • Registered: 03/11/2016
    YearsYears
  • Ingame: DesiigneR
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #1 on: 26 01, 2018, 12:06:16 pm »
This is a great guide, I always use this method because there’s no need to download 1.3

Offline Risk

  • Junior Community Member
  • **
  • Registered: 24/04/2015
    YearsYearsYearsYears
  • Group: SAPD
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #2 on: 26 01, 2018, 12:24:06 pm »
Remove 11 from engineLoadTXD and engineLoadDFF. engineLoadDFF has only 1 argument and engineLoadTXD's second argument accepts only booleans(whether to enable texture filtering or not)
And "file" tag doesn't have a 'type' parameter...? They are client-side files anyway

A good and a helpful guide, good job

Offline TheHacker

  • ***
  • It was all worth it
  • Registered: 08/12/2015
    YearsYearsYears
  • Group: Paralisis
  • Ingame: TheHacker
  • Squad: NeXuS_Squad
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #3 on: 26 01, 2018, 01:19:44 pm »
Remove 11 from engineLoadTXD and engineLoadDFF. engineLoadDFF has only 1 argument and engineLoadTXD's second argument accepts only booleans(whether to enable texture filtering or not)
And "file" tag doesn't have a 'type' parameter...? They are client-side files anyway
What do you mean by that? 11 is the ID. I am not saying to add another argument and it works perfectly anyway. I even said to re-place 11 with skin ID and it will work perfectly.
   
#ForzaJuve | #CR7Juve
The legend, the football king, Cristiano Ronaldo!

Offline Risk

  • Junior Community Member
  • **
  • Registered: 24/04/2015
    YearsYearsYearsYears
  • Group: SAPD
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #4 on: 26 01, 2018, 02:18:06 pm »
What do you mean by that? 11 is the ID. I am not saying to add another argument and it works perfectly anyway. I even said to re-place 11 with skin ID and it will work perfectly.
You use the ID in engineImportTXD and engineReplaceModel. I am only saying it's unnecessary to type the IDs in engineLoadTXD and engineLoadDFF as they don't do anything in these functions.. It won't create problems in running but script looks ugly like that.

Offline TheHacker

  • ***
  • It was all worth it
  • Registered: 08/12/2015
    YearsYearsYears
  • Group: Paralisis
  • Ingame: TheHacker
  • Squad: NeXuS_Squad
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #5 on: 26 01, 2018, 03:18:58 pm »
You use the ID in engineImportTXD and engineReplaceModel. I am only saying it's unnecessary to type the IDs in engineLoadTXD and engineLoadDFF as they don't do anything in these functions.. It won't create problems in running but script looks ugly like that.
At least it works. We are not going to give it to anyone else though or showing it to them.
   
#ForzaJuve | #CR7Juve
The legend, the football king, Cristiano Ronaldo!

Offline DroMa

  • Regular Community Member
  • ***
  • Hell is empty and all the devils are here.
  • Registered: 05/01/2014
    YearsYearsYearsYearsYears
  • Group: Chao$, leader
  • Ingame: Chao$|DroMa'
  • Squad: Squads_hopper
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #6 on: 27 01, 2018, 08:24:13 pm »
Quote
start: Resource could not be found
i can't test my skin in MTA 1.5 I followed ur steps  :-\

Offline TheHacker

  • ***
  • It was all worth it
  • Registered: 08/12/2015
    YearsYearsYears
  • Group: Paralisis
  • Ingame: TheHacker
  • Squad: NeXuS_Squad
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #7 on: 28 01, 2018, 06:08:31 am »
i can't test my skin in MTA 1.5 I followed ur steps  :-\
Did you re-started your MTA? Make sure you did the following steps correctly because I did them and they worked perfectly. Make sure you put the skin folder in correct place which is in C:\Program Files (x86)\MTA San Andreas 1.5\server\mods\deathmatch\resources. Re-start MTA after you put the resources (make you just don't put meta, put meta.xml and not only client, it should be client.lua and when saving the file, save it as UTF-8, only for meta.xml and client.lua and the mod.txd and mod.dff should just be copied from TXD Workshop or if it is a modded skin, get it from this folder: C:\Program Files (x86)\MTA San Andreas 1.5\mods\deathmatch\resources\CITskinMods
   
#ForzaJuve | #CR7Juve
The legend, the football king, Cristiano Ronaldo!

Offline Relerx

  • Honorable
  • *****
  • Registered: 16/06/2016
    YearsYearsYears
  • Group: SAPD
  • Ingame: CON-Relerx|48
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #8 on: 28 01, 2018, 09:06:37 am »
Adding unnecessary things is not needed and is confusing for everyone.... you should change it.

Might as well indent it properly and make it look better.




Offline ForLaX

  • ***
  • CIT was nice! Goodbye
  • Registered: 07/06/2015
    YearsYearsYearsYears
  • Group: Left
  • Ingame: Left
  • Squad: Left
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #9 on: 28 01, 2018, 10:18:19 am »
Maybe this would be better
Code: Lua
  1. local skinID = 11 --replace "11" with your skin ID
  2.  
  3. function applySkin()    
  4.     txd = engineLoadTXD("mod.txd", skinID)      
  5.     engineImportTXD(txd, skinID)  
  6.     dff = engineLoadDFF("mod.dff", skinID)  
  7.     engineReplaceModel(dff, skinID)      
  8. end
  9. addEventHandler("onClientResourceStart", resourceRoot, applySkin)

The player will have to change the skin ID just from the variable up.
Feel free to contact me in my FB if you need me.

Offline TheHacker

  • ***
  • It was all worth it
  • Registered: 08/12/2015
    YearsYearsYears
  • Group: Paralisis
  • Ingame: TheHacker
  • Squad: NeXuS_Squad
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #10 on: 28 01, 2018, 12:40:11 pm »
Maybe this would be better
Code: Lua
  1. local skinID = 11 --replace "11" with your skin ID
  2.  
  3. function applySkin()    
  4.     txd = engineLoadTXD("mod.txd", skinID)      
  5.     engineImportTXD(txd, skinID)  
  6.     dff = engineLoadDFF("mod.dff", skinID)  
  7.     engineReplaceModel(dff, skinID)      
  8. end
  9. addEventHandler("onClientResourceStart", resourceRoot, applySkin)

The player will have to change the skin ID just from the variable up.
Changed, thanks.
   
#ForzaJuve | #CR7Juve
The legend, the football king, Cristiano Ronaldo!

Offline Relerx

  • Honorable
  • *****
  • Registered: 16/06/2016
    YearsYearsYears
  • Group: SAPD
  • Ingame: CON-Relerx|48
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #11 on: 28 01, 2018, 03:30:50 pm »
https://wiki.multitheftauto.com/wiki/EngineLoadTXD

2nd argument is a bool. Not a number.

https://wiki.multitheftauto.com/wiki/EngineLoadDFF

doesn't even have a 2nd argument.

And here is the code because you are literally adding unnecessary now and not willing to fix it:

Code: Lua
  1. local skinID = 11 --replace "11" with your skin ID
  2.  
  3. function applySkin()    
  4.     txd = engineLoadTXD("mod.txd")      
  5.     engineImportTXD(txd, skinID)  
  6.     dff = engineLoadDFF("mod.dff")  
  7.     engineReplaceModel(dff, skinID)      
  8. end
  9. addEventHandler("onClientResourceStart", resourceRoot, applySkin)
  10.  

+

Code: XML
  1. <meta>
  2.         <script src="client.lua" type="client" />
  3.         <file src="mod.dff" />
  4.         <file src="mod.txd" />      
  5. </meta>
  6.  




Offline DroMa

  • Regular Community Member
  • ***
  • Hell is empty and all the devils are here.
  • Registered: 05/01/2014
    YearsYearsYearsYearsYears
  • Group: Chao$, leader
  • Ingame: Chao$|DroMa'
  • Squad: Squads_hopper
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #12 on: 28 01, 2018, 06:19:22 pm »
nothing happend I tried everything.
check these screenshots:
Show content



« Last Edit: 28 01, 2018, 06:24:13 pm by DroMa' »

Offline Risk

  • Junior Community Member
  • **
  • Registered: 24/04/2015
    YearsYearsYearsYears
  • Group: SAPD
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #13 on: 28 01, 2018, 11:05:17 pm »
nothing happend I tried everything.
check these screenshots:
Show content



Everything looks OK but:

Where on Earth did you get line 2(the highlighted one) from? It doesn't even have a handler function and if you check debug you'd find an error. Remove that line. It isn't even mentioned in the script above.

However, this isn't the problem it doesn't stop the script from running. The resource may not have started because you don't have the permission to start it, make sure you have an account and it's in an ACL group that has permission to start/stop resources. You can search google to find out how to create an admin account on your MTA server.

Offline DroMa

  • Regular Community Member
  • ***
  • Hell is empty and all the devils are here.
  • Registered: 05/01/2014
    YearsYearsYearsYearsYears
  • Group: Chao$, leader
  • Ingame: Chao$|DroMa'
  • Squad: Squads_hopper
Re: How to test skin shader in MTA:SA 1.5 version
« Reply #14 on: 29 01, 2018, 02:14:45 am »
That eventhandler I added it recently, after many tries to make it works, but nothing happens, I recive message on f8 saying « skin started » and when I check the skin I see nothing new.