Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiplayer "Neutral Chest" Bug #22

Open
WarlordMatt opened this issue Sep 17, 2020 · 4 comments
Open

Multiplayer "Neutral Chest" Bug #22

WarlordMatt opened this issue Sep 17, 2020 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@WarlordMatt
Copy link

I ran into an issue in multiplayer where items in a chest would disappear, I would receive no money, and the UI to edit the buy or sell settings did not show when opening a trade chest.

I have done the legwork of finding out why. In multiplayer, there is an option for "neutral chests" to allow the looting of each others goods.

Enabling this setting creates a scenario where items will be sold at the default "every hour" interval (which cannot be changed by the player) - and the money will be awarded to the "neutral" faction instead of any players.

If the mod could be tweaked such that trade chests were able to ignore the "Neutral faction" setting to allow looting AND trading in multiplayer games -- that would be great.

However, if not, I am simply placing this here to let everyone know that BlackMarket2 trade mod is not compatible with the "neutral chests" multiplayer setting.

@djmango djmango self-assigned this Sep 21, 2020
@djmango djmango added the bug Something isn't working label Sep 21, 2020
@djmango
Copy link
Owner

djmango commented Oct 11, 2020

I can't seem to find this setting. I've written a possible fix, not enabled yet, at line 2042 of control.lua. Is this setting through a mod?

@moullcz
Copy link

moullcz commented Nov 10, 2024

This is still issue, any ways to fix this?

@moullcz
Copy link

moullcz commented Nov 15, 2024

Fix for chests at least

I created mod with this in
-> control.lua

Now it works ^^ if someone need just insert other ids in list below.

-- Seznam truhel, které mají být při položení vázány k frakci hráče
local trader_chest_ids = {
    "trader-chst-sel",
    "trader-chst-buy",
    "trader-chst-sel-mk2",
    "trader-chst-buy-mk2",
    "trader-chst-sel-mk3",
    "trader-chst-buy-mk3",
    "trader-chst-sel-mk4",
    "trader-chst-buy-mk4",
}

-- Funkce pro kontrolu, zda je položena správná truhla
local function is_trader_chest(name)
    for _, id in ipairs(trader_chest_ids) do
        if name == id then
            return true
        end
    end
    return false
end

-- Event pro položení entity
script.on_event({defines.events.on_built_entity, defines.events.on_robot_built_entity}, function(event)
    local entity = event.created_entity or event.entity
    if entity and entity.valid and is_trader_chest(entity.name) then
        local player = game.get_player(event.player_index)
        if player and player.valid then
            entity.force = player.force
        end
    end
end)

@djmango
Copy link
Owner

djmango commented Nov 17, 2024 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants