Quantcast
Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
    1. Welcome to GTAForums!

    1. GTANet.com

    1. GTA Online

      1. Los Santos Summer Special
      2. The Diamond Casino Heist
      3. Find Lobbies & Players
      4. Guides & Strategies
      5. Vehicles
      6. Content Creator
      7. Help & Support
    2. Red Dead Online

      1. Frontier Pursuits
      2. Find Lobbies & Outlaws
      3. Help & Support
    3. Crews

    1. Red Dead Redemption 2

      1. PC
      2. Help & Support
    2. Red Dead Redemption

    1. Grand Theft Auto Series

    2. GTA VI

      1. St. Andrews Cathedral
    3. GTA V

      1. Guides & Strategies
      2. Help & Support
    4. GTA IV

      1. The Lost and Damned
      2. The Ballad of Gay Tony
      3. Guides & Strategies
      4. Help & Support
    5. GTA San Andreas

      1. Guides & Strategies
      2. Help & Support
    6. GTA Vice City

      1. Guides & Strategies
      2. Help & Support
    7. GTA III

      1. Guides & Strategies
      2. Help & Support
    8. Portable Games

      1. GTA Chinatown Wars
      2. GTA Vice City Stories
      3. GTA Liberty City Stories
    9. Top-Down Games

      1. GTA Advance
      2. GTA 2
      3. GTA
    1. GTA Mods

      1. GTA V
      2. GTA IV
      3. GTA III, VC & SA
      4. Tutorials
    2. Red Dead Mods

      1. Documentation
    3. Mod Showroom

      1. Scripts & Plugins
      2. Maps
      3. Total Conversions
      4. Vehicles
      5. Textures
      6. Characters
      7. Tools
      8. Other
      9. Workshop
    4. Featured Mods

      1. Design Your Own Mission
      2. OpenIV
      3. GTA: Underground
      4. GTA: Liberty City
      5. GTA: State of Liberty
    1. Rockstar Games

    2. Rockstar Collectors

    1. Off-Topic

      1. General Chat
      2. Gaming
      3. Technology
      4. Movies & TV
      5. Music
      6. Sports
      7. Vehicles
    2. Expression

      1. Graphics / Visual Arts
      2. GFX Requests & Tutorials
      3. Writers' Discussion
      4. Debates & Discussion
    3. Gangs

    1. Announcements

    2. Support

    3. Suggestions

julionib

[Q] Someone succeed using Start Particle FX methods?

Recommended Posts

julionib

Those days i was trying to figure out how to use the start_particle_fx_... methods but didn't find any combination that works.

I also tried changing the first param type (ptfx name) to "char *p0" instead of "Any *p0" but result still same, nothing

Methods that i tried:

 

GRAPHICS::START_PARTICLE_FX_LOOPED_ON_PED_BONE("cs_cig_exhale_mouth", playerPed, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 31086, 10.0, 0, 0, 0);//31086
GRAPHICS::START_PARTICLE_FX_NON_LOOPED_AT_COORD("scr_fam_door_smoke", pos.x, pos.y, pos.z, 0.0, 0.0, 0.0, 1.0, 0, 0, 0);
pos is player position:
Vector3 pos = ENTITY::GET_ENTITY_COORDS(playerPed, 1);
31086 seems to be the ped bone, this one would be close to head.
10.0 seems to be the size, in some cases R* use a hex value there: 0x3F800000

Share this post


Link to post
Share on other sites
Sp0rks

I'm also interested in this

 

from what I can gather reading through the scripts you need to run STREAMING::REQUEST_PTFX_ASSET() and ensure it is loaded with STREAMING::HAS_PTFX_ASSET_LOADED() before calling any GRAPHICS::START_PARTICLE_FX* native

 

however after hours of testing I am unable to get STREAMING::HAS_PTFX_ASSET_LOADED() to return anything besides 0 (False) which makes me wonder if REQUEST_PTFX_ASSET is dependent on the particular state the game is in, like it having assets (particle effects) for a particular mission loaded that it calls upon

 

HAS_PTFX_ASSET_LOADED also doesn't appear to be global as playing a cutscene with Michael smoking a cigarette this continues to return 0 (False) leaving me to believe it is only part of the subroutine/script loaded at that particular time

Share this post


Link to post
Share on other sites
julionib

yeah, here too, never was able to obtain true from that method, particle fx are really cool to use in mods, would be amazing make it work

Share this post


Link to post
Share on other sites
skomski

yeah I needed them for my jb700 script and reversed the functions.

 

the problem is STREAMING::HAS_PTFX_ASSET_LOADED() checks for the current script_name (thread + 0xD0) and than maps it via scriptfx.dat to the correct ptfx asset but since it always null in scripthook thread it always fails.

But they introduced natives to circumvent that problem:

 

First you need to use STREAMING::_REQUEST_PTFX_ASSET_BY_NAME (const char* name) (0xCFEA19A9) than STREAMING::_HAS_PTFX_ASSET_LOADED (const char* name) (0x9ACC6446).

One function was still unnamed and it is necessary to make the following particle function work: GRAPHICS::_set_ptfx_asset_next_call(const char* name) (0x6C38AF3693A69A91)

 

You can find a complete example at: https://github.com/gamebooster/gta5-lua-engine/blob/master/scripts/rocket_vehicle.lua (function names are a bit different because was to lazy to change but you get the idea)

Edited by skomski
  • Like 1

Share this post


Link to post
Share on other sites
julionib

yeah I needed them for my jb700 script and reversed the functions.

 

the problem is STREAMING::HAS_PTFX_ASSET_LOADED() checks for the current script_name (thread + 0xD0) and than maps it via scriptfx.dat to the correct ptfx asset but since it always null in scripthook thread it always fails.

But they introduced natives to circumvent that problem:

 

First you need to use STREAMING::_REQUEST_PTFX_ASSET_BY_NAME (const char* name) (0xCFEA19A9) than STREAMING::_HAS_PTFX_ASSET_LOADED (const char* name) (0x9ACC6446).

One function was still unnamed and it is necessary to make the following particle function work: GRAPHICS::_set_ptfx_asset_next_call(const char* name) (0x6C38AF3693A69A91)

 

You can find a complete example at: https://github.com/gamebooster/gta5-lua-engine/blob/master/scripts/rocket_vehicle.lua (function names are a bit different because was to lazy to change but you get the idea)

 

holly sh*t, will try this soon as possible, thx :)

Share this post


Link to post
Share on other sites
julionib

skomski where did you get the name "scr_carsteal4" to use in the ptfx asset calls? im trying to start ptfx from script barry1 but i was not able to determine the ptfx asset for it, i tried "scr_alien" without success, it cant load the asset, probably this is not the name. I tested with the names you used in your script and they work fine :)

Share this post


Link to post
Share on other sites
julionib

nevermind i found them lol, thank you very much, now i can start making some cool effects for my future mods:

 

Edit: Ignore the "Offline backup" name in the path (this is a backup i had here)

 

52978a9c79.png

Edited by julionib

Share this post


Link to post
Share on other sites
Sp0rks

thanks skomski, this is incredibly helpful

 

I spent nearly 3 hours playing around with this the other night, I was going to try the DLC PTFX natives next but figured I might be barking up the wrong tree so was only going to try when I had a bit of time

Edited by Sp0rks

Share this post


Link to post
Share on other sites
Rugz007

so anyone can give me example for .net scripthook?

Share this post


Link to post
Share on other sites
julionib

with latest scripthookv + latest scripthookv.net:

If GTA.Native.Function.Call(Of Boolean)(GTA.Native.Hash._0x8702416E512EC454, "scr_carsteal4") Then   GTA.Native.Function.Call(GTA.Native.Hash._0x6C38AF3693A69A91, "scr_carsteal4")   GTA.Native.Function.Call(Of Int32)(Native.Hash.START_PARTICLE_FX_NON_LOOPED_ON_ENTITY, "scr_carsteal5_car_muzzle_flash", Game.Player.Character, 0, 0, 0, 0, 0, 0, 3.5, 0, 0, 0)Else   GTA.Native.Function.Call(GTA.Native.Hash._0xB80D8756B4668AB6, "scr_carsteal4")End If

3.5 is the size

this will only work in second call because the request ptfx method is in the Else statement (GTA.Native.Function.Call(GTA.Native.Hash._0xB80D8756B4668AB6, "scr_carsteal4"))
if you call it before it probably will work in first call

Edited by julionib

Share this post


Link to post
Share on other sites
Rugz007

Can you tell the names of natives you used?

Share this post


Link to post
Share on other sites
julionib

Can you tell the names of natives you used?

 

they dont have names, its that hexadecimal value taht im calling, if you dont have this in your sripthook sdk it means you need to download it again to obtain latest version

  • Like 1

Share this post


Link to post
Share on other sites
willywill

I was able to get the particles working thanks to this post, but I'm having trouble understanding where to get the "sub" names from. I found the "scr_carsteal4" and all of those files but where do I find "scr_carsteal5_car_muzzle_flash" ?

 

Also how do I set the rotation and color of these particles?

 

Here is the C# version of what julio posted basically http://pastebin.com/fEs48XyT

Share this post


Link to post
Share on other sites
julionib

the "scr_carsteal5_car_muzzle_flash" was found in the decompiled scripts, hardest part is find the correct assets (in this case "scr_carsteal4") for each particle effect

Share this post


Link to post
Share on other sites
willywill

Ok thanks, also one last request, do you mind sharing how you spawned the particles in your recent video? They gave me an idea for a script and I'll make sure to give you credit for it thanks a lot!

Share this post


Link to post
Share on other sites
julionib

i used the particle effect "scr_alien_teleport" from "scr_rcbarry1"

Share this post


Link to post
Share on other sites
julionib

wow thats cool, i will check if i find something, i saw a particle effect for rocket/missile once

Share this post


Link to post
Share on other sites
c39687

ok great, im trying to search game scripts but it is very slow going :/ following the functions for where the resources are requested is tough

Edited by c39687

Share this post


Link to post
Share on other sites
julionib

maybe you can use this one:

 

asset: "scr_agencyheistb"
ptfx: "scr_agency3b_proj_rpg_trail"

 

obs.: some effects only appear when the entitymoves

Edited by julionib
  • Like 1

Share this post


Link to post
Share on other sites
c39687

ok great, i will test and report back (have to wait a few hours), thank you

Edited by c39687

Share this post


Link to post
Share on other sites
c39687

hey julionib, i tried this code but nothing, maybe the rpg object is invalid with this ptfx? I tested with LOOPED and NON_LOOPED...

                            //ptfx - this code runs when the rpgObject exists                            char* ptfxName = "scr_agencyheistb";                            while (STREAMING::HAS_NAMED_PTFX_ASSET_LOADED(ptfxName) == 0)                            {                                STREAMING::REQUEST_NAMED_PTFX_ASSET(ptfxName);                                set_status_text("WAITING FOR REQUESTED PTFX! :/");                                update_status_text();                                WAIT(0);                            }                            char* ptfxName2 = "scr_agency3b_proj_rpg_trail";                            GRAPHICS::_SET_PTFX_ASSET_NEXT_CALL(ptfxName);                            int ptfx = GRAPHICS::START_PARTICLE_FX_NON_LOOPED_ON_ENTITY((Any*)ptfxName2, rpgObject, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 10.0f, 0, 0, 0);

after this code i am applying force so the object is moving. No luck though. Maybe you can test?

Edited by c39687

Share this post


Link to post
Share on other sites
julionib

i tested with ped bone, this is how R* used this particle effect:

 

l_1bcf._f17 = GRAPHICS::START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_agency3b_proj_rpg_trail", (l_1bcf), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0x3f800000, 0, 0, 0);

l_1bcf its the Entity, probably a object

0x3f800000 its the size, but i believe you can keep using float value, just reduce to 2.0, 10.0 is too much

 

they created the object based on a weapon model:

l_1bcf = OBJECT::CREATE_OBJECT_NO_OFFSET(WEAPON::GET_WEAPONTYPE_MODEL(${ammo_rpg}), (l_1bcf._f5), 1, 1, 0);

probably that rocket model that we have in weapons (dont knoiw the name but already saw one)

Share this post


Link to post
Share on other sites
c39687

i tested with ped bone, this is how R* used this particle effect:

 

l_1bcf._f17 = GRAPHICS::START_PARTICLE_FX_LOOPED_ON_ENTITY("scr_agency3b_proj_rpg_trail", (l_1bcf), 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0x3f800000, 0, 0, 0);

 

l_1bcf its the Entity, probably a object

0x3f800000 its the size, but i believe you can keep using float value, just reduce to 2.0, 10.0 is too much

 

they created the object based on a weapon model:

 

l_1bcf = OBJECT::CREATE_OBJECT_NO_OFFSET(WEAPON::GET_WEAPONTYPE_MODEL(${ammo_rpg}), (l_1bcf._f5), 1, 1, 0);

 

probably that rocket model that we have in weapons (dont knoiw the name but already saw one)

ah ok, i tested 2.5f but maybe i will just reduce to 2.0f. Also, the rpg object model im using is "w_lr_rpg_rocket" i think i will try to search for this in the game scripts

Share this post


Link to post
Share on other sites
flynhigh09

Heres some fx particles ive found if anyone wants to use them theres way more just couple i found..

 

Some may not work unless moving or some may need tweaked in the name still but most should work fine

 

pd0AiL8.png

 

 

drlDzHP.png

"scr_mp_cig" "ent_anim_cig_smoke_car""scr_fbi4" "scr_fbi4_trucks_crash""scr_family4" "scr_fam4_trailer_sparks""scr_rcbarry2" "scr_clown_appears""scr_rcbarry1" "scr_alien_teleport" "scr_alien_disintegrate""scr_mp_house" "scr_sh_lighter_sparks" "scr_sh_lighter_flame""scr_agencyheistb" "scr_agency3b_elec_box""scr_agencyheist" "scr_fbi_mop_drips" "scr_fbi_mop_squeeze""scr_fbi5a" "scr_fbi5_ped_water_splash" "water_splash_ped_bubbles""scr_finalec2" "scr_finale2_blood_entry""scr_bigscore" "scr_bigscore_tyre_spiked""scr_mp_creator" "scr_mp_plane_landing_tyre_smoke""scr_fm_intro_cut_dev" "scr_mp_plane_landing_tyre_smoke""scr_minigamegolf" "scr_golf_ball_trail""scr_martin1" "scr_sol1_sniper_impact""core_snow" "cs_mich1_spade_dirt_throw""scr_michael2" "scr_abattoir_ped_sliced" "scr_mich2_blood_stab""scr_rcpaparazzo1" "scr_rcpap1_camera""scr_safehouse" "scr_sh_lighter_sparks" "scr_sh_lighter_flame""scr_familyscenem" "scr_meth_pipe_smoke"  "scr_reconstructionaccident" "scr_reconstruct_pipefall_debris" "scr_reconstruct_pipe_impact" "scr_sparking_generator""scr_reburials" "scr_burial_dirt""scr_recartheft" "scr_wheel_burnout""scr_rcpaparazzo1" "scr_rcpap1_camera""scr_recrash_rescue" "scr_recrash_rescue_fire""scr_paletoscore" "scr_paleto_banknotes" "cs_paleto_blowtorch""scr_trevor1" "scr_trev1_trailer_splash" "scr_trev1_trailer_boosh" "scr_trev1_trailer_wires" "scr_trev1_crash_dust" "scr_trev1_wheelspin_dirt""scr_oddjobtowtruck" "scr_ojtt_train_sparks""scr_oddjobtaxi" "scr_ojtaxi_hotbox_trail" "scr_ojtaxi_hotbox_trail""scr_solomon3" "scr_trev4_747_blood_impact" "scr_trev4_747_engine_debris""scr_exile3" "scr_ex3_water_dinghy_wash""scr_exile2" "scr_ex2_car_impact""scr_jewelheist" "scr_jew_biKe_burnout" "scr_jewel_cab_smash""scr_carsteal4" "scr_carsteal4_wheel_burnout" "scr_carsteal5_car_muzzle_flash"  "scr_carsteal5_tyre_spiked""scr_carsteal3" "scr_carsteal4_tyre_spiked"
Edited by flynhigh09
  • Like 3

Share this post


Link to post
Share on other sites
Vrock_wave
why the effect is only once if the command is intended for continuous playback ? and this effect on each comman with looped somebody got a loop?

START_PARTICLE_FX_LOOPED_AT_COORD("scr_alien_teleport", 2133.118652,4813.311523,41.195953, 0, 0, 0, 1, false, false, false, false)

Edited by Vrock_wave

Share this post


Link to post
Share on other sites
julionib

 

why the effect is only once if the command is intended for continuous playback ? and this effect on each comman with looped somebody got a loop?
START_PARTICLE_FX_LOOPED_AT_COORD("scr_alien_teleport", 2133.118652,4813.311523,41.195953, 0, 0, 0, 1, false, false, false, false)

 

 

lets say that R* is using "looped" as "start_ptfx", and "non_looped" as "trigger_ptfx", so, looped will return a ID so you can end it or apply changes to it, non_looped just will trigger the effect.

 

i believe the fact it loops or not is up to the PTFX if im not wrong

Share this post


Link to post
Share on other sites
ffzero58

Is there a way to reduce the size of the effect for GRAPHICS.START_PARTICLE_FX_NON_LOOPED_AT_COORD? 0x3F800000 seems to be the only value it accepts and I am not sure what it does.

Share this post


Link to post
Share on other sites
Vrock_wave

Is there a way to reduce the size of the effect for GRAPHICS.START_PARTICLE_FX_NON_LOOPED_AT_COORD? 0x3F800000 seems to be the only value it accepts and I am not sure what it does.

change it to its value 1.0 ........

Share this post


Link to post
Share on other sites
ffzero58

Playing with the alien transport effect is very interesting - especially when coupled with a hotkeyed teleport. After some fiddling with this effect, SET_ENTITY_ALPHA, and teleport - I have a pretty neat teleport effect. Something I quickly whipped together to see if it worked:

if(get_key_pressed(Keys.B)) then            ptfx = "scr_rcbarry1"            fx = "scr_alien_teleport"            fx_loop = 25            i=0            coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0, 0, 0)                        while (i<fx_loop) do                STREAMING.REQUEST_NAMED_PTFX_ASSET(ptfx)                GRAPHICS._SET_PTFX_ASSET_NEXT_CALL(ptfx)                GRAPHICS.START_PARTICLE_FX_NON_LOOPED_AT_COORD(fx, coords.x, coords.y, coords.z, 0.0, 0.0, 0.0, 0x3F800000, false, false, false)                i=i+1                wait(25)                print("Loop: " .. i)            end                        ENTITY.SET_ENTITY_ALPHA(playerPed, 0, false)                        wait(4000)                        ENTITY.SET_ENTITY_COORDS_NO_OFFSET(playerPed, 1747.0, 3273.7, 41.1 , false, false, true) --teleports you to the desert airfield            ENTITY.SET_ENTITY_ALPHA(playerPed, 0, false)            coords = ENTITY.GET_OFFSET_FROM_ENTITY_IN_WORLD_COORDS(playerPed, 0, 0, 0)                        wait(1000)                        i=0                        while (i<fx_loop) do                STREAMING.REQUEST_NAMED_PTFX_ASSET(ptfx)                GRAPHICS._SET_PTFX_ASSET_NEXT_CALL(ptfx)                GRAPHICS.START_PARTICLE_FX_NON_LOOPED_AT_COORD(fx, coords.x, coords.y, coords.z, 0.0, 0.0, 0.0, 0x3F800000, false, false, false)                i=i+1                wait(25)                print("Loop: " .. i)            end                        ENTITY.SET_ENTITY_ALPHA(playerPed, 255, false)        end

WOFI88Am.gif

Click to see the video.

 

Thanks for this research, I hope to find more effects. Feel free to use the above effect and tweak it. Maybe a mod can find use for it :)

 

Edit: Just realized it might also be in the decompiled scripts as well... oh well, I had fun scripting it.

Edited by ffzero58
  • Like 6

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • 1 User Currently Viewing
    0 members, 0 Anonymous, 1 Guest

×
×
  • Create New...

Important Information

By using GTAForums.com, you agree to our Terms of Use and Privacy Policy.