Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 08/11/20 in all areas

  1. I don't really see how this would work over http but I'll look into modules. Thanks.
    1 point
  2. To be clear, there are two versions of GTATools, the one for a previous Blender version, and one with a updated API for 2.79. I had this issue way back too, but i learned how to properly edit GTA SA animations this way: When you're done doing a pose for the animation, add the pose to the timeline via the Key "i" , you can either add it as "Rotation", "BBone Shape" or "Available" (Available only appears if you're doing a pose on top of a existing frame, which will not cause any errors as well) adding a pose with any other option from that menu that isnt the three i mentioned makes the error appear. Be careful, if you get animation bugs in-game like; CJ with no mouth and eyebrows and/or other skins having their belly messed up, you need to add start and end frames to the Jaw, Eyelids, Toes and Belly because their timeline of frames are separate from the rest of the bones, they have their own timeline. You dont need to pose them, just select the bones i told you and add their frames to their timeline via one of the three methods i mentioned and you're good to go. If you still have any questions, dont hesistate to ask. PS: Delete a keyframe you added with other options that were not added with "Available", "BBone shape" or "Rotation" or else you'll still get the error 252, you can select all bones via pose mode and copy paste the pose so you wont have to redo it from scratch. PS(2): You can also view GTA Vice City animations with GTATools and export them to GTA SA. Here's a picture with my own custom pose in-game.
    1 point
  3. I have hacked together a little HLSL sample script for you. It is up to you to actually implement indicator light logic to this: indicatorshader.fx texture Tex0; float4x4 World; float4x4 View; float4x4 Projection; float4x4 WorldViewProjection; float Time; sampler Sampler0 = sampler_state { Texture = (Tex0); }; struct VSInput { float3 Position : POSITION; float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; struct PSInput { float4 Diffuse : COLOR0; float2 TexCoord : TEXCOORD0; }; struct VSOutput { PSInput psInput; float4 Position : POSITION; }; VSOutput PassthroughVS(VSInput input) { VSOutput output; output.psInput.Diffuse = input.Diffuse; output.psInput.TexCoord = input.TexCoord; //-- Transform vertex position (You nearly always have to do something like this) output.Position = mul(float4(input.Position, 1), WorldViewProjection); return output; } float4 IndicatorMultiply(PSInput input) : COLOR0 { return float4(1, 1, 0, 1); } technique indicators { pass P0 { VertexShader = compile vs_2_0 PassthroughVS(); PixelShader = compile ps_2_0 IndicatorMultiply(); } }; client.Lua local vehicleTXD = engineLoadTXD("car.txd"); engineImportTXD(vehicleTXD, 400); local vehicleDFF = engineLoadDFF("car.dff", 400); engineReplaceModel(vehicleDFF, 400); local shader = dxCreateShader("indicatorshader.fx"); outputChatBox("Loaded indicator lights shader and car model!"); for m,n in ipairs(getElementsByType("vehicle")) do if (getElementModel(n) == 400) then engineApplyShaderToWorldTexture(shader, "p", n); engineApplyShaderToWorldTexture(shader, "l", n); end end As you can see the script uses the Landstalker vehicle as an example. Just spawn a Landstalker and start the resource. You should see the indicator lights in yellow color. Take a look at the MTA wiki to find out more about shaders. You can find really cool effects over there!
    1 point
  4. function callFunctionWithSleeps(calledFunction, ...) local co = coroutine.create(calledFunction) --we create a thread coroutine.resume(co, ...) --and start its execution end function sleep(time) local co = coroutine.running() local function resumeThisCoroutine() --since setTimer copies the argument values and coroutines cannot be copied, co cannot be passed as an argument, so we use a nested function with co as an upvalue instead coroutine.resume(co) end setTimer(resumeThisCoroutine, time, 1) --we set a timer to resume the current thread later coroutine.yield() --we pause the execution, it will be continued when the timer calls the resume function end -----------example----------- function pauseExample(a, b, c) outputChatBox("Started the execution. a value: "..tostring(a)) sleep(5000) outputChatBox("Waited 5 seconds. b value: "..tostring(b)) sleep(5000) outputChatBox("Waited 10 seconds, finishing the execution. c value: "..tostring(c)) end callFunctionWithSleeps(pauseExample, 1, 2, 3) Not tested, but should work. Keep in mind, however, that this exact implementation won't display errors within the called function, because coroutine.resume returns the error as a string instead of propagating it to the caller.
    1 point
×
×
  • Create New...