Skip to content

Conversation

@Themostrandom
Copy link
Contributor

@Themostrandom Themostrandom commented Aug 21, 2025

This map is inspired by the maps “The Wall” and “The Impossible Wall.” There are four teams, each with 140 chests (40 of which are accessible at the end of the build time). I added apple farming to this map. When you collect an apple, it grows back after a certain amount of time, and you can collect tree shoots to increase production. Apples do not appear in classes or nade fights. Apple generators disappear if there are no blocks surrounding them. There are lots of minerals and therefore apples to encourage PvP.

screenshot

@Themostrandom
Copy link
Contributor Author

If players like it, the possibility of farming apples could be developed on other maps.

@mpixelate
Copy link
Contributor

My review to the code:
I don't think checking the current map name every time is a good idea, since this mod will be added to other maps. In order to add this mod to other maps, the map maker should add only one sapling2; otherwise, it is not available.
Also, in my opinion, you should override apple in ctf_map.register_on_new_match and revert it in ctf_map.register_on_match_end.
after_place_leaves is not defined.
And "default." is the minetest game's namespace. You can use just "local function grow_ctf_tree"

@Themostrandom
Copy link
Contributor Author

My review to the code: I don't think checking the current map name every time is a good idea, since this mod will be added to other maps. In order to add this mod to other maps, the map maker should add only one sapling2; otherwise, it is not available. Also, in my opinion, you should override apple in ctf_map.register_on_new_match and revert it in ctf_map.register_on_match_end. after_place_leaves is not defined. And "default." is the minetest game's namespace. You can use just "local function grow_ctf_tree"

All is fix !

@mpixelate
Copy link
Contributor

I tested your map again.
Your code doesn't work properly: apples don't spawn again.
Also, if I break the log, leaves won't despawn.
My suggested code:

local function on_new_match()
    minetest.override_item("default:apple", {
        after_dig_node = function(pos, oldnode, oldmeta, digger)
            if old_after_dig then
                old_after_dig(pos, oldnode, oldmeta, digger)
            end
            minetest.set_node(pos, {name = "ctf_map:apple_generator"})
            local delay = math.random(apple_def.respawn_time_min, apple_def.respawn_time_max)
            minetest.get_node_timer(pos):start(delay)
        end,
    })
end

local function on_match_end()
    minetest.override_item("default:apple", {
        after_dig_node = old_after_dig
    })
end

ctf_api.register_on_new_match(function()
    if ctf_map.current_map and ctf_map.current_map.name == MAP_NAME then
        on_new_match()
    end
end)

ctf_api.register_on_match_end(function()
    if ctf_map.current_map and ctf_map.current_map.name == MAP_NAME then
        on_match_end()
    end
end)

@Nanowolf4 Nanowolf4 self-requested a review August 27, 2025 03:44
@Nanowolf4 Nanowolf4 marked this pull request as draft August 27, 2025 03:44
@Nanowolf4
Copy link
Member

The map is quite large, after the player respawns there is a long run to the wall, it is not very fun.

@Themostrandom
Copy link
Contributor Author

The map is quite large, after the player respawns there is a long run to the wall, it is not very fun.

I don't think this is a problem, players can actually take chests on the way. In addition, I tested on the map the wall, I put 12 seconds from the flag to the center and on mine 16 seconds (both with satima). So I think this is not a problem, if players complain about it then I will modify it, but otherwise I don't think it is necessary.

more speed 1.2 -->1.3
@Themostrandom Themostrandom marked this pull request as ready for review August 27, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants