Jump to content

RiceEatingGuy

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by RiceEatingGuy

  1. Oh... Thanks. EDIT: Is it possible to make something like this (two textures): objects = { {..., worldtex = "sam_camo" and "bonyrd_skin2", tex = "texture1.png" and "texture3.png"}, {..., worldtex = "bonyrd_skin2" and "sam_camo", tex = "texture2.png" and "texture4.png"} } OLD: Does it make sense if coordinates are like this: objects = { {x = 0, y = 0, z = 6, rx = 90, ry = 0 , rz = 0}, {x = 10, y = 0, z = 6, rx = 90, ry = 0 , rz = 0} } or this: objects = { {x = 0.0000, y = 0.0000, z = 6.0000, rx = 90.0000, ry = 0.0000, rz = 0.0000}, {x = 10.0000, y = 0.0000, z = 6.0000, rx = 90.0000, ry = 0.0000, rz = 0.0000} } ? I also think that you made mistake here: local object = createObject(..., v.xr,v.xy,v.xz) Shouldn' t it be like this? local object = createObject(..., v.rx, v.ry, v.rz) Anyways, thanks everyone.
  2. EDIT: I think I fixed it. Do you see any mistakes or have any advices? objects = { {model = 3095, x = 0.0000, y = 0.0000, z = 6.0000, rx = 90.0000, ry = 0.0000 , rz = 0.0000, tex = "texture1.png", worldtex = "sam_camo"}, {model = 3095, x = 10.0000, y = 0.0000, z = 6.0000, rx = 90.0000, ry = 0.0000 , rz = 0.0000, tex = "texture2.png", worldtex = "bonyrd_skin2"} } addCommandHandler("toggle", function() for i, v in pairs (objects) do object = createObject(objects[i].model, objects[i].x, objects[i].y, objects[i].z, objects[i].rx, objects[i].ry, objects[i].rz, false) myShader = dxCreateShader("shader.fx") myTexture = dxCreateTexture(objects[i].tex, "dxt5") dxSetShaderValue(myShader, "gTexture", myTexture) engineApplyShaderToWorldTexture(myShader, objects[i].worldtex, object) end end ) OLD: objects = { {model = 3095, x = 0.0000, y = 0.0000, z = 6.0000, rx = 90.0000, ry = 0.0000 , rz = 0.0000}, {model = 3095, x = 10.0000, y = 0.0000, z = 6.0000, rx = 90.0000, ry = 0.0000 , rz = 0.0000} } addCommandHandler("toggle", function() for i, v in pairs (objects) do object = createObject(model, x, y, z, rx, ry, rz, false) end end ) Thanks, but I don' t really get it. What' s wrong with createObject script? I tried it in many other ways, but that doesn' t work.
  3. lua: local myobject = createObject ( ... local myshader = dxCreateShader("effect_file.fx") local mytexture = dxCreateTexture("mytexture.png", "dxt5") dxSetShaderValue( myshader,"gTexture", mytexture) engineApplyShaderToWorldTexture( shader, "texturename", myobject ) effect: texture gTexture; technique TexReplace { pass P0 { Texture[0] = gTexture; } } Thanks, but how to apply two different textures to two objects? I get same texture on both objects.
  4. Well, I tried something... The problem is that it loads just one texture. client.lua addCommandHandler("toggle", function() local myShader = dxCreateShader("shader.fx") local object1 = createObject (3095, 0.0000, 0.0000, 6.0000, 90.0000, 0.0000, 0.0000) local myTexture1 = dxCreateTexture("texture1.png") dxSetShaderValue(myShader, "Tex0", myTexture1) engineApplyShaderToWorldTexture(myShader, "sam_camo", object1) local object2 = createObject (3095, 10.0000, 0.0000, 6.0000, 90.0000, 0.0000, 0.0000) local myTexture2 = dxCreateTexture("texture2.png") dxSetShaderValue(myShader, "Tex0", myTexture2) -- It doesn' t work. It loads myTexture1 engineApplyShaderToWorldTexture(myShader, "bonyrd_skin2", object2) end ) meta.xml shader.fx (copied from wiki) I also downloaded mta-helper.fx
  5. Thanks. Could you explain to me how to use it or give an example?
  6. Hey, is it possible to set different textures for objects with same model id? If yes, please explain me how to do that. Thanks.
×
×
  • Create New...