before.txt in mods and *#

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

before.txt in mods and *#

by rubenwardy » Mon Sep 16, 2013 18:34

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.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Mon Sep 16, 2013 19:13

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.
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Mon Sep 16, 2013 19:40

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.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Tue Sep 17, 2013 08:10

Mod 2 has before.txt = "Mod 1?"

Load Order:
Mod 2
Mod 1
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Tue Sep 17, 2013 09:36

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
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Tue Sep 17, 2013 09:46

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.
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Sep 17, 2013 11:55

What would be the benefit if this?
 

User avatar
jojoa1997
Member
 
Posts: 2890
Joined: Thu Dec 13, 2012 05:11

by jojoa1997 » Tue Sep 17, 2013 13:18

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.
Coding;
1X coding
3X debugging
12X tweaking to be just right
 

User avatar
PilzAdam
Member
 
Posts: 4026
Joined: Fri Jul 20, 2012 16:19
GitHub: PilzAdam
IRC: PilzAdam

by PilzAdam » Tue Sep 17, 2013 14:43

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?
 

User avatar
Zeg9
Member
 
Posts: 608
Joined: Fri Sep 21, 2012 11:02

by Zeg9 » Tue Sep 17, 2013 15:27

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.
I made a few (a lot of?) mods for minetest: here is a list.
See also the MT-Faithful texture pack (work in progress).
 

User avatar
LionsDen
Member
 
Posts: 525
Joined: Thu Jun 06, 2013 03:19

by LionsDen » Tue Sep 17, 2013 16:47

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.
 

Nore
Member
 
Posts: 468
Joined: Wed Nov 28, 2012 11:35
GitHub: Ekdohibs

by Nore » Tue Sep 17, 2013 17:58

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.
 

User avatar
rubenwardy
Member
 
Posts: 4500
Joined: Tue Jun 12, 2012 18:11
GitHub: rubenwardy
IRC: rubenwardy
In-game: rubenwardy

by rubenwardy » Wed Sep 18, 2013 08:11

Most functions in minetest.* are defined in cpp, or built in.

My mod debugger overrides some functions.
Last edited by rubenwardy on Wed Sep 18, 2013 08:12, edited 1 time in total.
 


Return to Minetest Features

Who is online

Users browsing this forum: No registered users and 34 guests

cron