DialogManager Does not exist compile error

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Edla
Posts: 27
Joined: Mon May 04, 2020 9:23 pm

DialogManager Does not exist compile error

Post by Edla »

Hi,
Trying to call the DialogManager inside Corgi Inventory script. But it gave me the does not exit error. Tried to include the the pixelrushers name space , but still no go.

I read somewhere that it might’ve the compilation order that might be the reason corgi’s code Is not seeing Pixelcrushers classes.

Any ideas??
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialogManager Does not exist compile error

Post by Tony Li »

If you include this at the top of the script:

Code: Select all

using PixelCrushers.DialogueSystem;
does your code editor report that the namespace 'PixelCrushers.DialogueSystem' does not exist?

If so, are you using the Dialogue System's assembly definition files? (They are not used by default. If you're using them, it because you went through the steps of importing the assembly definition unitypackages.) If you're using the Dialogue System's assembly definition files, you'll need to add them to Corgi's assembly definition files.

If you're not using the Dialogue System's assembly definition files, then the Dialogue System will be in the standard Assembly-CSharp-firstpass assembly that should be accessible to Corgi's assembly definition files. Double check that Corgi's assembly definition files can access Assembly-CSharp-firstpass.
Edla
Posts: 27
Joined: Mon May 04, 2020 9:23 pm

Re: DialogManager Does not exist compile error

Post by Edla »

using PixelCrushers.DialogueSystem;

Yes, I put the using namespace code above on top the itemPicker.cs and Unity gives a compile error,


error CS0246: The type or namespace name 'PixelCrushers' could not be found (are you missing a using directive or an assembly reference?)

I can call DialogueMmanager in everywhere else in the project, including the topdown engine code, but only in the Inventory classes I can't reference the PixelCrusher namespace and call any codes.

Really strange.

How to I

Double check that Corgi's assembly definition files can access Assembly-CSharp-firstpass.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialogManager Does not exist compile error

Post by Tony Li »

Hi,

As Renaud mentioned on discord, Corgi is locked away in an assembly definition.

Instead of directly modifying ItemPicker.cs -- which would be a bad idea anyway since you'll lose your customizations every time you update Corgi -- make a subclass.

For example, to show a DS alert message when picking up an item, create a new script like this:

ItemPickerWithAlert.cs

Code: Select all

using MoreMountains.InventoryEngine;
using PixelCrushers.DialogueSystem;

public class ItemPickerWithAlert : ItemPicker
{
    protected override void PickSuccess()
    {
        base.PickSuccess();
        DialogueManager.ShowAlert("Picked up " + Item.ItemName);
    }
}
Edla
Posts: 27
Joined: Mon May 04, 2020 9:23 pm

Re: DialogManager Does not exist compile error

Post by Edla »

I was able to get it to work by writing my own class thanks.
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: DialogManager Does not exist compile error

Post by Tony Li »

Great! Glad to help.
Post Reply