SA-MP Forums Archive
[Tutorial] How to texture - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+---- Forum: Tutorials (https://sampforum.blast.hk/forumdisplay.php?fid=70)
+---- Thread: [Tutorial] How to texture (/showthread.php?tid=534881)



How to texture - mzazon - 31.08.2014

Texturing tutorial



This tutorial is for people who are familiar with pawno and mapping and who want to learn how to re-texture objects. However, the tutorial is written in human's language to make it easier to understand.

All you need is a test server which can be downloaded on sa-mp forums and the mapping constructor.Click here for the link

1.-Re-texturing single objects


2.-Extract the code to pawno.


3.-Then add the includes, without them you won't be able to compile the code.
pawn Код:
#include <core>
#include <float>
#include <a_samp>
#include <YSI\y_ini>
#include <streamer>


4.-After adding the includes you should write the stock lines. This already includes a texture, we'll rewrite it later on.
Code:
pawn Код:
stock CustObjectWall(objectid, Float:x, Float:y, Float:z, Float:rx, Float:ry, Float:rz) //
{
new Wall=CreateDynamicObject(objectid, x, y, z, rx, ry, rz); //
SetDynamicObjectMaterial(Wall, 0, 16150, "ufo_bar", "dinerfloor01_128", 0); //
}


5.-Select this line and convert it to CreateDynamicObject's format by YSI on www.convertffs.com


The settings on the converter must be the same as below


-Replace the old line with this one


6.-Now after you've converted the object to YSI (CreateDynamicObject), you must place this line under 'public OnFilterScriptInit() or OnGameModeInit - depends how do you use the objects, starting and ending with these brackets {}.


7.-Change 'CreateDynamicObject' to your stock, so the object can take the texture from it. In this case it'll be renamed to 'CustObjectWall', like in the stock.

It should look like this:


8.-Now, select your textures from http://textures.future-elife.com/ This is the easiest way to look for textures.


9.-Double click on the texture you want. It should bring up a small window with a code in it.
This is the objects ID you take the texture from.

...the id ^^ goes here (below)


Now, the second 'line' is something like a package from which the texture is taken, many objects might have the same 'package' of textures.

...and this goes right after the ID, between the "" marks. Like shown below.


The last 'line' is the exact texture from the 'package', in a single 'package' there could me many textures.

...and it goes here, also between the "" marks.


10.-After you have written everything correctly compile the code and load it in your test server to check the result.




Re: How to texture - mzazon - 31.08.2014


Multiple objects
11.-Now, if you have, for example, 4 DIFFERENT or the SAME objects and you don't want to re-write the code for each of them, you can simply add more 'CustObject...' between the brackets.

Look closely, they all have different ID's but they'll look exactly the same after texturing.

...rename 'CreateDynamicObject' to your stock with the texture...

...compile and test.


12.-If you want to have different textures for different objects then you have to make another 'stock' with new textures.
Also, the 'CreateDynamicObject' should be renamed to the new stock.

...and this is how it looks IG (In-Game).



Re: How to texture - meitaredri - 31.08.2014

Nice tutorial ! like it , thank you.


Re: How to texture - Pottus - 31.08.2014

That way is very slow and tedious


Re: How to texture - Abagail - 31.08.2014

So you're lying to us then,

Quote:

All you need is a test server which can be downloaded on sa-mp forums and the mapping constructor.

Actually, this tutorial requires,

- A web browser
- pawno.exe and pawncc.exe, etc.
- a keyboard

nice try though


Re: How to texture - Dignity - 31.08.2014

Quote:
Originally Posted by Abagail
Посмотреть сообщение
So you're lying to us then,



Actually, this tutorial requires,

- A web browser
- pawno.exe and pawncc.exe, etc.
- a keyboard

nice try though
1/10


Re: How to texture - thaKing - 01.09.2014

or you can just use this one http://forum.sa-mp.com/showthread.ph...Texture+Studio


Re: How to texture - MOSensei - 27.04.2015

Great! this is what I'm lookin' for..
+rep


Re: How to texture - Infinity - 27.04.2015

Stop the abuse of stock!
Working on your indentation would be helpful as well.


Re: How to texture - Crayder - 27.04.2015

Quote:
Originally Posted by Infinity
Посмотреть сообщение
Stop the abuse of stock!
Working on your indentation would be helpful as well.
#AgeCheck?