In this example project you will create a simple particle effect from start to finish. You will set up the effect, add emitters, configure keyframes, and then preview the result in different modes.
Right-click in the node graph, search for "ParticleDrawModel", and connect its output to the "ParticleRule" node using the "Draw Command" slot.
Right-click in the node graph, search for "ParticleDrawable", and connect its output to the "ParticleDrawModel" node using the "Drawables" slot.
Click the Drawables tab, right-click on "ptfx_model_snow/ptfx_model_snow" and select the collection under "Copy To".
Click the Mesh dropdown menu in the "ParticleDrawable" node and search for "Snow" to select the "ptfx_model_snow_copy" mesh.
If there are no meshes present this means that Catalyst could not load the game’s core.ypt. Restart Catalyst and specify the game installation path in the locate-game dialog (see Pointing Catalyst at Your Game).
<name>_legacy.ypt and <name>_enhanced.ypt.Only collections with their export checkbox ticked in the library panel are exported.
Create a FiveM resource to stream the exported particle asset:
In your server's resources folder, create a new folder for the resource (e.g. my-particles).
Inside it, create a stream folder and place the exported .ypt file there. If you exported for Enhanced, use a stream_enhanced folder instead so the asset only loads for enhanced clients.
Create an fxmanifest.lua file in the resource root with the following contents:
fx_version 'cerulean'
game 'gta5'
client_script 'client.lua'
In the resource root (next to fxmanifest.lua), create a client.lua file and paste the code below. It registers a ptfx_test command that spawns the effect at your player's position. Set dict to the name of your exported ypt file and effect to the name of your ParticleEffectRule.
RegisterCommand("ptfx_test", function(src, args, raw)
local dict = "new_collection" -- name of ypt file
local effect = "new_effect2" -- name of the ParticleEffectRule
RequestNamedPtfxAsset(dict)
while not HasNamedPtfxAssetLoaded(dict) do
Wait(0)
end
local playerCoord = GetEntityCoords(PlayerPedId())
UseParticleFxAssetNextCall(dict)
local handle = StartParticleFxLoopedAtCoord(effect, playerCoord.x, playerCoord.y, playerCoord.z, 0.0, 0.0, 0.0, 1.0, false, false, false, 0)
end, false)
Rename "new_collection" to the name of your exported ypt file and "new_effect2" to the name of your ParticleEffectRule.
Add ensure my-particles to your server.cfg (matching your resource folder name) to automatically load your resource when the server starts.
Start or restart the server (or run ensure my-particles / restart my-particles in the server console) so the new client.lua is loaded.
Join the server and run /ptfx_test in the chat. The particle effect should spawn at your player's position.