• X xray-16
  • Информация о проекте
    • Информация о проекте
    • Активность
    • Метки
    • Участники
  • Репозиторий
    • Репозиторий
    • Файлы
    • Коммиты
    • Ветки
    • Теги
    • Участники
    • Диаграмма
    • Сравнение
  • Задачи 216
    • Задачи 216
    • Список
    • Доски
    • Спринты
  • Запросы на слияние 31
    • Запросы на слияние 31
  • CI/CD
    • CI/CD
    • Конвейеры
    • Задания
    • Расписания
  • Развертывания
    • Развертывания
    • Окружения
    • Релизы
  • Пакеты и реестры
    • Пакеты и реестры
    • Реестр пакетов
    • Реестр контейнеров
  • Мониторинг
    • Мониторинг
    • Инциденты
  • Аналитика
    • Аналитика
    • Поток ценности
    • CI/CD
    • Репозиторий
  • Wiki
    • Wiki
  • Сниппеты
    • Сниппеты
  • Активность
  • Диаграмма
  • Создать новую задачу
  • Задания
  • Коммиты
  • Доски с задачами
Свернуть панель
  • OpenXRay
  • xray-16
  • Запросы на слияние
  • !1463

[Feature] Extending `upgrade` api for scripting, correct some upgrading logics

  • Ревью изменений

  • Скачать
  • Почтовые патчи
  • Простое отличие
Слиты xottab-duty запросил слияние github/fork/Neloreck/feature/upgrading-extension в dev Окт 16, 2023
  • Обзор 11
  • Коммиты 4
  • Конвейеры 0
  • Изменения 14

Created by: Neloreck

Changes

  • Unified net_Spawn_install_upgrades logics to work with same signature as original net_Spawn event and expect abstract entity
  • Moved net_Spawn_install_upgrades logics call before base method related to net spawning and binder lifecycle calls [A]
  • Less strict check in can_install when loading data -> does not make sense to check data when loading from file, it should be validated on moment of addition [B]
  • Added/exported method to check if upgrade group is installed by upgrade id (has_upgrade_group_by_upgrade_id)
  • Added/exported method to check if upgrade group is installed
  • Added/exported method to check if upgrade can be added [C]
  • Added/exported method to check if upgrade can be installed [C]

A

Previous implementation of net_Spawn_install_upgrades called cleanup of client side object m_upgrades and tried to sync it with server entity. Also it was called after binder lifecycle methods from script so it made all the logics used in scripts on spawn event irrelevant (LUA added extension -> it is added to client object -> it is added to server object -> inventory item lifecycle deletes all the data from client object and fetches it from temporary spawn entity where it is empty).

Also I believe some code parts mocked this method and called original one before base lifecycle specifically for same reasons.

B

On load event we should not re-validate everything what was done before by game engine. Also keeping old logics blocks us from installing all upgrades with scripts. Once you are loading save where 2 upgrades from same group are installed, game crashes without these changes. So basically the change solves two problems.

C

Added new methods and separated concept of install and add for compatibility and code quality. Problem is that install runs script checks and script effects which are part of interaction with mechanic. If you want to purely add upgrades based only on script logics you have to use something else.

add just adds and saves upgrade ignoring script effects/preconditions and it does not unload/detach addons from weapons and armor.

Usage

As result, I was able to create logics in my mod where all the weapon/armor get random upgrades on spawn with random chance. It makes looting more fun + there are situations with unique items where both upgrades from same group are activated.

Ответственный
Назначить
Проверяющие
Запросить ревью
Оценка трудозатрат
Исходная ветка: github/fork/Neloreck/feature/upgrading-extension