julionib Posted May 4, 2015 Share Posted May 4, 2015 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, nothingMethods 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 Link to comment Share on other sites More sharing options...
Sp0rks Posted May 10, 2015 Share Posted May 10, 2015 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 Link to comment Share on other sites More sharing options...
julionib Posted May 10, 2015 Author Share Posted May 10, 2015 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 Link to comment Share on other sites More sharing options...
skomski Posted May 10, 2015 Share Posted May 10, 2015 (edited) 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 May 10, 2015 by skomski julionib 1 Link to comment Share on other sites More sharing options...
julionib Posted May 10, 2015 Author Share Posted May 10, 2015 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 Link to comment Share on other sites More sharing options...
julionib Posted May 10, 2015 Author Share Posted May 10, 2015 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 Link to comment Share on other sites More sharing options...
julionib Posted May 10, 2015 Author Share Posted May 10, 2015 (edited) 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) Edited May 10, 2015 by julionib Link to comment Share on other sites More sharing options...
Sp0rks Posted May 10, 2015 Share Posted May 10, 2015 (edited) 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 May 11, 2015 by Sp0rks Link to comment Share on other sites More sharing options...
Rugz007 Posted May 11, 2015 Share Posted May 11, 2015 so anyone can give me example for .net scripthook? Link to comment Share on other sites More sharing options...
julionib Posted May 11, 2015 Author Share Posted May 11, 2015 (edited) 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 sizethis 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 May 11, 2015 by julionib Link to comment Share on other sites More sharing options...
Rugz007 Posted May 11, 2015 Share Posted May 11, 2015 Can you tell the names of natives you used? Link to comment Share on other sites More sharing options...
julionib Posted May 11, 2015 Author Share Posted May 11, 2015 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 Rugz007 1 Link to comment Share on other sites More sharing options...
willywill Posted May 17, 2015 Share Posted May 17, 2015 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 Link to comment Share on other sites More sharing options...
julionib Posted May 17, 2015 Author Share Posted May 17, 2015 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 Link to comment Share on other sites More sharing options...
willywill Posted May 17, 2015 Share Posted May 17, 2015 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! Link to comment Share on other sites More sharing options...
julionib Posted May 18, 2015 Author Share Posted May 18, 2015 i used the particle effect "scr_alien_teleport" from "scr_rcbarry1" Link to comment Share on other sites More sharing options...
c39687 Posted May 19, 2015 Share Posted May 19, 2015 im trying to add smoke to my rocket launcher if anyone can help... julionib, have you found anything for this? https://www.youtube.com/watch?v=OAbmnv23Xbg Link to comment Share on other sites More sharing options...
julionib Posted May 19, 2015 Author Share Posted May 19, 2015 wow thats cool, i will check if i find something, i saw a particle effect for rocket/missile once Link to comment Share on other sites More sharing options...
c39687 Posted May 19, 2015 Share Posted May 19, 2015 (edited) 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 May 19, 2015 by c39687 Link to comment Share on other sites More sharing options...
julionib Posted May 19, 2015 Author Share Posted May 19, 2015 (edited) maybe you can use this one: asset: "scr_agencyheistb"ptfx: "scr_agency3b_proj_rpg_trail" obs.: some effects only appear when the entitymoves Edited May 19, 2015 by julionib c39687 1 Link to comment Share on other sites More sharing options...
c39687 Posted May 19, 2015 Share Posted May 19, 2015 (edited) ok great, i will test and report back (have to wait a few hours), thank you Edited May 19, 2015 by c39687 Link to comment Share on other sites More sharing options...
c39687 Posted May 20, 2015 Share Posted May 20, 2015 (edited) 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 May 20, 2015 by c39687 Link to comment Share on other sites More sharing options...
julionib Posted May 20, 2015 Author Share Posted May 20, 2015 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) Link to comment Share on other sites More sharing options...
c39687 Posted May 21, 2015 Share Posted May 21, 2015 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 Link to comment Share on other sites More sharing options...
flynhigh09 Posted May 24, 2015 Share Posted May 24, 2015 (edited) 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 "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 May 24, 2015 by flynhigh09 julionib, Jitnaught and ffzero58 3 Link to comment Share on other sites More sharing options...
Vrock_wave Posted June 3, 2015 Share Posted June 3, 2015 (edited) 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 June 3, 2015 by Vrock_wave Link to comment Share on other sites More sharing options...
julionib Posted June 3, 2015 Author Share Posted June 3, 2015 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 Link to comment Share on other sites More sharing options...
ffzero58 Posted June 3, 2015 Share Posted June 3, 2015 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. Link to comment Share on other sites More sharing options...
Vrock_wave Posted June 3, 2015 Share Posted June 3, 2015 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 ........ Link to comment Share on other sites More sharing options...
ffzero58 Posted June 3, 2015 Share Posted June 3, 2015 (edited) 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 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 June 3, 2015 by ffzero58 c39687, ChOcOsKiZo, flynhigh09 and 3 others 6 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now