Load of modules vs rest of profile

Post Reply
DevArrah
Posts: 51
Joined: Sat Oct 29, 2011 4:57 pm

Load of modules vs rest of profile

Post by DevArrah »

So i have a bunch of mudlet modules that serve as the foundation for the rest of the profile, think a common trigger base and library functions.

however, every time i fire up mudlet, the functions and triggers that call into the function library (module) fails to load because those library functions haven;'t loaded yet. It appears as though the load order is profile -> modules.

Is there someway to jigger the load order so it loads all my modules first then the rest of the profile?

User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: Load of modules vs rest of profile

Post by Vadi »

What I do is have my modules raise an event when they are loaded, and make anything that uses them load off that event.

phasma
Posts: 191
Joined: Sat Aug 03, 2013 7:00 pm
Discord: phasma#4694

Re: Load of modules vs rest of profile

Post by phasma »

Yeah, pretty much what Vadi said. I posted a method on one of the other threads that you're welcome to use. In short, though, I hook onto sysLoadEvent and run a lfs.attributes() check against the system core file. If it does not exist, I raise an event, 'Serenity Installer' in this instance. If it does, then I raise 'Serenity Loader' instead.

User avatar
keneanung
Site Admin
Posts: 94
Joined: Mon Mar 21, 2011 9:36 am
Discord: keneanung#2803

Re: Load of modules vs rest of profile

Post by keneanung »

Vadi wrote:What I do is have my modules raise an event when they are loaded, and make anything that uses them load off that event.
Question to this approach: What happens if the module that is used finishes loading, before the using part gets a chance to register the callback?

User avatar
Vadi
Posts: 5041
Joined: Sat Mar 14, 2009 3:13 pm

Re: Load of modules vs rest of profile

Post by Vadi »

The callbacks are registered via the Mudlet interface, not the function. Haven't seen any issues with this setup wherever the module is.

Also technically speaking, 'modules' are pretty much always loaded last after all the profile stuff. It is packages that get moved about.

Post Reply