There is an Equipment in ItemCollector.
I want it to be equipped [automatically] as soon as the player collects it.
I don't want any dialog or UI to appear.
I want it to be equipped as soon as the player manipulates the ItemCollector with the accept key.

Q1: How can I achieve this?

I've tried various ways, and this is the closest, but it doesn't work.
https://imgur.com/a/lGTix86
1: Set EndSchematic to ItemCollector.
2: Select the equipment and use SelectedData to change the equipment with ChangeEquipment Node.
→In this case, I don't know how to select the equipment in the ItemCollector with SelectEquipment.
For example, I tried to select various items in Machine in the screenshot, but StoreSelectedDataContent fails.

Q3: When debugging, is there any way to see the content of SelectedData while it is stopped at BreakPoint?
Currently, you can only see variables.

Q4: Is there any way to view the contents of Inventory from the Inspector or other devices during debugging?
 It is inconvenient when there is no inventory menu in the game.
  • 1) I don't think this is currently possible without custom scripting.
    The end schematic has no access to the item collectors item (which is already collected/gone at that point), so to select the item, you would need to know which item it was and use a Select Item node to get it from the inventory.

    3) No, selected data is currently not available as debug information.

    4) No, while you can view e.g. equipment information via a combatant's Combatant Component inspector, the inventory is currently not visible without an inventory menu.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you for answer.
    For now, I could attach such a custom script to EquipmentPrefab and do a CallFunction from EndCollectScheme.

    using UnityEngine;
    using GamingIsLove.ORKFramework;
    using GamingIsLove.ORKFramework.Components;
    using GamingIsLove.Makinom.Components;

    public class GetItemFromItemCollector : MonoBehaviour
    {
    private EquipShortcut equipShortcut;

    private void Start()
    {
    if( TryGetComponent(out InteractionForwarder interaction))
    {
    var itemCollector = interaction.interaction.gameObject.GetComponent<ItemCollector>();
    equipShortcut = itemCollector.settings.item[0].item.CreateShortcut(1) as EquipShortcut;
    }
    }
    public void EquipItem()
    {
    var player = ORK.Game.ActiveGroup.Leader;
    player.Equipment.Equip(null, equipShortcut, player, player, true);
    }
    }


  • An alternative would be using only schematics (e.g. with an interaction machine), but for that you'd have to set up a schematic for each equipment you can collect.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited February 2022
    It was working fine with custom scripts.
    However, a new problem has arisen.
    The ItemCollector dropped from the [Remove From Inventory] node does not have EndSchematic set.
    Also, I don't see any way to set the EndSchematic from the machine where [Remove From Inventory] is running.
    In ORKEdiorMenu [InventorySettings-DropItemSettings], there is no item to set the EndSchematic.

    Q1
    How can I set this up?
    Do I have to write a custom script by myself?

    If there is no way, could you please add this feature to the DromItemSettings in ORKEditor for Schematic in the next version?

    Q2
    Also, if I want to set the EndSchematic of ItemCollector in custom C#, how do I set the ? How do I set the ?
    I don't know how to convert from MakinomSchematicAsset to AssetSource<MakinomSchematicAsset>.
    using GamingIsLove.Makinom;
    using GamingIsLove.Makinom.Schematics;

    public class GetItemFromItemCollector : MonoBehaviour
    {
    [SerializeField] public MakinomSchematicAsset itemCollectorEnd;

    private void Start()
    {
    if( TryGetComponent(out InteractionForwarder interaction))
    {
    var itemCollector = interaction.interaction.gameObject.GetComponent<ItemCollector>();
    itemCollector.settings.endSchematicAsset = ???; // ToDo: want to set itemCollectorEnd to dropped itemCollectrs's endSchematicAsset
    }


    Q3 I would like to perform various operations on the ItemPrefab generated by the ITEMCollector dropped into the "Remove From Inventory" node.
    (e.g. change position/set isKinematic/start tween loop animation, etc.)
    However, I can't select them explicitly.
    I can't use SearchGameObject because it gives me a bug where it mistakenly recognizes other items nearby.
    How can I add them explicitly to the SelectedObject?
    If there is currently no way, could you please add a SelectItem option to the DropItem item in the Remove From Inventory node in the next version?

    Q4 Inventory Management Settings-DropItemSettings-OffsetSettings
    This does not have an option for LocalPosition.
    Is it possible to set it somewhere else?
    When dropping from a combatant, I want to drop the item at the LocalPosition of the front + 1 of the combatant's current orientation.

    Q5 Collider Machine's StartCollision doesn't seem to be working, is there a bug happening?
    In UnityEngine, there is a collision, but the Machine does not start.
    If I turn on isTrigger on the Rigid Body and switch to Trigger Machine, the Machine starts normally.
    Could you please confirm this?
    →I missed the setting for [The machine can be started by other objects than the player.
    I think this should be On by default.
    It's too confusing.
    Post edited by joeee19 on
  • 1) I'll look into it.

    2) Like this:
    itemCollector.settings.endSchematicAsset.Source.EditorAsset = schematicAsset;
    I'll look into adding a more logical way in the next update.

    3) Generally, that should be added to the prefab of the item.
    I'll look into a way to make the dropped item available in the schematic.

    4) Hm, you're right, I'll add that option.

    5) Machines are usually meant to interact with the player, so that's the default setup.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • gamingislove said: 2) Like this:
    itemCollector.settings.endSchematicAsset.Source.EditorAsset = schematicAsset;
    Thank you very much.

    Now there are no more compilation errors.
    I assigned this script to the ItemPrefab that Player dropped.
    EndSchematic is indeed attached to the Forwerder's ItemCollector inspector.

    Unfortunately, when I try to run it, the EndSchematic does not work.
    Please tell me how to make it work.
  • Are you setting any other things in this script?
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited February 2022
    gamingislove said: Are you setting any other things in this script?
    No.

    This is the FullCode.
    using UnityEngine;
    using GamingIsLove.ORKFramework;
    using GamingIsLove.ORKFramework.Components;
    using GamingIsLove.Makinom.Components;
    using GamingIsLove.Makinom;

    // Attach to EquipmentItemPrefab
    public class GetItemFromItemCollector : MonoBehaviour
    {
    private EquipShortcut equipShortcut;
    [SerializeField] public MakinomSchematicAsset itemCollectorEnd; // Set the itemCollectorEnd machine's Asset from the Inspector.

    private void Start()
    {
    if( TryGetComponent(out InteractionForwarder interaction))
    {
    var itemCollector = interaction.interaction.gameObject.GetComponent<ItemCollector>();
    equipShortcut = itemCollector.settings.item[0].item.CreateShortcut(1) as EquipShortcut;

    // Dropした場合自動でSpawnされるItemCollectorにはitemCollectorEndのSchematicが設定されていないので、ここで設定
    // The ItemCollector that will be automatically spawned when dropped does not have the itemCollectorEnd schematic set, so set it here.
    itemCollector.settings.endSchematicAsset.Source.EditorAsset = itemCollectorEnd;
    }
    }
    public void EquipItem()
    {
    var player = ORK.Game.ActiveGroup.Leader;
    player.Equipment.Equip(null, equipShortcut, player, player, true);
    }
    }


    1: In the [Remove From Inventory] node, set CurrentEquipment to Selected Equipment and set the DropItem.

    2: The dropped ItemCollector does not have any EndSchematic set (there is no item to set in the Editor's DefaultItemCollector), so you want to set it.

    3: This CustomScript is set in the EquipmentItemPrefab that is spawned from the dropped ItemCollector.

    4:In void Start of EquipmentItemPrefab, itemCollector.settings.endSchematicAsset.Source.EditorAsset is set.

    5:If you look at the inspector of ItemCollector in PlayMode, the End Schematic is set correctly.

    6:Collect the Dropped Item in PlayMode.

    7:EndSchematic is not executed (this is the problem).

    Do I need to Initialize the ItemColletor again or something?

    The easiest way to solve this problem is to
    A:I want to [Select ItemCollector] node.
    B: I want a [Select Equipment]node from A's selected ItemCollector.
    C:Equip to combatant option in [StartItemCollector] Node
    Post edited by joeee19 on
  • I'll test your script.

    The next ORK 3 update will add new options - drop item settings will allow setting schematics and Remove From Inventory and Drop Item nodes have an option to store the game objects of dropped items into selected data to further process them as you want.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Very cool update!
    Thanks.

    I came up with one idea.
    I have an idea, why don't we allow users to post custom nodes in this forum?

    Then users can search and download them as they wish.
    You can vote for your favorite ones and sort them by popularity.

    It could even be a shortcut to MMO support.
    It would also reduce the burden of updating for Gil.
  • That's already allowed.

    If you've got custom nodes that you want to share, post them :)
    Or any other custom code or implementation.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Tested your script and it's working for me.
    I just used a simple schematic that prints something in the Unity console to see if it's started.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • How do I access the Spawned Prefab from Schematics?

    A SelectItemCollector node has been added, how can I get the GameObject spawned by that ItemCollector?
    I want to add an InteractMachine with AddComponent for a Prefab.

    I do not want to collect if the condition does not match StartSchematics in Interact's ItemCollector.
    But I don't know how to cancel the Collect if the condition doesn't match.
    So I created a Schematics that Destroy if the condition does not match in AddComponent and Collect and equip if it matches.
    I added this AddComponent to the GameObject of the SelectItemCollector node.
    However, it is AddComponent to the ItemCollector's own GameObject.
    I have not added a Trigger of the appropriate size to this Object.
    So I want to Select the Spawned Prefab.
  • That's currently not possible.

    But, destroying or disabling the item collector will also destroy/disable the spawned prefab, so you don't need access to the spawned prefab for this.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • edited March 2022
    Instances are lost when items are passed to the other combatant via Drop


    I am passing an Equipment item with an Add Combatant component to another Combatant.
    Passing it using Schematics between Combatant to Combatant works fine.
    However, once dropped, the Instance is cleared.
    The Combatant will be initialized.

    Is there any way to prevent this?

    If there is a Target, the procedure is as follows (working as expected)
    1-1:Select AllEquipment with DataOrigin=Local in Select Equipment node
    1-2:Change Equipment to UnEquip
    1-3 wait=0
    1-4 Remove From Inventory
    1-5 Add To Inventory to Target Combatant
    1-6 Change Equipment to Target Combatant From 1-1's Selected Data

    If there is no Target, then Drop (will not work as expected Instance will be lost)
    2-1:Attach ObjectVariables and InteractMachine for acquisition by AddComponent from StoreDropped to ItemCollectorObject
    2-2:Select by SelectEquipmentNode with DataOrigin=Object on ItemCollectorObject
    2-3: Then execute the same method as 1-3 to 1-6 up to Equip by InteractMachine in 2-1.
    Doing it this way causes the problem that the equipment is different from the instance of Select.


    Q2:I need equipment with inventory functionality.
     (like ItemBag for delivery).
     Currently, Inventory seems to be tied to Combatant.
     So I am forcing myself to Drop in this way.
     Is there any way to configure an Item to have Inventory instead of a Combatant?
     If it doesn't exist, I would like to see it included as a feature of ORK, since bags that can be passed on are a common item in RPGs.
    Post edited by joeee19 on
Sign In or Register to comment.