We define the blast intensity as the square of the tnt_radius, divided
by the square of the distance to the explosion center, where distance
is limited to 1 at the lower end.
When destroying nodes, we calculate the intensity for each node, and
only destroy the nodes when the intensity is 1.0 or larger. To avoid
perfectly spherical explosions, we make sure to retain a randomness
factor of 20%. This will make explosion edges jagged and not smooth,
but not too much.
We pass the calculated intensity to on_blast() functions as well,
except we take the jitter here out and make sure it's always 1.0
or larger.
We apply a log scale to the size of the stacks ejected, so that
in larger explosions we are getting larger stacks. For normal r=3
explosions, this gives stack sizes ~6-7 or so, but for r=10 explosions
it could end up giving stacks of 25+.V
The drops list already has quantities, so let's just select the one
with the highest quantity from it, and use that as tile. Fallback
tile will therefore only be used if explosion happens in air. Oh well.
We add a dirt-like particle (drawn from scratch, uses some
colors from default_dirt's palette) to spawn many particles
that have collision enabled around the center of the blast.
This has the effect of obscuring the center of the blast, as
that is a painfully visible empty area when the explosion happens,
as there's only a little spark.
The dirt particles bounce around the walls and floor a bit,
and disappear rapidly, well before the smoke particles disappear.
This is a nice visual distraction that obscures the sudden
appearance of the gaping hole, and makes it a whole lot more
believable.
But not too much.
TNT is a bit underwhelming at the moment. We can make it a bit
more interesting by ejecting not just one or two itemstacks,
but a bunch of them. This code splits up the drops into
separate itemstacks that are 2-5 items together, which
results in generally roughly 10 itemstacks being ejected.
Since now we have multiple ejecta, it makes sense to tune
the ejecta velocities a bit better to get the appearance of
an actual explosion better. The items will not all start
with the same vertical velocity, since that would look
like fireworks. Instead we give them all a different vertical
speed.
If the node is special and has an on_blast() handler, we need
to call it instead of getting node drops manually. However, we
do want to know if drops should be added for the special nodes,
so we modify the on_blast() handler code to allow the nodedef
handlers to pass back itemstacks. This could be used by e.g.
the doors mod to drop door items after a blast.
Since this API is documented in lua_api.txt, a separate PR will
be incoming to update the on_blast() documentation.
Some people borrowed the creative code for their sub-games with an exclusive attribution to celeron55.
This is frustrating since I've largely rewritten, redesigned and carefully maintained this mod for the last months.
I expect to be credited.
Currently any doors viewed from underwater will disappear but removing the line 'use_texture_alpha = true,' seems to fix this. Thanks to Thomas-S for finding this glitch.
The boat model had over 1700 tris (!) before this redo. I've reduced
the amount of tris to ~150, which is very reasonable given that there
are almost 45 faces to this model.
I've also spent a good hour re-UV unwrapping the entire model which
has a huuuge impact on the boats' appearance. As much as possible,
the boat now looks like it's made out of actual blocks of wood,
and I've even attempted to make the grains connect around edges,
appear in the same pattern and spacing, and generally make it look
like it's just a nice crafted thing out of several pieces of wood.
I've had to tweak the rudder part to make the texture actually have
square texture pixels. I did that by varying the vertical position of
the botton of the rudder handle and the top of the rudder bottom, which
worked well. I also had to 'slice' the rear face of the boat to prevent
a strange texture tear, probably due to non-flat surface somewhere,
but I couldn't spot the issue there anymore after adding 2 extra edges.
This looks totally like a new boat now.
- http://i.imgur.com/stiVzsa.jpg
If LVM or some other nonmetadata method is used to place a door,
then metadata is missing that tells us whether the door is left
or right-hinged.
However, we can detect that nodemeta is missing and see if the node
name is _a or _b. In the case of _a, nothing needs to be done and we
can just open the door. In the case of _b we assume the door is right
hinged, and tune the state nodemeta value so that the door opens the
right way. This all of course assumes that the schematic method places
the doors *closed* by default, which is reasonable.
- disallow placing beds in protected areas
- fix rotation of beds(broken after 41c2b2ae)
- allow using others' beds, but don't change spawn location
Fixes#953. #943 isn't something I think was ever implemented, and
this does a fair job of addressing the main concern (spawning in
others' houses)
We were cleverly attempting to use an airlike node as the
top half of the doors, but as airlike nodes are not walkable,
falling nodes would not stop falling and thus remain an entity
stuck on top of a door.
After inspecting the builtin/game/falling.lua code, I considered
the remaining options: (a) revert doors such that the top part is
actually the door, (b) play with nodedef fields and see if other
flags may work, or (c) modify the hidden door part to another
drawtype that properly prevents this issue.
(a) seemed way over the top for now, although it would solve the
issue, it would cause a rewrite of most of the code including the
old-door-conversion.
(b) turned up nothing.
(c) turned out to be relatively simple.
So, here's the implementation where I turn the hidden door top
into a tiny, non-targetable but walkable nodebox that is entirely
inside the door hinge. It's entirely transparent, so you still
can't see it, can't hit it, nor can you place anything in it or
make liquids flow through it. The top part is placed in the right
position on placement and not touched further.
Falling nodes will properly stop on top of these doors. I've
adjusted the door conversion code to properly account for the
issue as well, so the only thing remaining is people who have
been running a git branch - those can upgrade by re-placing the
door.
the ```group:cracky``` group contains all sorts of odds and ends
nodes that we shouldn't connect to. There are a few nodes that
walls now no longer connect to, that probably should get
```group:stone``` added, or something similar, though.
I've created a modified B3Dexport.py version that automatically strips
the embedded texture link to external texture files. These links were
causing the engine to spew "can't find character.png" messages on the
console, but were harmless due to texture loading being done by the
client side and not through irrlicht.
I previously moved character.png to /textures/, which is wrong. I now
understand that character.png was in the same folder as character.blend
simply to make blender load the texture from the embedded linkage
automatically. Nothing more, nothing less.
Subsequently the character.png file should just sit in convenience
in the /models/ folder with the blend file, and not in the textures
file. This patch moves it back. And yes, minetest does load the
character.png from this path.
Tested with nodebreaker, fire.
If called from lua, minetest.remove_node() calls on_destruct() callbacks
before the map is actually updated. This means that we can't look at the
map data to determine if we're done cleaning up adjacent nodes, and we
have to stop recursing some other way.
There's no data we can pass around through functions that would survive
scope to a secondary on_destruct() callback, so we have to maintain
local state somewhere in the mod namespace.
In this case, we keep a bitflag. The bitflag is set to "true" by
default. On the first half removal, the flag is flipped and afterwards
we remove the other half node. When the on_destruct for the other half
is running, it's value is false and we flip it back to true without
removing the other half node.
This thus prevents recursing.
To facilitate easier finding of the bed partner, we tell our on_destruct
whether we're a top or bottom half node through a passed flag.
Now that the top is diggable, we just need to assure that it drops a
bottom bed part.
I've found a favorable steel door sound from a parking garage
door that isn't abrupt or scary, just sounds like a nice solid
metal door. The sample had both opening and closing sounds, and
so they match nicely. Amplified and mixed several samples together
to reduce ambient noise, and get the right level compared to
wood doors. Attribution was added as well. CC-BY-3.0 sounds.
We raise the height of the fencegate node by 0.0001 to make the
fencegate post stop fighting with node blocks. This makes the
gate pole appear to be cut through the node, and doesn't leave
a gap when stacking fencegates, which would look odd.
Fixes#909. Door tops are never flammable.
This doesn't guard yet against a voxelmanip removing the top node,
but that is less of an issue since if a voxelmanip removes the top,
then the bottom part remains functional and visibly intact. If the
voxelmanip removes the bottom part, but not the top, then this patch
makes it clean up the top just fine.
The access privilege allows players that have it to bypass protection
on locked doors/trapdoors, chests and bones.
The priv also allows bypassing any minetest.is_protected() check,
including digging nodes and placing them. It is meant for world
moderators to clean up and fix map issues.
Original patch by red-001. Split up and rebased/rewritten by sofar.
This patch requires https://github.com/minetest/minetest/pull/3800
These basic connected wall nodes automatically connect
to neigboring stone blocks, other wall blocks and anything
that's "cracky". The do not connect to wood (fences will do
that).
The walls are generated using a new walls.register() API.
Documentation on the API is included in game_api.txt.
This change requires minetest/minetest#3503.
Walls are added for all cobble stone materials. They generally
look best and are the natural use cases for these materials.
This fence gate builds on NDT_CONNECTED by assuming fence nodes will
automatically connect to it's sides properly. The fence gate will
open and close just like doors, with sounds, but it only opens one
way. The gate sticks out quite a bit and can be bumped into, so the
fence may be used as some sort of path switch.
The fence gate offers no form of protection and can be opened and
closed by anyone. This is done on purpose - the fencegate isn't
meant to provide protection from players, as fences can be
trivially jumped over. Instead, these fences should be used for
protecting crops from hungry sheep, or keeping rabbits in their
pen, or just decoration. Mods can also modify the mod to add
protection, of course.
A recipe is added to make these. It's 4 sticks and 2 wood (any)
as follows:
stick wood stick
stick wood stick
The collision box of the open gate is such that if two gates are
connected but mirrored (making an M shape) then you can walk a large
entity that's larger than 1.0 wide through the opening. The gate of
an opened fence can also be stood upon or bumped into.
I've mixed together some sounds to provide a somewhat light sound
experience, one that one would expect from a small gate latching open
and close.
This change requires #873, otherwise it doesn't connect to fences.
This changes the drawtype of fences to NDT_CONNECTED nodebox drawtype.
These nodes are drawn by the client with the needed connections on
the fly as the scene is drawn. There is no logic needed by mods to
modify the nodes.
These fences connect to (1) other fences, (2) planks and (3) tree
trunks, but nothing else. They do not connect to stone, dirt, wool,
etc. This is done by the "connects_to" parameter, which takes groups
and node names.
Due to the way textures are wrapped, we can make these nodes look a
lot better by giving them a special tile.
This change requires minetest/minetest#3503.
Books still don't wrap long lines of text properly so until this has been sorted out I suggest reverting back to a previous working formspec which lets players read books properly until a fix is found (and maybe scrollbars added to texarea's). Also adding a recipe to blank written books.
This is an adapted version of #861 - by oleastre
Most mods had been calling `doors.register_door() with a door
name that included the "modname:" prefix, and we should continue
to allow mods to do so, without registering the nodenames created
in the "doors:" namespace.
The default case is to use the "modname:" prefix verbatim. If
mods or code calls this function without a prefix, then "doors:"
is automatically used.
Now that the namespace is corrected, the copy replacement ABM is
no longer needed.
This function maps doors.register_door to the new API as far as
reasonable. We can't map the texture, so we fall back to a default
texture. An error message is printed if mod writers did not provide the
needed new tiles field for the door. The created doors are functional
and a full replacement. Old doors are replaced with the new ones
through an ABM.
These sounds were perceived to be too loud in the
game. I've lowered them significantly but they remain
plenty audible. The dig sounds were very loud as well
so I toned them down as well.
Other mods may depend on knowing whether doors are placed
to setup additional attributes or perform node manipulations.
This is something e.g. mesecons does to connect circuits
to doors. This was tested with mesecons. Placing a door next
to a mesecon wire will make the wire automatically
connect, which was otherwise not happening.
And similarly, if we wield a door and right click any node
that has an on_rightclick() handler, call the handler
instead.
Just to be on the safe side, assure that none of this
code runs when right-clicking an entity or player, which
would likely crash the server.
Fold in PR #831 as well - prevent server crash on door
place on unknown blocks, by @tenplus1.
This code never allowed placing a door on e.g. a grass
plant. The code to handle this isn't that complex. With
this code, doors can be placed on flowers and on normal
node surfaces without issues.
Issue #811 - new gravel texture needed.
This texture was Gambits' PixelBOX gravel light texture. Gambit
posted that his texture pack is WTFPL:
- https://forum.minetest.net/viewtopic.php?f=4&t=4990&start=50#p141196
I've made significant modifications to this texture:
- slightly rotated and rolled some sections of pixels
- minor burn/dodge some pixels to keep high contrast
- removed lineair repeating effects
- etc.
Attribution is added back to Gambit. Thanks.
Both the standing and sitting animations had misplaced curve
cusps that caused the end part of the animation to wiggle the
feet slightly back and forward.
I've fixed both animations parts and re-exported. Verified in-game
with multiplayer that everything was indeed fixed.
By adding the timer to the tnt:tnt_burning node it will help mods add the block and cause an explosion after 4 seconds instead of doing nothing like in it's current state.
Spread ABM intervals evenly across 1 to 16 seconds
16s ensures no nodes are missed when player walks past
Adjust chance values to compensate, for identical action rates
Combine lavacooling ABMs into one, return to chance = 1
Grass growth: add 'neighbors = "air"' to avoid
processing the thousands of underground dirt nodes
Grass death: Reduce action rate to that of grass growth
Fire: Use chance = 1 for flame extinguishing
and flame removal when mod is disabled
Node timers are higher precision and a better guarantee
of happening at regular intervals, whereas ABM's may be
postponed, cancelled or missed if a player is too far.
The largest benefit is that once the furnace is done
cooking, no more ABM's are fired - the timer is stopped
instead and no more events are created until items
are put in the furnace.
This patch is larger due to the migration of the timer
function and indentation change as a result of the somewhat
reduced complexity. I've tested with several furnaces and
this works correctly and behavior is not affected, although
people may find that their furnaces now work more
regularly.
If you place several furnaces next to eachother, you will
still find all furnace timers firing exactly at the same
time. This is a bug in core that should not coalesce node
timers at second intervals.