콘텐츠로 건너뛰기
라이엇 비트

라이엇 비트

  • 집
  • 소식
  • 가이드
  • 비디오 가이드
  • 패치 노트
  • 남용 신고
  • 검색 양식 전환
플래닛 크래프터

The Planet Crafter Inventory and Other Modding (dnspy)

에 게시됨 03/25/2022 에 의해 akarnokd 코멘트 없음 ~에 The Planet Crafter Inventory and Other Modding (dnspy)
  • 제목: 플래닛 크래프터
  • 출시일:
  • 개발자: 미주 게임
  • 발행자: 미주 게임
The Planet Crafter에 대한 정보는 아직 불완전합니다.. 이것을 사용하여 게임의 세부 정보를 입력할 수 있도록 도와주세요. 문의 양식.

이 가이드에서는, I’ll describe a few modifications I patched in to adjust a few UI behaviors and to cheat a bit after I completed the game.

The game is written in Unity and C# which makes it relatively easy to explore via the dnSpy tool.

Note though that these modifications aren’t real mods but temporary patches because the moment the game is updated by the developers, the local changes are overwritten. There exist modding frameworks, such as BepInEx for other games but I have not looked into those.

준비

  • Download the latest available dnspy.
  • Extract it to a suitable location and run dnSpy.exe
  • In File > 열려 있는, 위치를 찾아라 어셈블리 -csharp.dll 에서
    %{steam dir}\common\The Planet Crafter Prologue\Planet Crafter_Data\Managed

    예배 규칙서.

I recommend using “방법 편집” 대신에 “Edit Class” to avoid drastic recompilation of unrelated code parts that may break something else. 또한, dnSpy has bugs so no need to tempt it.

Modify Sorting

The game sorts items by their name by default but I like air and food in the front of the list. The sorting is handled in the SpaceCraft.Inventory::AutoSort() 방법. The method currently has a LINQ expression for sorting that we will replace with a direct call to List::Sort().

this.worldObjectsInInventory.Sort(delegate(WorldObject a, WorldObject b)
{
    string id = a.GetGroup().GetId();
    string id2 = b.GetGroup().GetId();
    만약에 (id.StartsWith("OxygenCapsule") && !id2.StartsWith("OxygenCapsule"))
    {
        반품 -1;
    }
    만약에 (!id.StartsWith("OxygenCapsule") && id2.StartsWith("OxygenCapsule"))
    {
        반품 1;
    }
    만약에 (id.StartsWith("WaterBottle") && !id2.StartsWith("WaterBottle"))
    {
        반품 -1;
    }
    만약에 (!id.StartsWith("WaterBottle") && id2.StartsWith("WaterBottle"))
    {
        반품 1;
    }
    return id.CompareTo(id2);
});

I don’t know all the IDs of the items but could be dumped into a file from this method via StreamWriter.

Move Items of the Same Type to/from Inventory

기본적으로, one can move items one by one, which can be tedious. Clicking on an inventory image is handled by SpaceCraft.InventoryDisplayer::OnImageClicked() 방법. 기본적으로, it has action for the left and right mouse clicks. Since I couldn’t find a way to check for modifiers such as shift or ctrl keys, I decided to use the middle mouse button.

When the user clicks the middle mouse button, we have to find the objects in the current inventory having the same item id, then get the other inventory entity. Then try adding it to the other inventory and if successful, remove it from the current inventory, thus handling the full case.

만약에 (_eventTriggerCallbackData.pointerEventData.button == PointerEventData.InputButton.Middle)
{
    DataConfig.UiType openedUi = MijuTools.Managers.GetManager().GetOpenedUi();
    만약에 (openedUi == DataConfig.UiType.Container)
    {
        Inventory otherInventory = ((UiWindowContainer)MijuTools.Managers.GetManager().GetWindowViaUiId(openedUi)).GetOtherInventory(this.inventory);
        만약에 (this.inventory != null && otherInventory != null)
        {
            string id = _eventTriggerCallbackData.worldObject.GetGroup().GetId();
            List list = new List();
            foreach (WorldObject worldObject2 in this.inventory.GetInsideWorldObjects())
            {
                만약에 (worldObject2.GetGroup().GetId() == id)
                {
                    list.Add(worldObject2);
                }
            }
            foreach (WorldObject worldObject3 in list)
            {
                만약에 (otherInventory.AddItem(worldObject3))
                {
                    this.inventory.RemoveItem(worldObject3, 거짓);
                }
            }
        }
    }
}

Inventory Capacity (Cheating)

기본적으로, the inventory is quite small and I spent most of the time going back and forth between deposits, storage and build sites. I also like collecting all deposits which was becoming time and air consuming.

The inventory is managed by the aforementioned SpaceCraft.Inventory class and its capacity is handled in the inventorySize private field. 안타깝게도, all I could do is overwrite this field in 3 위치: the constructor, the getter and the setter to not break the assembly structure to much:

public Inventory(int _inventoryId, int _inventorySize, List _worldObjectsInInventory = null)
{
    this.inventoryId = _inventoryId;
    this.inventorySize = _inventorySize;
    this.inventorySize = 250; // <----------------------------------
    this.worldObjectsInInventory = ((_worldObjectsInInventory != null) ? _worldObjectsInInventory : new List());
    this.authorizedGroups = new List();
}
public int GetSize()
{
    this.inventorySize = 250; // <----------------------------------
    return this.inventorySize;
}


public void SetSize(int _inventorySize)
{
    만약에 (_inventorySize == this.inventorySize)
    {
        반품;
    }
    this.inventorySize = _inventorySize;
    this.inventorySize = 250; // <----------------------------------
    this.RefreshDisplayerContent();
}

하지만, this has some UI consequences:

  • The inventory screen for the player will exceed the screen and you won’t be able to interact with anything beyond it.
  • It affects the equipment “목록”
  • It affects all containers, including the core miner.
  • Items picked up are added to the end of the inventory and may not be visible, including air, water and food items.
  • Too many clicking when depositing inventory into containers.
  • Screen lag when viewing and moving items around in containers.

다행스럽게도, the latter to can be remedied by the sorter and group move mods above. Store items per type in separate containers.

Asteroid Location (Cheating)

기본적으로, the game targets a relatively large radius around the player when asteroids (natural and resource called in via rockets) 땅. My base is at the lambda rock and the launch structure is also there. 따라서, many rocks end up in the lake of the starting area.

The asteroids are handled in the SpaceCraft.AsteroidHandler and the target selection is in the SpawnAsteroid() 방법. Find the loop and in it, a vector calculated via an Unity random and radius. Change it to something like this:

Vector2 vector = UnityEngine.Random.insideUnitCircle * Math.Min((float)_asteroidEvent.distanceFromPlayer, 20에프);

The reason I use Math.Min is to avoid unwanted reoptimization of the method when it gets recompiled. 20f is pretty tight so I recommend going out into an open field or elevated position. This concentration has the drawback that the player location is flooded with debris that may bury the player and those rocks stay for minutes before despawning.

경고. In the Early Access versions, the asteroids can and do hurt the player so either give the mod a bigger radius or go indoors and wait for the debris to disappear.

이것이 오늘 우리가 공유하는 모든 것입니다. 플래닛 크래프터 가이드. 이 가이드는 원래 작성자가 작성하고 작성했습니다. akarnokd. 이 가이드를 업데이트하지 못한 경우, 다음을 수행하여 최신 업데이트를 찾을 수 있습니다. 링크.

이 사이트의 콘텐츠가 귀하의 권리를 침해한다고 생각하는 경우, 귀하의 지적 재산권을 포함하여, 문의 양식을 사용하여 즉시 문의하십시오..
가이드 태그:플래닛 크래프터

탐색 후

이전 게시물: Lost Wish: In the Desperate World Achievements Guide
다음 게시물: A Memoir Blue Achievement Walkthrough Guide

답장을 남겨주세요 답장 취소

귀하의 이메일 주소는 공개되지 않습니다. 필수 입력란이 표시되어 있습니다 *

  • 제목: 플래닛 크래프터
  • 출시일:
  • 개발자: 미주 게임
  • 발행자: 미주 게임
The Planet Crafter에 대한 정보는 아직 불완전합니다.. 이것을 사용하여 게임의 세부 정보를 입력할 수 있도록 도와주세요. 문의 양식.

부인 성명

인용된 모든 콘텐츠는 해당 소스에서 파생됩니다.. 귀하의 콘텐츠를 허가 없이 사용했다고 생각되는 경우, 우리에게 연락하면 진지하게 받아 들일 것입니다..
  • 회사 소개
  • 문의하기
  • 개인 정보 정책
  • 서비스 약관

저작권 © 2025 라이엇 비트.

에 의해 구동 프레스북 뉴스 WordPress 테마