NodeCanvas Forums › Support › CoreGamekit Integration Namespace Errors
Hey there, the CoreGameKit tasks require ‘using DarkTonic.CoreGameKit;’ otherwise on initial import it’ll spit out errors (It might have been in a recent update that the author put his asset into namespaces)
As well, in DestroyKillable, “Killable.DESTROYED_TEXT” is an error, it’s now “Killable.DestroyedText”. I’m using the latest CoreGameKit as a reference for these.
(Corrected versions attached, if you want to diff them to save time)
I’ll keep it in the same thread, integration related.
InventoryPro changed Open/Close TreasureChest to ___.triggerer.Use() and UnUse()
So in OpenCloseTreasureChest
From:
1 2 3 4 5 |
protected override void OnExecute(){ if (open.value) chest.value.OpenTreasureChest(); else chest.value.CloseTreasureChest(); EndAction(true); } |
To:
1 2 3 4 5 |
protected override void OnExecute(){ if (open.value) chest.value.triggerer.Use(); else chest.value.triggerer.UnUse(); EndAction(true); } |
Thanks for this.
I’ve certainly been using an older version.
The packages are now updated.
Thanks again.
Join us on Discord: https://discord.gg/97q2Rjh
Great!
I actually was rewriting a different 3rd party integration for InventoryPro over to NodeCanvas the day before you posted this, but all of your scripts replaced mine anyhow!
There was one that I didn’t see in your actions, which was for looting a treasure chest, to transfer all items to an inventory. The quick code changes I did to put it in NodeCanvas are as follows (near direct port from their integration):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
[Category("InventoryPro")] [Description("Adds all of the items from a treasure chest.")] [Icon("InventoryPro", true)] public class AddItemsFromTreasureChest : ActionTask<TreasureChest> { protected override string info { get { return "Add items from a treasure chest to inventory"; } } protected override void OnExecute() { for (int i = agent.items.Length - 1; i > -1; --i) { InventoryManager.AddItem(agent.items<em class="d4pbbc-italic"></em>); agent.items<em class="d4pbbc-italic"></em> = null; } EndAction(); } } |
But I think the following is more along the lines of how you wrote the other tasks:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
[Category("InventoryPro")] [Description("Adds all of the items from a treasure chest to a collection. Uses the default collection if none set.")] [Icon("InventoryPro", true)] public class MoveTreasureChestItemsToCollection : ActionTask { [RequiredField] public BBParameter<TreasureChest> chest; public BBParameter<ItemCollectionBase> collection; protected override string info { get { var str = string.Format("Add items from {0} to ", chest); if (collection.value != null) str += collection; else str += "default collection"; return str; } } protected override void OnExecute() { for (int i = chest.value.items.Length - 1; i > -1; --i) { if (collection.value != null) collection.value.AddItem(chest.value.items<em class="d4pbbc-italic"></em>); else InventoryManager.AddItem(chest.value.items<em class="d4pbbc-italic"></em>); chest.value.items<em class="d4pbbc-italic"></em> = null; } EndAction(); } } |
(The integration I looked at simply pointed at InventoryManager.AddItem, but I think having the option for a specific inventory built in is useful too)
P.S. Your tasks are generally better written than mine, so rewrite it how you see fit, if you want to add this task!
Hey just a headsup for the InventoryPro integration that TreasureChest was renamed to LootableObject in the latest release, so there’s a few tasks that will throw errors for anyone updating.
Ah, thanks for the heads up and the tasks!
I will take a look at LootableObject and integrate your tasks 🙂
Cheers!
Join us on Discord: https://discord.gg/97q2Rjh
Great! I also noticed in the changelog that the author added tasks to plyBlox and PlayMaker -> “(GetItemID, GetItemCategoryName, GetItemCategoryID, GetItemTypeName)”, the couple I looked at seem like the existing reflection in NodeCanvas can easily grab all of that, but thought I’d let you know just in case!