Jump to content

Cyber14

Members
  • Posts

    25
  • Joined

  • Last visited

Everything posted by Cyber14

  1. Ok you were right. I analyzed the code and createObject() function works really quickly. My problem was connected with adding textures to all of this models on client-side (im using "UV scripted" resource from this site https://wiki.multitheftauto.com/wiki/Shader_examples) Maybe now @thisdp 's solution will have sense for loading shaders a bit slower?
  2. What about the face? How to have more than one face available per skin?
  3. I have no any problems with custom objects. I know It can be weird but I tested how long it takes to load objects with and without replacing models and it turned out that objects without replacing loaded faster.. Even when I create objects with no custom objects and then I run resource which replaces models it doesn't take more than 1-2 seconds to replace all models. I would like to add that I have about 3.000 objects to create on my server. In that case I will check solution with onClientRender event.
  4. Hi. I have a lot of objects on my server, all of them are created by server-side createObject() function on resource start but there is one problem with that. When someone connects to my server and the resource is started, the player have to wait a lot for objects loading. (It takes about 1 minute) So in order to reduce this time I moved some objects to other dimensions but It didnt give an effect. Now I have a question. Im going to change the way of creating objects. Im thinking about creating objects client-side and creating only this objects which actually are in the same dimension as the player is. When the player changes dimension, objects in previous dimension will be deleted and new objects from proper dimension will be created. Is that the good idea or there is any better solution?
  5. Hi, Im looking for shader whichch makes the object transparent and looking like window. This is what I have found: But there is no download link Somebody knows where can I find it?
  6. @Mr.Loki i did it on line 19 and It works but not as I wanted
  7. @Mr.Loki I tried to use your code by combining it with UV Scripted and the texture was white and my texture-image wasnt even visible. How can I change the color and which color format should I use? (I think that float4(1,1,1,1); is not "rgba" representation because it wasnt work) And can I make this color a bit transparent? This is my code (its from the file uv_scripted.fx because I have changed only this one): // // Example shader - uv_scripted.fx // #include "include/tex_matrix.fx" /////////////////////////////////////////////////////////////////////////////// // Global variables /////////////////////////////////////////////////////////////////////////////// texture gOrigTexure0 : TEXTURE0; texture gCustomTex0 : CUSTOMTEX0; float2 gUVPrePosition = float2( 0, 0 ); float2 gUVScale = float( 1 ); // UV scale float2 gUVScaleCenter = float2( 0.5, 0.5 ); float gUVRotAngle = float( 0 ); // UV Rotation float2 gUVRotCenter = float2( 0.5, 0.5 ); float2 gUVPosition = float2( 0, 0 ); // UV position float4 tColor = float4(1,1,1,1); // color /////////////////////////////////////////////////////////////////////////////// // Functions /////////////////////////////////////////////////////////////////////////////// //------------------------------------------- // Returns UV transform using external settings //------------------------------------------- float3x3 getTextureTransform() { return makeTextureTransform( gUVPrePosition, gUVScale, gUVScaleCenter, gUVRotAngle, gUVRotCenter, gUVPosition ); } /////////////////////////////////////////////////////////////////////////////// // Techniques /////////////////////////////////////////////////////////////////////////////// technique hello { pass P0 { // Set the texture Texture[0] = gCustomTex0; // Use custom texture // Set the UV thingy TextureTransform[0] = getTextureTransform(); // Enable UV thingy TextureTransformFlags[0] = Count2; MaterialDiffuse = tColor; MaterialEmissive = tColor; DiffuseMaterialSource = Material; EmissiveMaterialSource = Material; NormalizeNormals = TRUE; // FillMode = WIREFRAME; // AlphaBlendEnable = TRUE; ColorOp[0] = SELECTARG1; ColorArg1[0] = Diffuse; AlphaOp[0] = SELECTARG1; AlphaArg1[0] = Diffuse; Lighting = true; } }
  8. Hi im using "UV scripted" shader to set textures to my objects but im wondering if I can set texture color in MTA using shaders? This method is possible in SAMP by setting the "materialcolor" parametr using the SetObjectMaterial function. I would like to use it like changing the texture scale in UV Scripted, its just: dxSetShaderValue ( myShader, "gUVScale", 1, 1); and the scale changes. I would like to have something like this dxSetShaderValue ( myShader, "gUVColor", 255, 0, 0); for red color. Does anyone know how to do it?
  9. I am just used to using materials from GTA SA to decorate the buildings, stuffs, etc. Thats all what Im gonna do.
  10. @Mr.Loki So the only one solution to use GTA SA materials is to extract and upload the whole gta3.img file to png images and using shaders?
  11. Hi, Im wondering if there in MTA is any possibility of changing the object texture (on each index) like in the SAMP (in SAMP this function is called SetObjectMaterial). I know that I can use shader for that (its called "UV scripted") and using this shader I can apply images to the specified object on specified index but it forces me to upload images on my server and make it weight so much if I wanna have a lot of materials. So my question is - Can I use GTA SA materials for that, not only uploaded images?
  12. @AlexRazor Could you tell me how can I do that? (URL to some tutorial, etc.)
  13. I have just edited the house object from GTA SA in 3ds max. Everything was good untill the night came.. This is how my model looks like in the night: (Its brighter than normal objects outside blue cricle) And when we have the day it looks good: DFF file was exported by KAM's script. Anyone knows how to get rid of this problem?
  14. @TEDERIs You are right, when I used TXD Workshop 5.0 it worked for me too. It turns out that the newest TXD Workshop version has some problems with that. Thanks for help to everybody, my problem is solved!
  15. @TEDERIs Try here: https://www.dropbox.com/s/7r8v8ew9rsbhj2m/CAMERA.rar?dl=0 (You dont have to create an account here you can just close the message and download the file)
  16. @TEDERIs Maybe this link will auto-download the right file https://www73.zippyshare.com/d/adVsokr6/26753/CAMERA.rar
  17. @TEDERIs I have sent it some posts above, but here it is: https://www73.zippyshare.com/v/adVsokr6/file.html (DFF/TXD files are in the "done" folder)
  18. I did it and its still black. @TEDERIs I have uploaded the another TXD file which (0,0) point was blue and the camera was still black.
  19. So isn't it possible to just drag the image on the model and have it done withour configuring UVs?
  20. As you can see after TXD replacement I have a "cam" TXD in the table. Im uploading my 3ds max project file + texture PNG file and files which I have done: https://www73.zippyshare.com/v/adVsokr6/file.html
  21. So what can I do now? It works in 3ds max as I have shown on my pictures earlier.
  22. I changed the order to look like this: addEventHandler ( "onClientResourceStart", getResourceRootElement ( getThisResource() ), function () txd = engineLoadTXD ( "cam.txd" ) if (engineImportTXD ( txd, 1237 )) then outputChatBox ( "TXD => TRUE") else outputChatBox ( "TXD => FALSE") end dff = engineLoadDFF ( "cam.dff" ) if(engineReplaceModel ( dff, 1237 )) then outputChatBox ( "DFF => TRUE") else outputChatBox ( "DFF => FALSE") end col = engineLoadCOL( "cam.col" ) if(engineReplaceCOL( col, 1237 )) then outputChatBox ( "COL => TRUE") else outputChatBox ( "COL => FALSE") end end) But now the camera object is black: Without the TXD replace function it's white as I show at beginning.
  23. Hi, Im trying to import some objects from GTA IV to my MTA Server. I watched some videos and in result I made dff, col and txd file. When I uploaded it to my server the object model was exactly like I want it to be. The collision was working fine too, but the object texture was blank - it looks like the same with the txd file teplaced and without the txd file replaced, so I think that the problem is with this file. I was trying to find a solution but it didnt give an effect. For better clarity I'm explaining how I add an material to the object. https://imgur.com/a/laikQkp - Please read the descriptions of the images, start reading from the bottom of the page. Please help me and dont know what am I doing wrong.
×
×
  • Create New...