Page 1 of 1

simstatus condition in script setting

Posted: Tue Apr 05, 2022 5:30 am
by joeylu
Hi Tony, In each dialogue entry, I'm using the script area to set variables, something like Variable["relationship"] += 1;
My issue is that I don't want this dialogue entry to += 1 everytime, instead, it should +=1 only once.
My idea is to use simstatus to conditioning the scritp, what is the proper way to set this condition in "script" area? tks

Re: simstatus condition in script setting

Posted: Tue Apr 05, 2022 7:28 am
by joeylu
also, is there any way to display some extra icons to indicate the current dialogue entry node has scripts/conditions or custom fields?

Re: simstatus condition in script setting

Posted: Tue Apr 05, 2022 11:06 am
by Tony Li
joeylu wrote: Tue Apr 05, 2022 5:30 am Hi Tony, In each dialogue entry, I'm using the script area to set variables, something like Variable["relationship"] += 1;
My issue is that I don't want this dialogue entry to += 1 everytime, instead, it should +=1 only once.
My idea is to use simstatus to conditioning the scritp, what is the proper way to set this condition in "script" area? tks
Try something like this:

Code: Select all

if (Dialog[thisID].SimStatus == "Untouched") then Variable["relationship"] = Variable["relationship"] + 1 end
joeylu wrote: Tue Apr 05, 2022 7:28 am also, is there any way to display some extra icons to indicate the current dialogue entry node has scripts/conditions or custom fields?
A node will show a red question mark if it has Conditions, a green arrow if it has a Script, and a blue play icon if it has a Sequence:

nodeIcons.png
nodeIcons.png (10.37 KiB) Viewed 1047 times

If you don't see those, then you've probably moved the Unity special folder named 'Editor Default Resources'. Unity requires that this folder is named exactly 'Editor Default Resources' and that it's in the root Assets folder. Please move it back into its correct position.

Re: simstatus condition in script setting

Posted: Wed Apr 06, 2022 1:46 am
by joeylu
all works well, yes I did move the default editor resource folder :(
one inrelevant question, I'm working on a game that supports multiple language, to be more speicific, it supports both English and Chinese, I have notice that in dialogue editor, for each dialogue entry, if I input unicode (Chinese character), the text will be overflow outside of the node, not like english wording that will be "clipped" if it's too long
Anyway I can have it set from overflow to clipping? tks

Re: simstatus condition in script setting

Posted: Wed Apr 06, 2022 9:27 am
by Tony Li
Currently the nodes clip by character count, and the Chinese characters are wider. In a future update (no time estimate yet), the editor will clip by the node boundaries. There wasn't an efficient way to do that in older versions of Unity.

Re: simstatus condition in script setting

Posted: Fri Apr 15, 2022 5:40 am
by joeylu
Hi Tony
I added Dialog[thisID].SimStatus =="Untouched" in the condition field, but I'm getting following error, any idea?

Dialog[thisID].SimStatus =="Untouched" threw exception 'Lookup of field '4' in the table element failed because the table element itself isn't in the table.'

Re: simstatus condition in script setting

Posted: Fri Apr 15, 2022 8:20 am
by Tony Li
Hi,

Can you please back up your project, make sure you have a good backup, and then update to the latest Dialogue System version and let me know if the issue still occurs?