Page 1 of 1

[0.4.8] Schematic API usage change

PostPosted: Mon Aug 05, 2013 03:21
by hmmmm
** N.B. This is of interest to anybody using raw schematic specifiers with minetest.place_schematic, or setting a -1 probability in a probability list passed to minetest.create_schematic - if you do not fix this, your mod will break! **

Hello modding community,

Those of you who have used the Schematics API probably realize that the way node probabilities work currently are unintuitive and inconsistent: 0 probability means the node is always placed, -1 means it is never placed, but you can't set a -1 probability with a raw schematic specifier, so the node name needs to be ignore instead, etc.
This, however, is going to be fixed with a new Minetest Schematic version. MTS version 1 files can still be used just fine; MTS version 2 files (schematics created as of this patch) cannot be used with older versions, though.
With the change, a value of 0 now means a 0% chance of a node occuring, and a value of 255 now means the node always occurs. -1 is not valid any longer when being passed along to the probability list in minetest.create_schematic, and "ignore" should not be used to signify that a node is never placed at that position when using raw schematic data.
This change may be somewhat inconvenient, but it is done in the modder's best interest.
Just a reminder, upstream Minetest is *unstable*, and the modding API can (and sometimes does) change within the time before an offical release is made.

PostPosted: Mon Aug 05, 2013 04:14
by Temperest
Personally, I am not a fan of ignore not being, well, ignored. It's a good node to use as a placeholder. Other than that, the changes to probability sound like they will be much more consistent, which I am totally in favor of.

Then again, my only experiences with using schematics were (ab)using them to make WorldEdit faster, since VoxelManipulators don't give access to param2 values. All in all, a good idea.

PostPosted: Mon Aug 05, 2013 06:55
by sfan5
Seems good.
However, is there a way to detect which version the schematic api currently supports?
If not I'd suggest adding a flag to minetest.features

PostPosted: Wed Aug 07, 2013 21:13
by meweb
How do you get this version?

PostPosted: Sun Aug 11, 2013 18:52
by hmmmm
Temperest wrote:Then again, my only experiences with using schematics were (ab)using them to make WorldEdit faster, since VoxelManipulators don't give access to param2 values.

Can you give me some solid examples of cases where you'd need to edit the param2 value?

sfan5 wrote:Seems good.
However, is there a way to detect which version the schematic api currently supports?
If not I'd suggest adding a flag to minetest.features

I do not want modders to add two separate versions of this call.
Since everybody who used schematic apis is actively developing their mods, I would hope everybody just changes their code. If this causes problems for an end user, simply tell them to update to the newest version of your own mod, and to upgrade from an unstable development branch of minetest to 0.4.8.


Anyway, I decided to proceed with this change.

PostPosted: Sun Oct 20, 2013 02:26
by Johnyknowhow
I can't wait until MT 0.4.8 comes out,

PostPosted: Sun Oct 20, 2013 08:39
by Dan Duncombe
Johnyknowhow wrote:I can't wait until MT 0.4.8 comes out,

Use one of the 0.4.7-dec versions, they are the most up to date and basically ARE 0.4.8

PostPosted: Sun Nov 17, 2013 21:27
by Johnyknowhow
Dan Duncombe wrote:
Johnyknowhow wrote:I can't wait until MT 0.4.8 comes out,

Use one of the 0.4.7-dec versions, they are the most up to date and basically ARE 0.4.8


ive always asked this,

HOW ON EARTH DO I GET 0.4.7-DEC VERSIONS!??!?!!??!!?!?!?!?!?!!?!?!?!?!?!!?!?!?!?
ლ(ಠ_ಠლ)