bitsy-hacks icon indicating copy to clipboard operation
bitsy-hacks copied to clipboard

choice meet problem when insert jumpNow in it.

Open soundsofapril opened this issue 2 years ago • 2 comments

DLG 0
"""
{choice
	- option one
	  result of picking optionA(jumpNow "3")
	- option two
	  result of picking optionB
  }
"""
NAME dog dialog

DLG 3
Opp
NAME opp dialog

DLG 4
Yep
NAME yep dialog

and the default example don't work either:

Greeting text{choice
  - Response one
    {a = 1}
  - Response two
    {a = 2}
}
constant part of answer{
  - a == 1 ?
    custom part based on response one
  - a == 2 ?
    custom part based on response two
}

soundsofapril avatar Apr 24 '22 00:04 soundsofapril

For the first example, you're mixing the choice hack and the jump hack in a way that causes incompatibility, but could be rewritten to avoid it. Instead of having some content inside the choice and using a {jumpNow} tag, i'd recommend having it only include a {jump} tag and putting all the content in another dialog entry.

So a corrected script would look like:

DLG 0
"""
{choice
  - option one
    (jump "3")
  - option two
    result of picking optionB
}
"""
NAME dog dialog

DLG 3
result of picking optionAOpp
NAME opp dialog

DLG 4
Yep
NAME yep dialog

For the second example, this appears to be a bug in how bitsy is parsing the scripts, but it can be fixed by slightly changing the content, e.g. if you remove the whitespace between the end of the choice block and the new text (i.e. write it like }constant ...) then it renders as expected. I'll update the example, but I don't think I can fix the parsing issue here without more info.

seleb avatar Apr 24 '22 01:04 seleb

thanks ! bitsy-hacks is so cool.

soundsofapril avatar Apr 24 '22 02:04 soundsofapril