[General] best practice for mod developers?

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

[General] best practice for mod developers?

by sapier » Fri Jan 06, 2012 22:24

When updating my server I regularly get in trouble about not even knowing what version of a mod I'm just running. I thought about it and had some ideas to improove this. Probably someone has ideas too or thinks I'm wrong so please post your opinion!

I do suggest as best practice for every mod:

1) Mod has a unique name
2) each release of a module has a unique version number
3) on load print module name and version number
3) (optional) custom version number printed on load for mods not modified by original author

Having module version number available in minetest eg by /modinfo might be good too. But this might need changes in minetest.
DON'T mention coding style!
(c) sapier all rights reserved
 

robin
Member
 
Posts: 22
Joined: Mon Jan 02, 2012 15:53

by robin » Fri Jan 06, 2012 22:30

Better write yourself a tool to compare states

1) data/mods/<modname>
2) hash over the all files
3) no need
4) generate list of all recipes
5) generate list of all nodes/crafts/etc
6) compare recipes/nodes/crafts/etc for duplicates.
 

User avatar
Hackeridze
Member
 
Posts: 310
Joined: Thu Nov 03, 2011 13:35

by Hackeridze » Fri Jan 06, 2012 22:36

robin wrote:Better write yourself a tool to compare states

1) data/mods/<modname>
2) hash over the all files
3) no need
4) generate list of all recipes
5) generate list of all nodes/crafts/etc
6) compare recipes/nodes/crafts/etc for duplicates.

+1
My game: RTMG
GENTOO USER
 

sapier
Member
 
Posts: 763
Joined: Tue Aug 16, 2011 18:17

by sapier » Fri Jan 06, 2012 23:04

good idea too

4) generate list of all recipes
5) generate list of all nodes/crafts/etc
6) compare recipes/nodes/crafts/etc for duplicates.


should be done by minetest on load of module craft/node/item registration ... at least in my oppinion
DON'T mention coding style!
(c) sapier all rights reserved
 

Baŝto
New member
 
Posts: 9
Joined: Fri Jan 06, 2012 13:46

by Baŝto » Mon Jan 09, 2012 08:42

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
modname = {}
modname.name = "modname"
modname.version = "0.00"
modname.modpath = dump(minetest.get_modpath("modname"))
print("mod '"..modname.name.."' v"..modname.version.." loaded at "..modname.modpath)
 

User avatar
redcrab
Member
 
Posts: 831
Joined: Tue Dec 13, 2011 13:45

by redcrab » Mon Jan 09, 2012 10:48

sapier wrote:When updating my server I regularly get in trouble about not even knowing what version of a mod I'm just running. I thought about it and had some ideas to improove this. Probably someone has ideas too or thinks I'm wrong so please post your opinion!

I do suggest as best practice for every mod:

1) Mod has a unique name
2) each release of a module has a unique version number
3) on load print module name and version number
3) (optional) custom version number printed on load for mods not modified by original author

Having module version number available in minetest eg by /modinfo might be good too. But this might need changes in minetest.


+1 it's a good practice for mod developper

-may be also, a lua API to register a lua function that provide full mod name and version, by this way any player may request the mods list and/or get a the full name and description of a particular mod , on-line.
-may be also the mod provide the doc, for detailed description, for nodes and recipe ... doc reachable by the minetest client.
0.4 for serious builder click here
Dedicated Minetest redcrab server forum at http://minetestbb.suret.net

It's nice to be important but it is more important to be nice.
 


Return to WIP Mods

Who is online

Users browsing this forum: No registered users and 9 guests

cron