[Game] MineClone2 [0.86]
Re: [Game] MineClone 2 [0.68.0]
How did you try to have MineClone2 on your server? It should work.
Re: [Game] MineClone 2 [0.68.0]
What does this even mean? Can you clarify please?
How can you remove the mineclone 2 game from... a game of mineclone 2?
If you mean "add the game to a world", one can never do this. You create the world after choosing the game. (You also cannot load random mods with this game, they need to be mcl2-compatible.)
This is a game, not a mod. It must be installed and started as such.
These are all the things i can think of at this point. :D
Re: [Game] MineClone 2 [0.68.0]
After realization upon posting a reply. the situation was misunderstood and taken care of quickly, sorry for the misunderstanding, I hope you do understandgoats wrote: ↑Wed Nov 25, 2020 23:26What does this even mean? Can you clarify please?
How can you remove the mineclone 2 game from... a game of mineclone 2?
If you mean "add the game to a world", one can never do this. You create the world after choosing the game. (You also cannot load random mods with this game, they need to be mcl2-compatible.)
This is a game, not a mod. It must be installed and started as such.
These are all the things I can think of at this point. :D
- Wuzzy
- Member
- Posts: 4786
- Joined: Mon Sep 24, 2012 15:01
- GitHub: Wuzzy2
- IRC: Wuzzy
- In-game: Wuzzy
- Contact:
Re: [Game] MineClone 2 [0.68.0]
What do you mean, "when it is added to a new or existing world?".
What exactly did you do to make the game crash?
What exactly did you do to make the game crash?
Re: [Game] MineClone 2 [0.68.0]
Indeed, apologies for not understanding a thing are not necessary, but i am curious what did happen. :)
(Maybe it could be helpful to someone else in the future also.)
(Maybe it could be helpful to someone else in the future also.)
- AFCM
- Member
- Posts: 36
- Joined: Tue Jun 30, 2020 12:21
- GitHub: AFCMS
- IRC: AFCM
- In-game: AFCM
- Location: France
- Contact:
Re: [Game] MineClone 2 [0.68.0]
Hey,
When creating a formspec, I wanted to show the player inventory, so I used mcl_formspec.get_itemslot_bg().
But I get an ugly result:
Can everyone help me ?
When creating a formspec, I wanted to show the player inventory, so I used mcl_formspec.get_itemslot_bg().
But I get an ugly result:
Can everyone help me ?
Re: [Game] MineClone 2 [0.68.0]
You need to define your formspec spacing / padding. It's in the API doc. Make sure you use the reference for the engine version you are using.
Also this doesn't look like mcl2... If it is, don't be using a dev version of the engine against the game.
Also this doesn't look like mcl2... If it is, don't be using a dev version of the engine against the game.
- AFCM
- Member
- Posts: 36
- Joined: Tue Jun 30, 2020 12:21
- GitHub: AFCMS
- IRC: AFCM
- In-game: AFCM
- Location: France
- Contact:
Re: [Game] MineClone 2 [0.68.0]
@goats can you explain ? Is it a mcl setting or a minetest formspec setting ? I haven't see any setting in the inventory code of MCL.
I use the 5.3 stable version of minetest with the MTG4MCL2 texture pack.
I use the 5.3 stable version of minetest with the MTG4MCL2 texture pack.
Re: [Game] MineClone 2 [0.68.0]
e.g. mcl2 chests in v68: /mods/ITEMS/mcl_chests/init.lua line 239, 377, 517, 713
lua_api.txt is in the /docs directory, or here https://github.com/minetest/minetest/bl ... ua_api.txt
or nicely accessible here https://rubenwardy.com/minetest_modding ... specs.html
this will help you understand padding and spacing.
Depending on what else you may be doing here, see API.md in the root of the mineclone 2 folder. mcl2 does not operate like mtg and many respects. (Obviously you know this as you are calling formspec the mcl way :) as in /mods/HUD/mcl_formspec/ .)
I can't offer a lot more. I just know that padding/spacing makes a huge difference to what is readable/usable. I've fixed issues in some old mods before. However, i am not a coder, to say the least, lol.
lua_api.txt is in the /docs directory, or here https://github.com/minetest/minetest/bl ... ua_api.txt
or nicely accessible here https://rubenwardy.com/minetest_modding ... specs.html
this will help you understand padding and spacing.
Depending on what else you may be doing here, see API.md in the root of the mineclone 2 folder. mcl2 does not operate like mtg and many respects. (Obviously you know this as you are calling formspec the mcl way :) as in /mods/HUD/mcl_formspec/ .)
I can't offer a lot more. I just know that padding/spacing makes a huge difference to what is readable/usable. I've fixed issues in some old mods before. However, i am not a coder, to say the least, lol.
- AFCM
- Member
- Posts: 36
- Joined: Tue Jun 30, 2020 12:21
- GitHub: AFCMS
- IRC: AFCM
- In-game: AFCM
- Location: France
- Contact:
Re: [Game] MineClone 2 [0.68.0]
@goats I used viewtopic.php?f=14&t=24130 to design my formspec, and this editor used the real coordinate system.
If I use real_coordinate[false], inventory slots are correctly shown, but the layout is messed up.
Does mcl_inventory forces the use of legacity_coordinates?
I will see the code of mcl_chest tomorow.
If I use real_coordinate[false], inventory slots are correctly shown, but the layout is messed up.
Does mcl_inventory forces the use of legacity_coordinates?
I will see the code of mcl_chest tomorow.
Re: [Game] MineClone 2 [0.68.0]
I have absolutely no idea if mcl2 uses the legacy coord system. It would seem like this is so, given your test. It may be a thing that is not yet updated due to heavy work on all the things. But also note that mcl2 does not show inventory + hotbar like MT default anyway, as it is mimicking some other piece of software...
[edit: you should see the interaction between mcl2 and the protected chest formspec in protector-redo on Kay's server lol.]
Wow, i didn't know there was a formspec generator. I've only read the API and whatever code i was hacking up. That might have saved time in game loading, if it handled that formspec and the rather outdated code.
[edit: you should see the interaction between mcl2 and the protected chest formspec in protector-redo on Kay's server lol.]
Wow, i didn't know there was a formspec generator. I've only read the API and whatever code i was hacking up. That might have saved time in game loading, if it handled that formspec and the rather outdated code.
- AFCM
- Member
- Posts: 36
- Joined: Tue Jun 30, 2020 12:21
- GitHub: AFCMS
- IRC: AFCM
- In-game: AFCM
- Location: France
- Contact:
Re: [Game] MineClone 2 [0.68.0]
@goats After looking at the code of mcl_chest, I saw that chests inventories use real_coordinate.
So, I can't understand why mcl_inventory don't work with my formspec.
My code:
Formspec with legacity_coordinate:
With real_coordinate (the layout of inventory slots is exactly that I designed with the formspec editor, but their border are messed up):
The formspec is not the one I post later, but the problem is the same.
So, I can't understand why mcl_inventory don't work with my formspec.
My code:
Code: Select all
local form = table.concat({
"formspec_version[3]",
"size[10.5,11]",
"real_coordinates[false]",
mcl_formspec.get_itemslot_bg(0.5, 0.5, 1, 1),
"list[current_player;craftpreview;0.5,0.5;1,1;0]",
mcl_formspec.get_itemslot_bg(0.5, 3, 9, 4),
"list[current_player;main;0.5,3;9,4;0]",
})
With real_coordinate (the layout of inventory slots is exactly that I designed with the formspec editor, but their border are messed up):
The formspec is not the one I post later, but the problem is the same.
Re: [Game] MineClone 2 [0.68.0]
is their a height limit at which mobs stop spawning or spawn less? mobs like spiders, creepers, skeletons, zombies ect.
-
- New member
- Posts: 3
- Joined: Tue Dec 01, 2020 12:06
- GitHub: Follpvosten
- IRC: Follpvosten[m]
- In-game: Waltar Follpvosten
Re: [Game] MineClone 2 [0.68.0]
Hi!
I would like to contribute something to this game, but it's probably more of a personal interest of me, so before just sending a patch, I wanted to ask.
I'm working on various bridges from the minetest chat to other chat networks (mostly telegram at the moment). Bridging messages and events like server starting or stopping is easy; however now I want to announce deaths over the bridge as well (in Mineclone specifically, as that's what we're currently playing).
I've looked at the mcl_death_messages mod and it pretty much does all of what I want, except I can't use it because it doesn't expose a public API to build these death messages.
Now I'd like to send in a small patch which adds such an API; option one is a simple (function name up for debate) so anyone can call it from any on_dieplayer observer. This function would of course also be used internally to generate the message. I have a patch of this approach ready, the downside is that it would be called once for each mod that uses it in on_dieplayer.
Option two would be less simple, but possibly more efficient: adding a custom event emitter to mcl_death_messages where other mods can register a callback. That way the internal logic can stay in the event handler and obversers only get notified when there's actually a valid death message.
Of course these options are not mutually exclusive, exposing both would be a possibility as well.
Now the question is: Is such a feature (which is mostly for mod devs) welcome in Mineclone? And which approach would be preferred?
I would like to contribute something to this game, but it's probably more of a personal interest of me, so before just sending a patch, I wanted to ask.
I'm working on various bridges from the minetest chat to other chat networks (mostly telegram at the moment). Bridging messages and events like server starting or stopping is easy; however now I want to announce deaths over the bridge as well (in Mineclone specifically, as that's what we're currently playing).
I've looked at the mcl_death_messages mod and it pretty much does all of what I want, except I can't use it because it doesn't expose a public API to build these death messages.
Now I'd like to send in a small patch which adds such an API; option one is a simple
Code: Select all
mcl_death_messages.format(player, reason)
Option two would be less simple, but possibly more efficient: adding a custom event emitter to mcl_death_messages where other mods can register a callback. That way the internal logic can stay in the event handler and obversers only get notified when there's actually a valid death message.
Of course these options are not mutually exclusive, exposing both would be a possibility as well.
Now the question is: Is such a feature (which is mostly for mod devs) welcome in Mineclone? And which approach would be preferred?
- Wuzzy
- Member
- Posts: 4786
- Joined: Mon Sep 24, 2012 15:01
- GitHub: Wuzzy2
- IRC: Wuzzy
- In-game: Wuzzy
- Contact:
Re: [Game] MineClone 2 [0.68.0]
First of all, thanks. I would prefer the latter idea, the observer pattern. I believe you mean with that a "register" function like those countless "register" functions in the official Minetest Lua API. Right? If yes, then I'm fine with that.
-
- New member
- Posts: 3
- Joined: Tue Dec 01, 2020 12:06
- GitHub: Follpvosten
- IRC: Follpvosten[m]
- In-game: Waltar Follpvosten
Re: [Game] MineClone 2 [0.68.0]
Yes, exactly; the observer-style API would look something like this:
Thanks for your feedback! I will get right to implementing it this way. Should I send you a patch via email or just paste it into a spoiler + code block here? Could also upload and share a file, depending on what you'd prefer. I'll default to email.
Code: Select all
mcl_death_messages.register_on_death_message(function(msg) end)
- Wuzzy
- Member
- Posts: 4786
- Joined: Mon Sep 24, 2012 15:01
- GitHub: Wuzzy2
- IRC: Wuzzy
- In-game: Wuzzy
- Contact:
Re: [Game] MineClone 2 [0.68.0]
Just post it here unless it's a very large patch.
-
- New member
- Posts: 3
- Joined: Tue Dec 01, 2020 12:06
- GitHub: Follpvosten
- IRC: Follpvosten[m]
- In-game: Waltar Follpvosten
Re: [Game] MineClone 2 [0.68.0]
Alriiight, I spent way too much time finding a way to actually use the translated string that the API gives me now; after finding `minetest.get_translated_string()`, I'm satisfied.
Here's my patch:
Here's my patch:
Code: Select all
From b6622666855b23493b5d565b1bf281b19d68cb45 Mon Sep 17 00:00:00 2001
From: Follpvosten <wolfi@karpador.xyz>
Date: Tue, 1 Dec 2020 16:16:59 +0100
Subject: [PATCH] add observer api for death messages
---
mods/HUD/mcl_death_messages/init.lua | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/mods/HUD/mcl_death_messages/init.lua b/mods/HUD/mcl_death_messages/init.lua
index dfc5191a..a18dee5c 100644
--- a/mods/HUD/mcl_death_messages/init.lua
+++ b/mods/HUD/mcl_death_messages/init.lua
@@ -3,6 +3,16 @@ local N = function(s) return s end
mcl_death_messages = {}
+-- Allow mods to register observers for death messages
+mcl_death_messages.registered_on_death_message = {}
+-- Registers a function which will be called whenever a death message is
+-- successfully rendered.
+-- Note: This string passed to the callback is a translated message, so it can
+-- only be used to display it client-side or with minetest.get_translated_string()
+function mcl_death_messages.register_on_death_message(func)
+ table.insert(mcl_death_messages.registered_on_death_message, func)
+end
+
-- Death messages
local msgs = {
["arrow"] = {
@@ -252,6 +262,10 @@ minetest.register_on_dieplayer(function(player, reason)
msg = dmsg("other", name)
end
minetest.chat_send_all(msg)
+ -- Notify all death message observers
+ for i=1, #mcl_death_messages.registered_on_death_message do
+ mcl_death_messages.registered_on_death_message[i](msg)
+ end
last_damages[name] = nil
end
end)
--
2.25.1
Re: [Game] MineClone 2 [0.68.0]
Some flowing water code to possibly mull over:
viewtopic.php?p=385053#p385053
AFCM: If you can't understand it, i almost certainly cannot. I might try to learn something here, but by the time i get anything (if i get it at all), it would be far too late to be useful. Especially since 5.4.0 will add more new formspec stuff which may affect such inventories.
viewtopic.php?p=385053#p385053
Probably not. If there are appropriate nodes on which they can spawn, and a correct light-level range if applicable, they should spawn.
AFCM: If you can't understand it, i almost certainly cannot. I might try to learn something here, but by the time i get anything (if i get it at all), it would be far too late to be useful. Especially since 5.4.0 will add more new formspec stuff which may affect such inventories.
Re: [Game] MineClone 2 [0.68.0]
@Warhawk, re mobs spawning at / below specific altitudes, see my previous post:
Other numbers on the line refer to rarity of spawning and max. number of entities (in this case chickens) appearing per map block. I would do a copy of the .lua file and just fool around with the numbers, preferably in a flat and empty map, and observe the results.Grigor wrote: ↑Sun Nov 15, 2020 01:25...most of the mob creature .lua files (in ENTITIES/mobs_mc) has a line toward the end like this:
mobs:spawn_specific("mobs_mc:chicken", mobs_mc.spawn.grassland, {"air"}, 9, minetest.LIGHT_MAX+1, 90, 9000, 3, mobs_mc.spawn_height.overworld_min, 90)
- which I've modified to prevent chickens appearing above 90m altitude (last number in the line). ...
Re: [Game] MineClone 2 [0.68.0]
@Wuzzy, I'm presently fooling around with temperature / humidity numbers in mcl_weather/weather_core.lua to stop it from snowing / raining in deserts. Presently I'm putting the check in the same line as the if (mcl_weather.is_underwater(player) or not mcl_worlds.has_weather(player:get_pos()) check in rain.lua and snow.lua, unless you can tell me a better place to check it from.
Right now I'm running around different biomes to make sure it works when it's supposed to... Will send you the code when I'm sure of it.
Right now I'm running around different biomes to make sure it works when it's supposed to... Will send you the code when I'm sure of it.
Re: [Game] MineClone 2 [0.68.0]
Hi,
today we tried to build a railway switch in our mineclone world. I don't know/have the original Minecraft but from looking at some online tutorials I thought this can be done with a lever besides the T-shaped track. However the track didn't change its direction when we operated the lever. Is this supposed to work (or did we just build it the wrong way)?
Bye
Markus
today we tried to build a railway switch in our mineclone world. I don't know/have the original Minecraft but from looking at some online tutorials I thought this can be done with a lever besides the T-shaped track. However the track didn't change its direction when we operated the lever. Is this supposed to work (or did we just build it the wrong way)?
Bye
Markus
- LMD
- Member
- Posts: 1386
- Joined: Sat Apr 08, 2017 08:16
- GitHub: appgurueu
- IRC: appguru[eu]
- In-game: LMD
- Location: Germany
- Contact:
Re: [Game] MineClone 2 [0.68.0]
I think there is a far better solution. It looks like this:goats wrote: ↑Thu Dec 03, 2020 03:36Some flowing water code to possibly mull over:
viewtopic.php?p=385053#p385053
Code: Select all
liquid_level_max = 8
--+ Calculates the flow direction of a flowingliquid node
--# as returned by `minetest.get_node`
--> 4 corner levels from 0 to 1 as list
function get_liquid_corner_levels(pos, node)
local def = minetest.registered_nodes[node.name]
if not (def and def.drawtype == "flowingliquid") then return pointed_thing end
local source, flowing = def.liquid_alternative_source, node.name
local range = def.liquid_range or liquid_level_max
local neighbors = {}
for x = -1, 1 do
neighbors[x] = {}
for z = -1, 1 do
local neighbor_pos = {x = pos.x + x, y = pos.y, z = pos.z + z}
local neighbor_node = minetest.get_node(neighbor_pos)
local level
if neighbor_node.name == source then
level = 1
elseif neighbor_node.name == flowing then
local neighbor_level = neighbor_node.param2 % 8
level = (math.max(0, neighbor_level - liquid_level_max + range) + 0.5) / range
end
neighbor_pos.y = neighbor_pos.y + 1
local node_above = minetest.get_node(neighbor_pos)
neighbors[x][z] = {
air = neighbor_node.name == "air",
level = level,
above_is_same_liquid = node_above.name == flowing or node_above.name == source
}
end
end
local function get_corner_level(x, z)
local air_neighbor
local levels = 0
local neighbor_count = 0
for nx = x - 1, x do
for nz = z - 1, z do
local neighbor = neighbors[nx][nz]
if neighbor.above_is_same_liquid then
return 1
end
local level = neighbor.level
if level then
if level == 1 then
return 1
end
levels = levels + level
neighbor_count = neighbor_count + 1
elseif neighbor.air then
if air_neighbor then
return 0.02
end
air_neighbor = true
end
end
end
if neighbor_count == 0 then
return 0
end
return levels / neighbor_count
end
local corner_levels = {
{x = 0, z = 0},
{x = 1, z = 0},
{x = 1, z = 1},
{x = 0, z = 1}
}
for _, corner_level in pairs(corner_levels) do
corner_level.y = get_corner_level(corner_level.x, corner_level.z)
end
return corner_levels
end
flowing_downwards = vector.new(0, -1, 0)
--+ Calculates the flow direction of a flowingliquid node
--# as returned by `minetest.get_node`
--> `modlib.minetest.flowing_downwards = vector.new(0, -1, 0)` if only flowing downwards
--> surface direction as `vector` else
function get_liquid_flow_direction(pos, node)
local corner_levels = get_liquid_corner_levels(pos, node)
local max_level = corner_levels[1].y
for index = 2, 4 do
local level = corner_levels[index].y
if level > max_level then
max_level = level
end
end
local dir = vector.new(0, 0, 0)
local count = 0
for max_level_index, corner_level in pairs(corner_levels) do
if corner_level.y == max_level then
for offset = 1, 3 do
local index = (max_level_index + offset - 1) % 4 + 1
local diff = vector.subtract(corner_level, corner_levels[index])
if diff.y ~= 0 then
diff.x = diff.x * diff.y
diff.z = diff.z * diff.y
if offset == 3 then
diff = vector.divide(diff, math.sqrt(2))
end
dir = vector.add(dir, diff)
count = count + 1
end
end
end
end
if count ~= 0 then
dir = vector.divide(dir, count)
end
if vector.equals(dir, vector.new(0, 0, 0)) then
if node.param2 % 32 > 7 then
return flowing_downwards
end
end
return dir
end
Re: [Game] MineClone 2 [0.68.0]
https://minecraft.gamepedia.com/Rail It would work in mc if done properly. I don't know about mcl2 at this point, but overall it has a fair way to go to exit an alpha state, so it's probably on the list.
Who is online
Users browsing this forum: No registered users and 8 guests