Jump to content

OnReplaceComplete event algorith


JeViCo

Recommended Posts

Is there any way to recreate event that would trigger when the model replacement was finished successfull?

My score is to create a small delay between each model replacement. Models consume different amount of time so i can't rely on timers. If i loop through a hundred of models in a row i'll 100% get "not enough memory" error.

Link to comment
  • Moderators
24 minutes ago, JeViCo said:

Is there any way to recreate event that would trigger when the model replacement was finished successfull?

Align the loading process with your FPS. Every time you load a mod, the next frame will have to wait until the mod has been loaded. So technically onClientRender is telling you when a new mod can be loaded, but not when the mod has been loaded, except when the loading process takes longer than your next frame is ready to be drawn.

 

See this topic for my recommendations:

 

+

The draw-distance resource you have liked, is making use of a similar mechanism which you could also play around with. It doesn't use onClientRender, but instead it uses getTickCount to process tasks within a given time.

https://gitlab.com/IIYAMA12/draw-distance/-/blob/master/scripts/main_c.Lua

@JeViCo

  • Thanks 1
Link to comment

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...