Announcements, support questions, and discussion for the Dialogue System.
CodePrincess
Posts: 111 Joined: Thu Sep 27, 2018 11:06 pm
Post
by CodePrincess » Wed Jul 29, 2020 6:35 pm
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!
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
Tony Li
Posts: 22655 Joined: Thu Jul 18, 2013 1:27 pm
Post
by Tony Li » Wed Jul 29, 2020 8:50 pm
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.
CodePrincess
Posts: 111 Joined: Thu Sep 27, 2018 11:06 pm
Post
by CodePrincess » Thu Jul 30, 2020 12:51 am
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.
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");
}
}
What do you think I should try next?
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
Tony Li
Posts: 22655 Joined: Thu Jul 18, 2013 1:27 pm
Post
by Tony Li » Thu Jul 30, 2020 9:53 am
Hi,
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()));
}
}
If not, please try importing DS_AdventureCreatorSupport_2020-07-29.unitypackage again.
CodePrincess
Posts: 111 Joined: Thu Sep 27, 2018 11:06 pm
Post
by CodePrincess » Thu Jul 30, 2020 10:14 am
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
Tony Li
Posts: 22655 Joined: Thu Jul 18, 2013 1:27 pm
Post
by Tony Li » Thu Jul 30, 2020 10:20 am
Yes, please download that unitypackage and import it. It contains an updated bridge script that contains that Awake method.
CodePrincess
Posts: 111 Joined: Thu Sep 27, 2018 11:06 pm
Post
by CodePrincess » Thu Jul 30, 2020 10:39 am
If not, please try importing DS_AdventureCreatorSupport_2020-07-29.unitypackage again.
...How'd I miss that line. How embarrassing.
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