#I found quite a few strange cases related to lockers

1 messages · Page 1 of 1 (latest)

lethal lake
#

MER ds https://discord.gg/JwAfeSd79u
I described the problem itself in this thread #1383383455332700160 message

As many of you may know, starting with version 2025.6.19.1 of MER, they added the ability to install lockers on the game map. Having quickly run through the MER code, I realized that it uses the basic game functionality of installing lockers on the game map. However, with different test cases, I periodically received an unexpected result. I would like to get some clarification on where exactly the error is? For convenience, I will duplicate all my tests in this thread.

GitHub

Implemented Lockers (loot editable only in the map file directly)
Readded FileSystemWatcher (disabled by default)

#
primitives: {}
lights: {}
doors: {}
workstations: {}
item_spawnpoints: {}
player_spawnpoints: {}
capybaras: {}
texts: {}
scp079_cameras: {}
shooting_targets: {}
schematics: {}
teleports: {}
lockers:
  301decfc:
    locker_type: Misc
    loot:
    - target_item: KeycardJanitor
      remaining_uses: 1
      max_per_chamber: 1
      probability_points: 1
      min_per_chamber: 1
    - target_item: KeycardScientist
      remaining_uses: 2
      max_per_chamber: 1
      probability_points: 2
      min_per_chamber: 1
    - target_item: KeycardZoneManager
      remaining_uses: 2
      max_per_chamber: 1
      probability_points: 2
      min_per_chamber: 1
    - target_item: Painkillers
      remaining_uses: 2
      max_per_chamber: 3
      probability_points: 1
      min_per_chamber: 1
    - target_item: Radio
      remaining_uses: 1
      max_per_chamber: 1
      probability_points: 0
      min_per_chamber: 1
    - target_item: Coin
      remaining_uses: 1
      max_per_chamber: 4
      probability_points: 0
      min_per_chamber: 1
    - target_item: Medkit
      remaining_uses: 1
      max_per_chamber: 1
      probability_points: 1
      min_per_chamber: 1
    - target_item: Flashlight
      remaining_uses: 2
      max_per_chamber: 1
      probability_points: 1
      min_per_chamber: 1
#
    chambers:
    - acceptable_items: []
      is_open: false
      required_permissions: None
    - acceptable_items: []
      is_open: false
      required_permissions: None
    - acceptable_items:
      - KeycardJanitor
      - KeycardScientist
      - KeycardZoneManager
      - Medkit
      - Painkillers
      is_open: false
      required_permissions: None
    - acceptable_items:
      - KeycardJanitor
      - KeycardScientist
      - KeycardZoneManager
      - Medkit
      - Painkillers
      is_open: false
      required_permissions: None
    - acceptable_items:
      - KeycardJanitor
      - KeycardScientist
      - KeycardZoneManager
      - Medkit
      - Painkillers
      is_open: false
      required_permissions: None
    - acceptable_items:
      - KeycardJanitor
      - KeycardScientist
      - KeycardZoneManager
      - Medkit
      - Painkillers
      is_open: false
      required_permissions: None
    position: (28.595, 290.689, -42.290)
    rotation: (0.000, 0.000, 0.000)
    scale: (1.000, 1.000, 1.000)
    room: Surface_Undefined_Outside
    index: 0
#

Where do flashlights and radios come from if they are not in acceptable_items? During dozens of tests, the only item I did not receive was coins.
p. s. I was still able to get coins once.
p. s. s. In test number 6 I found out where the extra items come from.

#
#

Test number 2. I set probability_points: 0 everywhere and the items still continue to appear.
Test number 3. If you do this: loot: [] chambers: [], then as expected the locker is always empty.
Test number 4. If you leave only "loot" filled in, then objects in the closet appear.
Test number 5. If you leave only "chambers" filled in, then no items will appear in the closet.

#
#
#

From all the above tests I conclude that the functionality of lockers works quite strangely.

#

The plugin developer claims that it uses the game's core code.

deft drum
#

Like I tried to replicate the base game behavoir using both LabAPI and base game methods to be exact

shut abyss
#

@deft drum whats the problem here exactly? MER or basegame?

deft drum
#

this is how I handle the lockers in any case

        labApiLocker.ClearLockerLoot();
        foreach (SerializableLockerLoot loot in Loot)
        {
            labApiLocker.AddLockerLoot(loot.TargetItem, loot.RemainingUses, loot.ProbabilityPoints, loot.MinPerChamber, loot.MaxPerChamber);
        }

        int i = 0;
        labApiLocker.ClearAllChambers();
        foreach (LapApiLockerChamber chamber in labApiLocker.Chambers)
        {
            if (i > Chambers.Count - 1)
                break;

            chamber.AcceptableItems = Chambers[i].AcceptableItems.ToArray();
            chamber.RequiredPermissions = Chambers[i].RequiredPermissions;
            i++;
        }