Open lfshr opened 3 years ago
Hey, you might be better off, opening a PR or asking in the discord for a better response. Also, your best bet would be to check if there is anything in the natives relating to this.
We can definitely add this. If you plan on PRing this, make sure you write your class methods in camelCase
It should be a pretty quick job. If you aren't, I will try to find time this week.
We should probably add the respective method for an entity inside the entity's class (ped, vehicle), instead of in a Task
class to keep the pattern of "this thing only belongs to a vehicle, so it's part of the vehicle object"
Hey, you might be better off, opening a PR or asking in the discord for a better response. Also, your best bet would be to check if there is anything in the natives relating to this.
Hey Marco. This issue is really just here to have a bit of a design discussion before pressing buttons.
We can definitely add this. If you plan on PRing this, make sure you write your class methods in camelCase
It should be a pretty quick job. If you aren't, I will try to find time this week.
We should probably add the respective method for an entity inside the entity's class (ped, vehicle), instead of in a
Task
class to keep the pattern of "this thing only belongs to a vehicle, so it's part of the vehicle object"
All tasks are applied to a Ped
in the natives afaik.
I was looking at the C# wrapper and there's natives to drive a Vehicle to a certain coordinate etc. But for sequences, yes that's probably only peds. Not 100% sure on that
I was looking at the C# wrapper and there's natives to drive a Vehicle to a certain coordinate etc. But for sequences, yes that's probably only peds. Not 100% sure on that
I think just copy the C# stuff entirely. So we'll also get the added benefit of adding arbitrary Task
abstractions to fivem-js as well.
So we could do both a sequence, like above, as well as:
myPed.Task.GoTo(target);
Let me know if the above commit is the wanted structure. It should perform as explained, but I haven't tested it. PlayAnimation
isn't as flexible as C#'s implementation right now (requires defining all parameters yourself).
Looks good! Going to go ahead and close this off.
If you @lfshr or anyone else wanting to use TaskSequence's and such could please test this in the next fivem-js version, please? Would like it to be according to your needs
Is your feature request related to a problem? Please describe. Add equivalent of C#
TaskSequence
class (https://github.com/citizenfx/fivem/blob/747e5a4c9645726bfb5f283321218d80304692e3/code/client/clrcore/External/Tasks.cs#L472-L552)Describe the solution you'd like
Additional context This is more of a discussion issue before I start typing things.