Forum rules - please read before posting.

Opsive UCC with Adventure Creator

Hi, I was wondering if there is a way to link up UCC Inventory with AC inventory. So if I have a pistol in UCC Inventory it also is showed up in AC inventory. If I were to click AC inventory pistol Icon it would equip the player's weapon. It would be great to have a hotspot on weapon pickup then once clicked it goes in both inventories. If anyone has done this are you able to give me the steps on how to achieve this, it would be greatly appreciated.

Comments

  • edited March 2019

    This requires custom scripting, but should be possible.

    First of all, bear in mind that both inventory systems are separate. Items that you want to appear in both, will have to appear in both.

    So if I have a pistol in UCC Inventory it also is showed up in AC inventory.

    Taking this as an example, you'd have to add "pistol" as a new item in your AC inventory. Having it show up is then just a case of adding a regular AC inventory item when you get the UCC pistol.

    This can either be done through the Inventory: Add or remove Action in an ActionList asset, and running that asset by invoking it's Interact() method - or directly in code:

    AC.KickStarter.runtimeInventory.Add (pistolID);

    Where "pistolID" is the ID number of the item, as shown in the AC Inventory Manager to the left of it's label.

    To learn when to make use of such code at the point a UCC item is taken, refer to UCC's docs or support links.

    For more on manipulating AC inventory items through script, see the Manual's "Inventory scripting" chapter.

    To sync items up the other way around (for example, picking up an AC item causes the UCC item to be added as well), you can hook into the OnInventoryAdd custom event. For more on inventory custom events, see the same chapter in the Manual.

    If I were to click AC inventory pistol Icon it would equip the player's weapon.

    As with any AC inventory item, you can define an ActionList asset that runs as an interaction when the AC pistol is clicked on. See, for example, the "Worm" in the 2D Demo.

    This ActionList can run custom scripts either using the Object: Call event or Object: Send message Actions. The code to have UCC equip the weapon, again, should be gotten from Opsive - but if you have such code placed in a public function on a prefab or gameobject in your scene, you can trigger it using the above Actions.

    It is also possible to merge such code into a custom Action, if desired.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.