General > Developers Corner

Any way to force autorun priorities?

(1/2) > >>

iViscosity:
So after some research and it seems that the lua loading priority is

--- Code: ---lua/autorun
lua/autorun/server|client
addons/lua/autorun
addons/lua/autorun/server|client
gamemode/

--- End code ---

Is there any way to force an addon to load AFTER a specific addon has loaded? I was thinking of making them all under a function and if the addon it's waiting for isn't defined yet, wait a few seconds then re-execute the function once it has.

MrPresident:
I believe that addons are loaded in alphabetical order. Try renaming your addon directories so that they're ordered in the way you would like. Or you could number them.

garrysmod/addons/1.ULib/
garrysmod/addons/2.ULX/
garrysmod/addons/3.Pointshop/
garrysmod/addons/4.OtherAddonExample/


etc etc etc.

Not 100% sure this would work, but it might.

Keep in mind the way the filesystem orders numbers.

12 might come before 2.

example:

0
1
11
12
2
3
4
5
6
7
8
9

JamminR:
Been a long time since I've seen this discussed. 3-4 years ago now for sure, it was alphabetical, especially in linux where upper case and lower case were sorted differently. (I forget, think uppercase was before lower)

Unfortunately, there's no way to rename workshop subscriptions to meet your order need.

MrPresident:
If it was that important, you could extract workshop addons and convert them to legacy addons.

iViscosity:
It isn't incredibly important, but it could be useful. I learned that for my purposes it wasn't necesary because it doesn't use other addons on autorun, but during certain hooks (that happen after the server is already running)

Navigation

[0] Message Index

[#] Next page

Go to full version