[Tutorial] How to texture
#1

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.

Reply
#2


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).
Reply
#3

Nice tutorial ! like it , thank you.
Reply
#4

That way is very slow and tedious
Reply
#5

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
Reply
#6

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
Reply
#7

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

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

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

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


Forum Jump:


Users browsing this thread: 1 Guest(s)