Jump to content

Xeon06

Members
  • Posts

    9
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Xeon06's Achievements

Newbie

Newbie (4/54)

0

Reputation

  1. Wow that does wonders. Thanks a lot!
  2. Hey folks, I'm trying to draw 3D lines around various vehicles, using dxDrawLine3D. For now I'm just trying to draw a line in front of the vehicle. I'm using some basic trig, with the distances and angles hardcoded (and that's fine, I won't need to do it with many different types of vehicles). Here is what I have: addEventHandler("onClientRender", getRootElement(), function() local veh = getPedOccupiedVehicle(getLocalPlayer()) if (not veh) then return end local vx, vy, vz = getElementPosition(veh) local vrx, vry, vrz = getElementRotation(veh) local a1 = 100 local a2 = 80 local dist = 2.5 local x1 = vx + math.cos((vrz + a1) * (math.pi / 180)) * dist local y1 = vy + math.sin((vrz + a1) * (math.pi / 180)) * dist local z1 = vz local x2 = vx + math.cos((vrz + a2) * (math.pi / 180)) * dist local y2 = vy + math.sin((vrz + a2) * (math.pi / 180)) * dist local z2 = vz dxDrawLine3D(x1, y1, z1, x2, y2, z2, 0xFFFF0000, 10) dxDrawText(tostring(x) .. "\n" .. tostring(y) .. "\n" .. tostring(z) .. "\n" .. tostring(vrx) .. "\n" .. tostring(vry) .. "\n" .. tostring(vrz), 300, 0) end ) This works fine, and the line follows the vehicle's yaw and stays out front. My problem is with the z component of the line. I need to find a way to combine the pitch and the roll of the vehicle to get the line to stay perfectly in sync with the vehicle in whatever rotation it is. I can get either the pitch or roll to work, but can't for the life of me figure out how to combine the two. I basically need to get a 3D line to draw always between the two front headlights, following the vehicle rotation. Does anyone know how I can achieve that? Thanks.
  3. Hey all, I'm trying to change the color of the seats in the police cars using shaders. I took the example from the wiki, fixed a few errors and removed the part that modifies the colors. This resulted in the seats (and the lightbar because it's in the same texture) being pitch black. After a little debugging I noticed that if I commented out the line that multiplies the value by the diffuse in the pixel shader, the seat and lightbar are rendered in full bright. The problem would then be that the diffuse value I am getting is empty. Here is my code: addEventHandler("onClientResourceStart", getRootElement(), function() local shader, tech = dxCreateShader("test.fx") if not shader then outputChatBox("Could not create shader. Please use debugscript 3") else outputChatBox("Using technique " .. tech) local tex = dxCreateTexture("copcarla92interior128.png"); dxSetShaderValue(shader, "Tex0", tex); engineApplyShaderToWorldTexture(shader, "copcarla92interior128") end end ) texture Tex0; float4x4 World; float4x4 View; float4x4 Projection; float4x4 WorldViewProjection; float Time; sampler Sampler0 = sampler_state { Texture = (Tex0); }; struct VSInput { float4 Position : POSITION0; float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; struct PSInput { float4 Position : POSITION0; float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; PSInput VertexShaderExample(VSInput VS) { PSInput PS = (PSInput)0; PS.Position = mul(VS.Position, WorldViewProjection); PS.Diffuse = VS.Diffuse; PS.TexCoord = VS.TexCoord; return PS; } float4 PixelShaderExample(PSInput PS) : COLOR0 { float4 finalColor = tex2D(Sampler0, PS.TexCoord); //finalColor = finalColor * PS.Diffuse; //Commenting this line shows the texture in full bright return finalColor; } technique complex { pass P0 { VertexShader = compile vs_2_0 VertexShaderExample(); PixelShader = compile ps_2_0 PixelShaderExample(); } } technique simple { pass P0 { Texture[0] = Tex0; ColorOp[0] = SelectArg1; ColorArg1[0] = Texture; AlphaOp[0] = SelectArg1; AlphaArg1[0] = Texture; ColorOp[1] = Disable; AlphaOp[1] = Disable; } } Does anyone know what's up with the diffuse value? Am I doing something wrong? For some reason, it stays at 0. Thanks.
  4. I have the anims, but I'm wondering if it's possible (and how) to replace the default player aiming animation when right clicking with one of these anims.
  5. Hey folks, I was wondering if it was possible to use a two handed pistol stance animation for the player. I want that when the players use the standard pistol and they aim with it, that they use a similar stance to the one used when shooting the Desert Eagle. A bit . I figure the animation is already somewhere in the game, so it ought to be doable, but I can't figure a way to make it works.Thanks!
  6. Thanks for the answers folks. What I think I'm gonna do is replace a vehicle I won't use by the modded Buffalo texture. I will also give it the Buffalo model and handling, so I will effectively have two Buffalos models, one with the custom texture and the other one will be the "normal" Buffalo. That should work right?
  7. But that only works for the cars moddable in Archangel right?
  8. Hey guys, I was wondering whether it was possible to apply a TXD texture to only certain vehicles, not every vehicle of a specific model. I've found the functions that allow for model-wide application, but nothing for just a few vehicles. I want to have some Buffalos with a certain TXD skin and the rest to act like "normal" Buffalos with colors and all. Thanks.
×
×
  • Create New...