Object Material -
TwinkiDaBoss - 21.12.2015
So im just wondering, Im preety new into the game with all of this object material , Ive read few threads and such, but im trying to do is quite simple, turn the object entirely yellow but seems like Im doing something wrong, its somewhat dark
PHP код:
TestColor = CreateDynamicObject(19464, 3136.74316, -1090.61914, 16.68518, 0.00000, 0.00000, 0.00000);
SetDynamicObjectMaterial(TestColor,0,18018, "genintintbarb", "CJ_Black_metal",0xFFFFFF00);
Re: Object Material -
Denying - 21.12.2015
The format here is ARGB, not RGBA, which means the 00 should come first, that should make it much much less visible, or bright if you wish, I assume. Though.. try not using 00, try something a bit higher.
And also.. I'm pretty sure what you're using is white, not yellow. The color.
Respuesta: Object Material -
Zume - 21.12.2015
The object have a invisible color (ALPHA 00), and the object it's yellow maybe.. Yo can hook the function to convert RGBA to ARGB:
PHP код:
stock SetDynamicObjectMaterial_Ex(STREAMER_TAG_OBJECT objectid, materialindex, modelid, const txdname[], const texturename[], materialcolor = 0)
{
return SetDynamicObjectMaterial(objectid, materialindex, modelid, txdname, texturename, (materialcolor >>> 8 | materialcolor << 24));
}
#if defined _ALS_SetDynamicObjectMaterial
#undef SetDynamicObjectMaterial
#else
#define _ALS_SetDynamicObjectMaterial
#endif
#define SetDynamicObjectMaterial SetDynamicObjectMaterial_Ex
or simply, apply this function:
PHP код:
#define ConvertARGBtoRGBA(%1) (%1 >>> 8 | %1 << 24)
Re: Object Material -
SickAttack - 21.12.2015
A yellow keypad close to the coordinates 0.0, 0.0, 0.0.
pawn Код:
new object_id = CreateDynamicObject(2922, 133.76311, -75.74743, 1.13980, 0.00000, 0.00000, 0.00000);
SetDynamicObjectMaterialText(object_id, 0, " ", OBJECT_MATERIAL_SIZE_256x128, "Ariel", 0, 0, 0xFF0000FF, (0xFFF000FF >>> 8 | 0xFFF000FF << 24), OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
Re: Object Material -
RoboN1X - 21.12.2015
Quote:
Originally Posted by TwinkiDaBoss
So im just wondering, Im preety new into the game with all of this object material , Ive read few threads and such, but im trying to do is quite simple, turn the object entirely yellow but seems like Im doing something wrong, its somewhat dark
PHP код:
TestColor = CreateDynamicObject(19464, 3136.74316, -1090.61914, 16.68518, 0.00000, 0.00000, 0.00000);
SetDynamicObjectMaterial(TestColor,0,18018, "genintintbarb", "CJ_Black_metal",0xFFFFFF00);
|
That will make a wall object with black metal texture, doesn't matter what color you chose, it will be black (yellow-black) since the origin texture is black.
Quote:
Originally Posted by Denying
The format here is ARGB, not RGBA, which means the 00 should come first, that should make it much much less visible, or bright if you wish, I assume. Though.. try not using 00, try something a bit higher.
And also.. I'm pretty sure what you're using is white, not yellow. The color.
|
He has done it properly... 0xFFFFFF00 is yellow, if 00 should come first as the alpha channel, it will make the object texture invisible, not bright. Minimum alpha value for object material color is 8D, therefore 0x8CFFFFFF will make it invisible for the game client.
Quote:
Originally Posted by SickAttack
A yellow keypad close to the coordinates 0.0, 0.0, 0.0.
pawn Код:
new object_id = CreateDynamicObject(2922, 133.76311, -75.74743, 1.13980, 0.00000, 0.00000, 0.00000); SetDynamicObjectMaterialText(object_id, 0, " ", OBJECT_MATERIAL_SIZE_256x128, "Ariel", 0, 0, 0xFF0000FF, (0xFFF000FF >>> 8 | 0xFFF000FF << 24), OBJECT_MATERIAL_TEXT_ALIGN_CENTER);
|
You meant with 0.0 rotation values, also that's material text, and font name is Arial.
However i'm not sure why need to convert it when it's coded directly... I don't think moving the last two alpha value is a hard job. Except you are lazy or will get confused, then using macros like _Zume said will do it.
Anyway if you want to make the wall with yellow color but texture stay same, then use this:
PHP код:
SetDynamicObjectMaterial(TestColor,0,-1, "none", "none",0xFFFFFF00);
Note that since the original texture is gray colored, then it will have a yellow-gray color.
If you want to make the wall texture with plain yellow color, then use this:
PHP код:
SetDynamicObjectMaterial(TestColor,0,18646, "MatColours", "yellow",0);
Or "brighter" yellow (with vertex lightning disabled):
PHP код:
SetDynamicObjectMaterial(TestColor,0,18646, "MatColours", "yellow",0xFFFFFFFF);
That texture is a plain yellow color, can be found in SAMP IMG, object id 18646 is the police light which is using MatColours texture.
There is also a plain white color texture, so you can color it with any color you like, just change the 0xFFFFFF00 (yellow).
PHP код:
SetDynamicObjectMaterial(TestColor,0,18646, "MatColours", "white",0xFFFFFF00);
Hope that helps.
Re: Object Material -
SickAttack - 21.12.2015
Quote:
Originally Posted by RoboN1X
You meant with 0.0 rotation values, also that's material text, and font name is Arial.
However i'm not sure why need to convert it when it's coded directly... I don't think moving the last two alpha value is a hard job. Except you are lazy or will get confused, then using macros like _Zume said will do it.
Anyway if you want to make the wall with yellow color but texture stay same, then use this:
PHP код:
SetDynamicObjectMaterial(TestColor,0,-1, "none", "none",0xFFFFFF00);
Note that since the original texture is gray colored, then it will have a yellow-gray color.
If you want to make the wall texture with plain yellow color, then use this:
PHP код:
SetDynamicObjectMaterial(TestColor,0,18646, "MatColours", "yellow",0);
Or "brighter" yellow (with vertex lightning disabled):
PHP код:
SetDynamicObjectMaterial(TestColor,0,18646, "MatColours", "yellow",0xFFFFFFFF);
That texture is a plain yellow color, can be found in SAMP IMG, object id 18646 is the police light which is using MatColours texture.
There is also a plain white color texture, so you can color it with any color you like, just change the 0xFFFFFF00 (yellow).
PHP код:
SetDynamicObjectMaterial(TestColor,0,18646, "MatColours", "white",0xFFFFFF00);
Hope that helps.
|
I meant a
coordinate close/near-by/near 0.0, 0.0, 0.0. Don't get confused here.
You could use any font name, wouldn't make a difference - even putting "SA-MP Forums" wouldn't make a difference. No. Text. Is. Going. To. Be. Displayed. Anyway.
The macro/conversion is so that he doesn't get confused and it's easier for him to use any color
in the world.
He could also use "SetDynamicObjectMaterialText", it pretty much does the same thing, but he would basically just be putting to use the background color option and he wouldn't have to specify any textures. It will use a solid color form.
Meaning he would do (by also removing unnecessary used fields placed above):
pawn Код:
new object_id = CreateDynamicObject(2922, 133.76311, -75.74743, 1.13980, 0.00000, 0.00000, 0.00000);
SetDynamicObjectMaterialText(object_id, 0, " ", OBJECT_MATERIAL_SIZE_256x128, " ", 0, 0, 0, (0xFFF000FF >>> 8 | 0xFFF000FF << 24));
Or:
pawn Код:
new object_id = CreateDynamicObject(2922, 133.76311, -75.74743, 1.13980, 0.00000, 0.00000, 0.00000);
SetDynamicObjectMaterialText(object_id, 0, " ", OBJECT_MATERIAL_SIZE_256x128, " ", 0, 0, 0, 0xFFFFF000);
Output:
Re: Object Material -
RoboN1X - 21.12.2015
Quote:
Originally Posted by SickAttack
I meant a coordinate close/near-by/near 0.0, 0.0, 0.0. Don't get confused here.
You could use any font name, wouldn't make a difference - even putting "SA-MP Forums" wouldn't make a difference. No. Text. Is. Going. To. Be. Displayed. Anyway.
The macro/conversion is so that he doesn't get confused and it's easier for him to use any color in the world.
He could also use "SetDynamicObjectMaterialText", it pretty much does the same thing, but he would basically just be putting to use the background color option and he wouldn't have to specify any textures. It will use a solid color form.
Meaning he would do (by also removing unnecessary used fields placed above):
pawn Код:
new object_id = CreateDynamicObject(2922, 133.76311, -75.74743, 1.13980, 0.00000, 0.00000, 0.00000); SetDynamicObjectMaterialText(object_id, 0, " ", OBJECT_MATERIAL_SIZE_256x128, " ", 0, 0, 0, (0xFFF000FF >>> 8 | 0xFFF000FF << 24));
Or:
pawn Код:
new object_id = CreateDynamicObject(2922, 133.76311, -75.74743, 1.13980, 0.00000, 0.00000, 0.00000); SetDynamicObjectMaterialText(object_id, 0, " ", OBJECT_MATERIAL_SIZE_256x128, " ", 0, 0, 0, 0xFFFFF000);
Output:

|
Ofcourse i'm aware that will work, that's why i didn't mention "it will not work", but please note that you cannot have alpha value changed with object material text, i don't know why, but my method will work
And i also mentioned that except it might get confused, then using macro will do.
It's just that he said he is new with that thing, so i think it's better to point out why that and this (text, texture, macro, etc), so i explained why it's still dark/black, although you seems to be helping him the most of time but i don't think only him will try to learn in this sa-mp forums, eventually other people are new to this will search and found this thread. But however now you have explained it, so now that's good.
Re: Object Material -
Vince - 21.12.2015
Coloring an object works pretty much the same as dying clothes or plastic: you can always turn a color darker, but you cannot make it lighter. I.e. you can't color black objects. Coloring will only give the desired result if the original object is white to begin with.
Re: Object Material -
TwinkiDaBoss - 21.12.2015
Aha I think I understand now, altho didnt know that there are "MatColours". Thanks a lot for the assistance guys!
Highly appreciated! +rep to yall!