Quantcast

Jump to content

» «
Photo

[C#] Why a lot of particles don't work?

11 replies to this topic
thelorizz
  • thelorizz

    Player Hater

  • Members
  • Joined: 04 Aug 2017
  • Italy

#1

Posted 04 August 2017 - 04:02 PM Edited by thelorizz, 04 August 2017 - 04:03 PM.

Hello guys, I'm trying to find a particle that resembles the NFS Nitro Bloom Light Effect, but I can't proceed because 80% of the particles don't work.

 

I'm trying with the "ptfx_fire_v2" from the "core" group and that's my code:

void EmitsLoopedParticles(Vehicle vehicle)
    {
        if (vehicle != null)
        {
            int ex1 = Function.Call<int>(Hash.GET_ENTITY_BONE_INDEX_BY_NAME, vehicle, "exhaust");
            Vector3 ex1p = Function.Call<Vector3>(Hash.GET_WORLD_POSITION_OF_ENTITY_BONE, vehicle, ex1);

            float yPitch = Function.Call<float>(Hash.GET_ENTITY_PITCH, vehicle);

            Function.Call(Hash.REQUEST_NAMED_PTFX_ASSET, "core");
            if (Function.Call<bool>(Hash.HAS_NAMED_PTFX_ASSET_LOADED, "core"))
            {
                Function.Call(Hash._SET_PTFX_ASSET_NEXT_CALL, "core");
                int fireHandle = Function.Call<int>(Hash.START_PARTICLE_FX_LOOPED_AT_COORD, "ptfx_fire_v2", ex1p.X, ex1p.Y, ex1p.Z, yPitch, 0.0f, vehicle.Heading - 90.0f, 50.0f, false, false, false, false);
            }
        }
    } 

And don't tell me that's a code problem because if I put the "scr_carsteal5_car_muzzle_flash" from the "scr_carsteal4" it works PERFECTLY.


CamxxCore
  • CamxxCore

    Mark Chump

  • Members
  • Joined: 19 Oct 2013
  • Canada

#2

Posted 04 August 2017 - 05:42 PM

Use a proper list of particles. For some reason those old lists contain 50% things that aren't actually particles. I've released an entire dump of all the fx but people still want to use those old and incomplete lists for some reason... Look in the documentation section or go here: http://camx.me/gtav/ptxfx/ptfx.txt

thelorizz
  • thelorizz

    Player Hater

  • Members
  • Joined: 04 Aug 2017
  • Italy

#3

Posted 04 August 2017 - 05:53 PM

But as I said, they don't work, I don't know why what am I doing wrong


sollaholla
  • sollaholla

    C# Dev.

  • Members
  • Joined: 19 May 2016
  • United-States

#4

Posted 04 August 2017 - 09:56 PM

But as I said, they don't work, I don't know why what am I doing wrong

He just told you. Use the list that Camxx provided.


thelorizz
  • thelorizz

    Player Hater

  • Members
  • Joined: 04 Aug 2017
  • Italy

#5

Posted 05 August 2017 - 03:23 PM

 

But as I said, they don't work, I don't know why what am I doing wrong

He just told you. Use the list that Camxx provided.

 

I just discovered that I need to use the LOOPED along with EVOLUTION on some fxs, and NON_LOOPED on others, thanks


Aktarus
  • Aktarus

    Player Hater

  • Members
  • Joined: 21 Aug 2017
  • United-Kingdom

#6

Posted 3 weeks ago

 

 

But as I said, they don't work, I don't know why what am I doing wrong

He just told you. Use the list that Camxx provided.

 

I just discovered that I need to use the LOOPED along with EVOLUTION on some fxs, and NON_LOOPED on others, thanks

 

 

What do you mean by "use the LOOPED along with EVOLUTION on some fxs, and NON_LOOPED on others"?


sollaholla
  • sollaholla

    C# Dev.

  • Members
  • Joined: 19 May 2016
  • United-States

#7

Posted 3 weeks ago

What do you mean by "use the LOOPED along with EVOLUTION on some fxs, and NON_LOOPED on others"?

SET_PARTICLE_FX_LOOPED_EVOLUTION
http://www.dev-c.com...f0c4b5b1c393be2

START_PARTICLE_FX_NON_LOOPED_ON_ENTITY
http://www.dev-c.com...d53a3b8da0809d2

START_PARTICLE_FX_LOOPED_ON_ENTITY
http://www.dev-c.com...ae42c1660fd6517


Aktarus
  • Aktarus

    Player Hater

  • Members
  • Joined: 21 Aug 2017
  • United-Kingdom

#8

Posted 3 weeks ago Edited by Aktarus, 3 weeks ago.

 

What do you mean by "use the LOOPED along with EVOLUTION on some fxs, and NON_LOOPED on others"?

SET_PARTICLE_FX_LOOPED_EVOLUTION
http://www.dev-c.com...f0c4b5b1c393be2

START_PARTICLE_FX_NON_LOOPED_ON_ENTITY
http://www.dev-c.com...d53a3b8da0809d2

START_PARTICLE_FX_LOOPED_ON_ENTITY
http://www.dev-c.com...ae42c1660fd6517

 

 

Yes I saw these functions but I didn't get the difference between them (especially the "evolution" one). And above all, when to use one over another.


sollaholla
  • sollaholla

    C# Dev.

  • Members
  • Joined: 19 May 2016
  • United-States

#9

Posted 3 weeks ago

Yes I saw these functions but I didn't get the difference between them (especially the "evolution" one). And above all, when to use one over another.

Ohhh okay. Well, the evolution one simply sets the "strength" of the particle. For example, on a Jet, the flame increases depending on how much you accelerate. So setting the evolution to 1.0 would make the flame fully extended.
Looped-on-entity is for particles you want to loop forever, and it returns a particle handle.
Nonlooped is just the opposite of looped, it just plays once.

  • Aktarus likes this

Aktarus
  • Aktarus

    Player Hater

  • Members
  • Joined: 21 Aug 2017
  • United-Kingdom

#10

Posted 3 weeks ago

 

Yes I saw these functions but I didn't get the difference between them (especially the "evolution" one). And above all, when to use one over another.

Ohhh okay. Well, the evolution one simply sets the "strength" of the particle. For example, on a Jet, the flame increases depending on how much you accelerate. So setting the evolution to 1.0 would make the flame fully extended.
Looped-on-entity is for particles you want to loop forever, and it returns a particle handle.
Nonlooped is just the opposite of looped, it just plays once.

 

 

That's a perfect and very clear explanation! :cool:

Thank you

 

ps: I am waiting for you on the other thread. :whistle:

  • sollaholla likes this

nm710
  • nm710

    None

  • Members
  • Joined: 15 Aug 2016
  • United-States

#11

Posted 18 hours ago

Use a proper list of particles. For some reason those old lists contain 50% things that aren't actually particles. I've released an entire dump of all the fx but people still want to use those old and incomplete lists for some reason... Look in the documentation section or go here: http://camx.me/gtav/ptxfx/ptfx.txt

I know that all of these are from "core" asset, but how do you find ptfx for other assets? I have relied on the lists others have provided and I tested countless particle effects to find working ones, but I would really love to know how to do it myself. 


CamxxCore
  • CamxxCore

    Mark Chump

  • Members
  • Joined: 19 Oct 2013
  • Canada

#12

Posted 8 hours ago

 

Use a proper list of particles. For some reason those old lists contain 50% things that aren't actually particles. I've released an entire dump of all the fx but people still want to use those old and incomplete lists for some reason... Look in the documentation section or go here: http://camx.me/gtav/ptxfx/ptfx.txt

I know that all of these are from "core" asset, but how do you find ptfx for other assets? I have relied on the lists others have provided and I tested countless particle effects to find working ones, but I would really love to know how to do it myself.

 

 
Well I did make a semi- complete dump of most particles (look in the documentation section). As far as doing it yourself, there isn't really a clean way, so to say. Ideally we would have some kind of YPT viewer or even better, OpenIV support for those files. Personally, I have just been dumping the assets at runtime using some hacky code:

 

https://gist.github....9310bd580268aae

https://gist.github....478f09e82f0c924





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users