Page 1 of 1

before.txt in mods and *#

PostPosted: Mon Sep 16, 2013 18:34
by rubenwardy
Before.txt

I am not sure how easy this is to code into the engine, but mods could have before.txt in their mod folder, which acts like depends.txt, but makes that mod load before the selected mods.

Wildcards

Also, it could be good to add *# wildcard support for example:

Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
Code: Select all
food*?


Summary
These are not that important additions, as most mods will not use them.

PostPosted: Mon Sep 16, 2013 19:13
by PilzAdam
Ehm, mods in depends.txt are loaded before the mod. You can also use "?" to not depend on the mod, but just load them first.

PostPosted: Mon Sep 16, 2013 19:40
by jojoa1997
PilzAdam wrote:Ehm, mods in depends.txt are loaded before the mod. You can also use "?" to not depend on the mod, but just load them first.
I think he means haveing the mod load before others in the file. In mod 1 you have it say default in before.txt and mod 1 will load before default. But i dont think it could work because what if mod 2 befores mod 1 but depends on mod 3. and mod 3 depends on 1 but befores 2. Then none of them can load.

PostPosted: Tue Sep 17, 2013 08:10
by rubenwardy
Mod 2 has before.txt = "Mod 1?"

Load Order:
Mod 2
Mod 1

PostPosted: Tue Sep 17, 2013 09:36
by jojoa1997
rubenwardy wrote:Mod 2 has before.txt = "Mod 1?"

Load Order:
Mod 2
Mod 1

ok that is fine but what if mod 3 befores 2 but depends on 1

PostPosted: Tue Sep 17, 2013 09:46
by rubenwardy
jojoa1997 wrote:
rubenwardy wrote:Mod 2 has before.txt = "Mod 1?"

Load Order:
Mod 2
Mod 1

ok that is fine but what if mod 3 befores 2 but depends on 1


The it is dealt in the same way as 1 depends on 2, and 2 depends on 1.

PostPosted: Tue Sep 17, 2013 11:55
by PilzAdam
What would be the benefit if this?

PostPosted: Tue Sep 17, 2013 13:18
by jojoa1997
The only benefit is you could call a mod with a name you want instead of 0~~~~~ if you want the mod too
Load first.

PostPosted: Tue Sep 17, 2013 14:43
by PilzAdam
jojoa1997 wrote:The only benefit is you could call a mod with a name you want instead of 0~~~~~ if you want the mod too
Load first.

Yes, but whats the benefit of loading your mod first?

PostPosted: Tue Sep 17, 2013 15:27
by Zeg9
PilzAdam wrote:
jojoa1997 wrote:The only benefit is you could call a mod with a name you want instead of 0~~~~~ if you want the mod too
Load first.

Yes, but whats the benefit of loading your mod first?

Maybe he tries to override a minetest.* function (is this possible?).
IIRC they do that in the craft guide mod.

PostPosted: Tue Sep 17, 2013 16:47
by LionsDen
If you want to override a function, wouldn't you have to have it load after the original function or else the original function would override it when it loads? I haven't tried to do this so I don't know but I have overridden some nodes and that is the order they need to be done in. First the original node loads and then my override loads overwriting the original node.

PostPosted: Tue Sep 17, 2013 17:58
by Nore
I see at least one use for that: once I wanted a mod that added tin to remove that silly bronze recipe, for that the mod had to load before default. The same thing can be used if one wants a mod to change a craft or delete a default node or change an ABM, that can't be done without that.

PostPosted: Wed Sep 18, 2013 08:11
by rubenwardy
Most functions in minetest.* are defined in cpp, or built in.

My mod debugger overrides some functions.