[0.4.8] Schematic API usage change

hmmmm
Member
 
Posts: 47
Joined: Tue Apr 02, 2013 04:04

[0.4.8] Schematic API usage change

by hmmmm » Mon Aug 05, 2013 03:21

** 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.
Last edited by hmmmm on Mon Aug 12, 2013 00:34, edited 1 time in total.
 

Temperest
Member
 
Posts: 651
Joined: Tue Nov 15, 2011 23:13
GitHub: Uberi

by Temperest » Mon Aug 05, 2013 04:14

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.
WorldEdit 1.0 released

The Mesecons Laboratory - the art of Mesecons circuitry
Latest article: Mesecons Basics.
 

User avatar
sfan5
Moderator
 
Posts: 3787
Joined: Wed Aug 24, 2011 09:44
Location: Germany
GitHub: sfan5
IRC: sfan5

by sfan5 » Mon Aug 05, 2013 06:55

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
Mods: Mesecons | WorldEdit | Nuke & Minetest builds for Windows (32-bit & 64-bit)
 

meweb
Member
 
Posts: 48
Joined: Wed Jun 05, 2013 16:44

by meweb » Wed Aug 07, 2013 21:13

How do you get this version?
 

hmmmm
Member
 
Posts: 47
Joined: Tue Apr 02, 2013 04:04

by hmmmm » Sun Aug 11, 2013 18:52

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.
 

User avatar
Johnyknowhow
Member
 
Posts: 358
Joined: Fri Sep 21, 2012 15:17
Location: Washington, USA
In-game: Minetestian

by Johnyknowhow » Sun Oct 20, 2013 02:26

I can't wait until MT 0.4.8 comes out,
I lost interest in Minetest for a couple of years and... I am still not really paying much attention. I rarely browse these forums anymore but it's nice to see old faces.

obligatory fancy signature goes here
 

User avatar
Dan Duncombe
Member
 
Posts: 904
Joined: Thu May 09, 2013 21:11
Location: In the unknown depths of Earth

by Dan Duncombe » Sun Oct 20, 2013 08:39

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
Some Mods: Castles Prefab Camouflage
My Games: Nostalgia Realtest Revamped
Servers: See above games.
 

User avatar
Johnyknowhow
Member
 
Posts: 358
Joined: Fri Sep 21, 2012 15:17
Location: Washington, USA
In-game: Minetestian

by Johnyknowhow » Sun Nov 17, 2013 21:27

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!??!?!!??!!?!?!?!?!?!!?!?!?!?!?!!?!?!?!?
ლ(ಠ_ಠლ)
I lost interest in Minetest for a couple of years and... I am still not really paying much attention. I rarely browse these forums anymore but it's nice to see old faces.

obligatory fancy signature goes here
 


Return to News



Who is online

Users browsing this forum: No registered users and 0 guests