Evening, everybody!
So, Sis is loving this [item name].Count approach for updating an Adventure Creator inventory; It's so easy!
I was just wondering, is there a way to have the added item show up in the inventory before the conversation ends?
I'm using 1.71.7, Unity 2019.4.0f1 and Pixel Crushers' Dialogue System for Unity v 2.2.7, if that helps.
Thank you for your time and three cheers for Pixel Crushers!
Updating an Adventue Creator Inventory before Ending the Conversation
-
- Posts: 111
- Joined: Thu Sep 27, 2018 11:06 pm
Updating an Adventue Creator Inventory before Ending the Conversation
Thank you so much for your help.
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Re: Updating an Adventue Creator Inventory before Ending the Conversation
Hi!
The Dialogue System Extras page has an updated Adventure Creator integration package. It's in the "Updated for 2.2.8" foldout, but it works fine with 2.2.7. The "Updated with 2.2.8" wording just means that it was updated after 2.2.8 was released.
The updated package adds two Lua functions: SyncACToLua() and SyncLuaToAC(). You can use SyncLuaToAC() to have the added item show up in the AC inventory before the conversation ends. To add the Lua function, click the Script field's "..." menu and select Custom > AC > SyncLuaToAC. Then click Apply. Or just type "SyncLuaToAC()" manually into the Script field.
The Dialogue System Extras page has an updated Adventure Creator integration package. It's in the "Updated for 2.2.8" foldout, but it works fine with 2.2.7. The "Updated with 2.2.8" wording just means that it was updated after 2.2.8 was released.
The updated package adds two Lua functions: SyncACToLua() and SyncLuaToAC(). You can use SyncLuaToAC() to have the added item show up in the AC inventory before the conversation ends. To add the Lua function, click the Script field's "..." menu and select Custom > AC > SyncLuaToAC. Then click Apply. Or just type "SyncLuaToAC()" manually into the Script field.
-
- Posts: 111
- Joined: Thu Sep 27, 2018 11:06 pm
Re: Updating an Adventue Creator Inventory before Ending the Conversation
Oh, perfect!
It's... saying the Lua commands haven't been registered?
I tried faking a script for that, but it didn't seem to take.
What do you think I should try next?
It's... saying the Lua commands haven't been registered?
I tried faking a script for that, but it didn't seem to take.
Code: Select all
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class DialogueACUpdateCommands : MonoBehaviour
{
private void OnEnable()
{
PixelCrushers.DialogueSystem.Lua.RegisterFunction("SyncACToLua", this, typeof(
DialogueAnimatedGifCommands).GetMethod("SyncACToLua")); // orig. typeof(GifManager)
PixelCrushers.DialogueSystem.Lua.RegisterFunction("SyncLuaToAC", this, typeof(
DialogueAnimatedGifCommands).GetMethod("SyncLuaToAC"));
}
private void OnDisable()
{
PixelCrushers.DialogueSystem.Lua.UnregisterFunction("SyncACToLua");
PixelCrushers.DialogueSystem.Lua.UnregisterFunction("SyncLuaToAC");
}
}
Thank you so much for your help.
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Re: Updating an Adventue Creator Inventory before Ending the Conversation
Hi,
Does your AdventureCreatorBridge component contain an Awake method that looks like this?
If not, please try importing DS_AdventureCreatorSupport_2020-07-29.unitypackage again.
Does your AdventureCreatorBridge component contain an Awake method that looks like this?
Code: Select all
private void Awake()
{
if (!areLuaFunctionsRegistered)
{
areLuaFunctionsRegistered = true;
Lua.RegisterFunction("SyncACToLua", this, SymbolExtensions.GetMethodInfo(() => SyncAdventureCreatorToLua()));
Lua.RegisterFunction("SyncLuaToAC", this, SymbolExtensions.GetMethodInfo(() => SyncLuaToAdventureCreator()));
}
}
-
- Posts: 111
- Joined: Thu Sep 27, 2018 11:06 pm
Re: Updating an Adventue Creator Inventory before Ending the Conversation
Private Awake() wasn't in there. Should I add the script you posted?
Thank you so much for your help.
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Re: Updating an Adventue Creator Inventory before Ending the Conversation
Yes, please download that unitypackage and import it. It contains an updated bridge script that contains that Awake method.
-
- Posts: 111
- Joined: Thu Sep 27, 2018 11:06 pm
Re: Updating an Adventue Creator Inventory before Ending the Conversation
...How'd I miss that line. How embarrassing.If not, please try importing DS_AdventureCreatorSupport_2020-07-29.unitypackage again.
Okay, I'm downloading the unity package... and everything fixed!
Thank you so much!
Have a good day, Tony!
Thank you so much for your help.
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12
Oh! My stats!
Unity 2020.1.10f1
Adventure Creator 1.72.2
Dialogue System for Unity 2.2.12