entropia / tip-toi-reveng

Trying to understand the file format of Tip Toi
http://tttool.entropia.de/
MIT License
646 stars 121 forks source link

code processing issue #215

Closed DexCrane closed 4 years ago

DexCrane commented 4 years ago

Reference sayes, that commands must be spread over several lines of code if there are more than 8 commands. So the expected behaviour is, that all lines within a script related to an OID will be processed. My example

product-id: 904
comment: testbed
init: $flag:=0
scripts:
  switch:
    - P(hear_this) J(bleep_again)
    - $flag == 0? $flag := 1 P(uno)
    - $flag == 1? $flag :=0 P(zero)
  bleep_again:
    - P(hear_this)
    - P(hear_this)
    - P(hear_this)
language: en
speak:
  zero: "switched from true to false"
  uno: "switched from false to true"
  hear_this: "bleep"

I used tttool play <file.yaml> to test the code. After entering switch, the "bleep" is played two times only. Following (conditional) lines related to switch are ignored as well as lines 2 and 3 related to bleep_again. Is this a bug or by design?

nomeata commented 4 years ago

Yes, this is as expected: The pen will play the first line of a script where all conditions match.

If you have more than 8 commands in one line, you need to spread them out over multiple scripts and connect them with J commands:

scripts:
  switch:
    - P(hear_this) J(bleep_1)
    - $flag == 0? $flag := 1 P(uno)
    - $flag == 1? $flag :=0 P(zero)
  bleep_1:
    - P(hear_this) J(bleeb_2)
  bleep_2:
    - P(hear_this) J(bleeb_3)
  bleep_4:
    - P(hear_this) J(bleeb_5)
  bleep_5:
    - P(hear_this)
DexCrane commented 4 years ago

Okay, understood. Thank you!

uli42 commented 4 years ago

Maybe that should be explicitly noted in the documentation.

On Tue, Apr 14, 2020 at 11:57 AM Joachim Breitner notifications@github.com wrote:

Closed #215 https://github.com/entropia/tip-toi-reveng/issues/215.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/entropia/tip-toi-reveng/issues/215#event-3230384411, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABQHBZEV6DINYK22UOKCJMDRMQXQ5ANCNFSM4MHS56NA .