Using C# String Variable for Actor Name and During Dialogues

Announcements, support questions, and discussion for the Dialogue System.
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Using C# String Variable for Actor Name and During Dialogues

Post by HawkX »

you are right that GV is my C# script where i store every of my public static variables :)

I added the line "DialogueLua.SetVariable("GV.stringPlayerName", GV.stringPlayerName);"

at the start of my "public void OnConversationStart (Transform gm)" that is on the Dialogue Manager itself...

and it worked!!! For the actor name... it appears next to the portrait where it should!!! :D :D :D

It still wrote "nil" however in the conversation itself where it is used...
Here is the line from the Dialogue Text :
"*Pushes [var=GV.stringPlayerName] off Stephanie* And STOP! No more for you![pic=3]"
When in game, I got "Push nil
and nothing else...

STILL, its friday evening (unless you are not in north america)... you are going WAY WAY above any normal customer support!
AND thank you so much! :)
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using C# String Variable for Actor Name and During Dialogues

Post by Tony Li »

Well thank you again for pointing out a bug! I am indeed on the East Coast, and it's getting a bit late, so I'll have to fix it tomorrow. It's a parsing bug when another tag such as [pic=3] exists later in the text after [var=varName]. If you want to get it working before then, the workaround is to put the [pic=3] tag first, as in:

"[pic=3]*Pushes [var=GV.stringPlayerName] off Stephanie* And STOP! No more for you!"
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Using C# String Variable for Actor Name and During Dialogues

Post by HawkX »

OMG you are so amazing!!! there is no words strong enough!!

I tested it to invert pic and var... and it worked!!! :D

That is one HUGE piece done!! Now we just need to finish syncing with the API and we'll be gold! :)

Here is a screenshot proving that it works! :P (and yes I named my test account Captain N) :P
dialogues.jpg
dialogues.jpg (162.74 KiB) Viewed 3550 times

ALSO, i have been getting spammed with hundreds (if not thousands) of warnings/errors in unity... Granted, since i switched to a beta branch a few months ago there have had dozens of such occurances... so it most likely has nothing to do with you... however, when i double click on each of those 4, it points to the dialogue editor window... SORRY for the massive wall of text!! :P

Code: Select all

//1st ONE :
ArgumentException: Getting control 0's position in a group with only 0 controls when doing Repaint
Aborting
UnityEngine.GUILayoutGroup.GetNext () (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/LayoutGroup.cs:115)
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:413)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:373)
UnityEngine.GUILayout.DoButton (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:50)
UnityEngine.GUILayout.Button (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:46)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawDialogueEntryLinks (PixelCrushers.DialogueSystem.DialogueEntry entry, PixelCrushers.DialogueSystem.Link& linkToDelete, PixelCrushers.DialogueSystem.DialogueEntry& entryToLinkFrom, PixelCrushers.DialogueSystem.DialogueEntry& entryToLinkTo, System.Boolean& linkToAnotherConversation)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawDialogueEntryInspector ()
PixelCrushers.DialogueSystem.DialogueDatabaseEditor.DrawInspectorSelection ()
PixelCrushers.DialogueSystem.DialogueDatabaseEditor.OnInspectorGUI ()
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1218)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

2ND One :
NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorGUI.LabelFieldInternal (Rect position, UnityEngine.GUIContent label, UnityEngine.GUIContent label2, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:1317)
UnityEditor.EditorGUI.LabelField (Rect position, UnityEngine.GUIContent label, UnityEngine.GUIContent label2, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorGUIBindings.gen.cs:60)
UnityEditor.EditorGUI.LabelField (Rect position, System.String label, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorGUIBindings.gen.cs:30)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawParticipantsOnCanvas ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawConversationSectionNodeStyle ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawConversationSection ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawCurrentSection ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawMainBody ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

3rd one :  (yellow warning this one)
Unexpected top level layout group! Missing GUILayout.EndScrollView/EndVertical/EndHorizontal?
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)


4th one :
NullReferenceException: Object reference not set to an instance of an object
UnityEngine.GUILayoutUtility.DoGetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:382)
UnityEngine.GUILayoutUtility.GetRect (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayoutUtility.cs:373)
UnityEngine.GUILayout.DoButton (UnityEngine.GUIContent content, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:50)
UnityEngine.GUILayout.Button (System.String text, UnityEngine.GUIStyle style, UnityEngine.GUILayoutOption[] options) (at C:/buildslave/unity/build/Runtime/IMGUI/Managed/GUILayout.cs:46)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawDialogueEntryLinks (PixelCrushers.DialogueSystem.DialogueEntry entry, PixelCrushers.DialogueSystem.Link& linkToDelete, PixelCrushers.DialogueSystem.DialogueEntry& entryToLinkFrom, PixelCrushers.DialogueSystem.DialogueEntry& entryToLinkTo, System.Boolean& linkToAnotherConversation)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawDialogueEntryInspector ()
PixelCrushers.DialogueSystem.DialogueDatabaseEditor.DrawInspectorSelection ()
PixelCrushers.DialogueSystem.DialogueDatabaseEditor.OnInspectorGUI ()
UnityEditor.InspectorWindow.DrawEditor (UnityEditor.Editor editor, Int32 editorIndex, Boolean rebuildOptimizedGUIBlock, System.Boolean& showImportedObjectBarNext, UnityEngine.Rect& importedObjectBarRect) (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorWindow.cs:1218)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using C# String Variable for Actor Name and During Dialogues

Post by Tony Li »

Do you recall what the editor was doing when it reported those errors? I'm trying to reproduce them in Unity 2017.1.0b4. Is that similar to the beta version you're using?
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Using C# String Variable for Actor Name and During Dialogues

Post by HawkX »

I was using b01... im currently updating to b07... every beta version since 6.5 something has been more and more bug free so perhaps that will help :)

as for what i was doing... it was when i was editing all of my conversations to add the [var=GV...] to replace the *Players* I had left all over :) about 38 of them... so I was in the conversation, moving nodes, editing them... not much more :)

you shouldn't worry about that, unity beta has issues :P
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Using C# String Variable for Actor Name and During Dialogues

Post by HawkX »

after updating and opening the project... i get the following :

Every pixel when i move my mouse over the "grey" area, the count goes up by 1 for each frame my mouse move...

Code: Select all

NullReferenceException: Object reference not set to an instance of an object
UnityEditor.EditorGUI.LabelFieldInternal (Rect position, UnityEngine.GUIContent label, UnityEngine.GUIContent label2, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/Editor/Mono/EditorGUI.cs:1309)
UnityEditor.EditorGUI.LabelField (Rect position, UnityEngine.GUIContent label, UnityEngine.GUIContent label2, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorGUIBindings.gen.cs:60)
UnityEditor.EditorGUI.LabelField (Rect position, System.String label, UnityEngine.GUIStyle style) (at C:/buildslave/unity/build/artifacts/generated/common/editor/EditorGUIBindings.gen.cs:30)
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawParticipantsOnCanvas ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawConversationSectionNodeStyle ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawConversationSection ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawCurrentSection ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.DrawMainBody ()
PixelCrushers.DialogueSystem.DialogueEditor.DialogueEditorWindow.OnGUI ()
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115)
UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:272)
UnityEditor.HostView.Invoke (System.String methodName) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:265)
UnityEditor.HostView.InvokeOnGUI (Rect onGUIPosition) (at C:/buildslave/unity/build/Editor/Mono/HostView.cs:232)
Attachments
bugweird.jpg
bugweird.jpg (159.79 KiB) Viewed 3542 times
User avatar
Tony Li
Posts: 22062
Joined: Thu Jul 18, 2013 1:27 pm

Re: Using C# String Variable for Actor Name and During Dialogues

Post by Tony Li »

Thanks for the info! I'll get that fixed in the upcoming 1.7.1.
User avatar
HawkX
Posts: 147
Joined: Mon Feb 27, 2017 1:50 pm
Location: Quebec
Contact:

Re: Using C# String Variable for Actor Name and During Dialogues

Post by HawkX »

well for once... I can finally say HAPPY TO HELP!! :D

You have done so much for me and my project... and for a TON of people who come here to ask for help...
i'm glad whatever info i provided was of some use to you! (because i didnt understand any of it) :P
Post Reply