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. Introduction Particles and lights are found many places in the game. Cars has corona lights for their tail, brake and headlights, exhaust fumes and tire smoke. These are effects and can help boost the atmosphere. Adding these effects can be done with ease, however, those who wish to use specific tools may have to incorporate more tools to transfer the data between files. This guide aims to introduce GTA modders to 2d billboard effects (lights, splashes) and particles through use of 3ds Max and relevant tools. To get started, user must obtain a selection of programs and 3D scripts available from this topic: Kam's 2018 scripts, The Hero's RW importer/exporter (optional if using for object export; harder), Dexx's 2dfx export script, RWanalyze and tools for setting up texture files. Table of Contents Working with lights using Kam's 2018 script Working with lights and particles using RW script (and Kam's 2018 for data exporting) Common uses of 2dfx Working with lights using Kam's 2018 script The upgraded Kam's script has an in-built 2dfx tool for quickly adding lights to models. Below is presented a step-step guide on adding a blinking light to a cone ID 1238. Import trafficcone.dff from gta3.img using the Kam's 2018 script importer. Navigate to Create Panel > Lights > Standard > Omni Light. Spawn one at the top of the cone. Link the Omni to the model, so it is a child of the model. As seen on the image below, expand '2DFX' on the script GUI. With the Omni selected, click 'Get'. Now the light parameters can be set to the user's likings. Below is a detailed explanation of config. Once done, select model and the child light and click Export to DFF. Time to test! The following config and export settings are ideal but may be adjusted to individual user's preferences: Each setting explained: Presets: presets for easy setup of lights Set to selected lights: needs be clicked each time changes has been made to a light. Get: copies the selected light's information, allowing one to paste that onto other lights. Color: the color of the light. Corona size: the size of the physical corona light. Draw distance: distance in which the light can be seen from (in SA units). Light range: distance in which the light illuminates peds and vehicles. Corona name: light texture e.g traffic light, blood splatter, corona star. Show mode: enable for flashing and other effects. Reflection: gives the effect of the sun shining into a lens when looking at the light source. Shadow size: the size of the round transparent shadow. Shadow distance: the distance in which the shadow can be seen (e.g if object is 100 meters above surface, the shadow can be seen if set to 105 units) Shadow multiplier: intensity of the shadow. Shadow name: defines which texture is used for the shadow. Flags: defines light properties. Working with lights and particles using RW script (and Kam's 2018 for data exporting) Lights method The steps presented in Kams method needs be followed with export included. On 3ds Max with the RW version of the model (with Omni Light) ready, export the model with its child Omni Light using RW script. The RW version does not need any specific light data, it just needs a regular Omni Light as placeholder. The reason for having Kam's DFF version available is that it contains data that can be extracted from the Kam's file and imported into the RW file. With Kam's DFF and RW DFF in a folder, open RWanalyze. Open the Kam's DFF and spot the section named "2dfx [xxx bytes @ xxxxx] - [0x253F2F8]". To proceed, right click the highlighted section > Export Section Data (ctrl + e) > select project folder and name as 'cone'. Now, open the RW version and find the same section located approximately in same order in the hierarchy containing a Bin Mesh PLG. To proceed, right click the highlighted section > Add section > [0x253F2F8] 2dfx > Right click the new section > Import section data > Find and select 'cone' > save file. Particles method For adding particles to the model, Dexx's 2dfx tool is introduced to the user. This method is not tool specific and works with both KAM and RW exporters. In this case RW exporter is used. With the RW model in 3ds Max, go to Create Tab > Helpers > Dummy > create one at the top of the cone. Link it to the model so that it's the child of the model. Start Dexx tool. Click 'Add Particle Info (Dummy)'. Expand 'Setup / Edit Particles'. In 'Particle System' select 'Fire'. Click 'Apply to Dummy(s)'. Expand 'Export Effect Info'. Click 'Export Info' with only the dummy selected, not the model. Export to project folder and name file as 'fire'. Export the model with the dummy included. Now with RWanalyze, open the DFF that was exported and find the following section. To proceed, right click the highlighted section, click 'Add section' and find [0x253F2F8] 2dfx. Right click the newly generated section and click 'Import section data'. Find the file 'fire' and on RWanalyze click save. The model now contains a fire from the top of the cone. Common uses of 2dfx In GTA SA, lights and particles can be integrated into models regardless if they're world objects or vehicles. Thus it opens up a whole level and opportunities for modelers to improve visuals of their models. A few uses are compiled below. Street lamps Fireplaces Cars Sirens Fire simulations Structure lighting Aircraft blinking lights Traffic lights Fountains Cement mixers Farming utilities The possibilities are endless, although the rendering limits of corona images is 32. This explains why the Pyramid in Las Venturas has 8 lights on each 4 corners.
    1 point
  5. 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...