Open IstuntmanI opened 7 years ago
I don't see how this makes sense in the Streamer plugin, it would fit better in a new plugin.
It is already fixed in at least fixes.inc, maybe YSF as well.
Yeah, it is fixed in fixes.inc for regular scripts, but Streamer Plugin 's Dynamic Actors still have the preloading bug which should be fixed in that way too.
The server scripter should decide to fix this.
You putting this in the plugin would have to tell us so we can remove the duplicate preloading in our scripts. It's already in the widely used fixes.inc.
I'm not sure if I'm missing something or you are missing something. Actors are created everytime when they get streamed for a player, which means that the animations aren't preloaded for them at that moment, so we would need some kind of OnActorCreated
function to apply the animation to them correctly, as the first internal ApplyActorAnimation
function call would just preload the animation. Maybe I'm overthinking this and doing something wrong. It's weird that actors need animations preloading. When I tested it with a friend the whole preloading animation thing gave me logic issues, haha (as I described in the first post).
http://wiki.sa-mp.com/wiki/ApplyActorAnimation:
Oh, weird, afaik fixes.inc isn't doing this.
Oh. Well it's pretty easy to fix, since fixes already does this for normal animations.
If the fix is indeed the one listed on wiki, then it will be way easier to fix it inside this plugin (well, mostly because it will use less memory when we have lots of actors doing animations).
https://github.com/Open-GTO/sa-mp-fixes/blob/master/fixes.inc#L1011
AFAIK it does ^^^
The animation has to be loaded for the SA-MP player, not the SA-MP actor.
anjay stuntman
As you may know, applying an animation for the first time isn't working, it has to be preloaded. It works simply by applying it twice for the player, even if another player gets streamed in afterwards (I just tested this, my logic tells me that this is weird, looks like it isn't actually a client-sided problem. If it was it wouldn't show up for the player which didn't have you streamed in when you preloaded it, but it would show up only for you).
My suggestion is to fix this inside the streamer plugin, just like it does with few other SA-MP bugs (I can only remember about the checkpoints size bug right now, which was easy to fix). Not sure if it regularly works simply by applying it twice to the actor, even if no player has the actor streamed-in, but Streamer Plugin is constantly creating and deleting the same actor when it gets streamed in to a player or streamed out for every player, so it would need constant reapplying twice.
Snippets, for C++, for regular actors:
Instead of the regular
sampgdk::ApplyActorAnimation
after the actor is created, it should call the function from above I guess. Also, when the actor gets destroyed the preloaded animations bitset should be.reset( )
. (or, to save memory, maybe it should reapply an animation twice everytime it gets changed ?)Not sure if it actually needs a delay (timer) between preloading and actually applying it, but this is how fixes.inc does it (it probably won't be preloaded if there's no delay, due to how data is sent, but this may be different for actors). Maybe @ziggi or @Y-Less know more about animations on actors, especially in our case ?
A little discussion about this: