Author Topic: What line would one use to wait for another add-on to load first?  (Read 1480 times)

I really need to know how since my add-on uses slayer and if slayer doesn't load first then it glitches. So far I've just had to make it wait 20 seconds. Which works for now but what if a player had loads of add-ons, then it might not save the day...

A big thank you to anyone who knows how to do this. (I used to know but I haven't touched torque for 6 months so I'm very rusty)

Technically when it comes to waiting, 0 MS would be enough. All add-ons load in a blocking manner, and schedule will always round up to the next frame. So this is enough:

schedule(0, 0, ...);

You may want to consider explicitly loading the add-on from your add-on with forceRequiredAddOn instead, however.

Thanks for that, It seems to work a lot better now.

You should use forceRequiredAddOn("Gamemode_Slayer").

You should use forceRequiredAddOn("Gamemode_Slayer").

Doesn't that just make a message popup if you don't have it? Or does it wait for it to load first?

Doesn't that just make a message popup if you don't have it? Or does it wait for it to load first?
This execs the file named as "Gamemode_Slayer", it's useful if your add-on requires something that's inside that file. It also helps from duplicating datablocks. You can make a check to see if it doesn't exist, that way if it doesn't it would return the code.