Twine Version: 2.71
[also choose a Story Format tag above]
Maybe i am making it too complicated but coming from other languages this feels a little more natural to me.
I want to pass information with a widget call so that i can use the code in the widget repeatedly without pasting it repeatedly. There are three things that vary depending on progress in the event but otherwise it is the same
so i am passing <<progress “20” “helpone” “repeatone”>> which should pass _args[0] as 20, _args[1] as helpone and _args[2] as repeatone
ultimately this should uncomplicate large code blocks and make use of the same code multiple times.
The end code it puts the args into is
<<widget "progress">>
<<set _progress to $work + $effort>><<set _dccheck to random(1,_args[0])>><<if _progress > _dccheck>><<_args[1]>><<elseif _dccheck - _progress <=2>><<_args[2]>><<else>>
<<NextPassage>><</if>>
<</widget>>
the end result being the random number is between 1 and 20, the DC Check if successful will progress the event to helpone widget and a close failure will result in a repeat of the work that just happened in a modified version.
I get an error that says
Error: <<help>>: error within widget code (Error: <<progress>>: error within widget code (Error: <<set>>: bad evaluation: missing ) after argument list))
Any idea what i am doing wrong?
oh i also tried searching forum and found something similar so i tried it and still got the error
<<widget "progress">>
<<set $dc = '<<' +_args[0] + '>>' >>
<<set _progress to $work + $effort>><<set _dccheck to random(1, $dc>><<if _progress > _dccheck>><<_args[1]>><<elseif _dccheck - _progress <=2>><<_args[2]>><<else>>
<<NextPassage>><</if>>
<</widget>>