How to print a string value ?

Posted: 30 Jan 2021 04:36
by dxxds

Here is a script which was not working


#Start
@goto .Word_selection
@stop

#Word_selection
@printer Wide

@print "choice a word"
@choice "AAA" goto:.choice_AAA
@choice "BBB" goto:.choice_BBB
@stop

#choice_AAA
@set t_str1="AAA"
@goto .word_selected

#choice_BBB
@set t_str1="BBB"
@goto .word_selected

#word_selected
@print it is {t_str1}
@stop


it can't print the value of "t_str1".
i have added the "t_str1" into Custom Variables and setted the value as ""

error info

NullReferenceException: Object reference not set to an instance of an object
Naninovel.ScriptPlaylist+<>cDisplayClass9_0.<GetCommandAfterLine>b0 (Naninovel.Commands.Command a) (at Assets/Naninovel/Runtime/ScriptPlayer/ScriptPlaylist.cs:104)


Re: How to print a string value ?

Posted: 30 Jan 2021 06:14
by dxxds

I think maybe it is a bug, after i change the name of variable into "tstr" , the code work fine.

if it named with t_str / t_str1 / t_str2, error occured


Re: How to print a string value ?

Posted: 30 Jan 2021 09:27
by Elringus

That's by design, as t_ are recognized as references to managed text records: https://naninovel.com/guide/managed-tex ... cript-text