JBenda / inkcpp

Inkle Ink C++ Runtime with JSON>Binary Compiler
MIT License
70 stars 13 forks source link

Errorneous newline inserted in some text. #82

Closed kalmard0 closed 5 months ago

kalmard0 commented 5 months ago

To reproduce:

  1. download the intercept ink file https://github.com/inkle/the-intercept/blob/master/Assets/Ink/TheIntercept.ink
  2. export the intercept to json
  3. play the json in the inkcpp CL
  4. select the choices 1 3 3 3 2 3
  5. observe the invalid newline before the period in the printed text:
    "I don't see why," I reply
    .
JBenda commented 5 months ago

Thanks for pointing it out, I'm able to reproduce it, now some digging will be done.

JBenda commented 5 months ago

A symptomatic treatment is available in PR #83, feel free to test also further, if no other problem occurs it will be merged soon.

kalmard0 commented 5 months ago

Thanks for the quick response, it seems to be working based on a quick test.

kalmard0 commented 5 months ago

I found a similar error in another situation. I have not checked if this patch fixes it, apologies for that. My playthrough, notice the extra tab after the first sentence of the last step:

They are keeping me waiting.

1: Hut 14
?> 1
Hut 14. The door was locked after I sat down.
I don't even have a pen to do any work. There's a copy of the morning's intercept in my pocket, but staring at the jumbled letters will only drive me mad.
I am not a machine, whatever they say about me.

1: Think
2: Plan
3: Wait
?> 3

Half an hour goes by before Commander Harris returns. He closes the door behind him quickly, as though afraid a loose word might slip inside.
"Well, then," he begins, awkwardly. This is an unseemly situation.

1: "Commander."
2: "Tell me what this is about."
3: Wait
?> 1
"Commander."
He nods. He has brought two cups of tea in metal mugs: he sets them down on the tabletop between us.

1: Take one
2: "What's going on?"
3: Wait
?> 1
I take a mug and warm my hands. It's a small gesture of friendship.
Enough to give me hope?

1: Drink
2: Wait
?> 1
I raise the cup to my mouth but it's too hot to drink.
"Quite a difficult situation," Harris begins, sternly. I've seen him adopt this stiff tone of voice before, but only when talking to the brass. "I'm sure you agree."

1: Agree
2: Disagree
3: Lie
4: Evade
?> 1
"Awkward," I reply, sipping at my tea as though we were old friends.

1: Watch him
2: Wait
3: Smile
?> 1
His face is telling me nothing. I've seen Harris broad and full of laughter. Today he is tight, as much part of the military machine as the device in Hut 5.
"We need that component," he says.

1: The stolen component...
2: Shrug
?> 1
The reel went missing from the Bombe this afternoon. The four of us were in the Hut, working on the latest German intercept. The results were garbage. It was Russell who found the gap in the plugboard.
Any of us could have taken it; and no one else would have known its worth.

1: Panic
2: Calculate
3: Deny
?> 2
My odds, then, are one in four. Not bad; although the stakes themselves are higher than I would like.
"So. Do you have it?" Harris is wasting no time: Bletchley is his watch. "Do you know where it is?"

1: Yes
2: No
3: Lie
4: Evade
?> 1
"I do."
Harris smiles with satisfaction, as if your willingness to talk was somehow his doing.
"I see."
There's a long pause, like the delay between feeding a line of cypher into the Bombe and waiting for its valves to warm up enough to begin processing.
"You want to explain that?"

1: Explain
2: Say nothing
?> 2
I fold my arms, intended firmly to say nothing. But somehow, watching Harris' face, I cannot bring myself to do it. I want to confess. I want to tell him everything I can, to explain myself to him, to earn his forgiveness. The sensation is so strong my will is powerless in the face of it.
Something is wrong with me, I am sure of it. There is a strange, bitter flavour on my tongue. I taste it as words start to form.
"I've done things," I begin. "Things I didn't want to do. I tried not to. But in the end, it felt like cutting off my own arm to resist."
"You mean you've left yourself open," Harris answers. "To pressure. Is that what you're saying?"

1: Yes
2: No
3: Evade
?> 1
"That's it," I reply. "There are some things... which a man shouldn't do."
Harris doesn't stiffen. Doesn't lean away, as though my condition might be infectious. I had thought they trained them in the army to shoot my kind on sight.
He offers no sympathy either. He nods, once. His understanding of me is a mere turning cog in his calculations, with no meaning to it.
"I've seen it before. A young man like you ΓÇö clever, removed. The kind that doesn't go to parties. Who takes himself too seriously. Who takes things too far."
He slides his thumb between two fingers.
"Now they own you."

1: Agree
2: Disagree
?> 1
"What could I do?" I'm shaking now. The night is cold and the heatΓÇölamp in the Hut has been removed. "I don't want to go to prison."
"Smart man," he replies. "You wouldn't last. So why don't you tell me, right now. Where is it?"
His eyes bear down like carbonised drillΓÇöbits.

1: Confess
2: Dissemble
?> 1
"All right. I'll tell you what happened." And never mind my shame.
"I can imagine how it starts," he replies.

1: Talk
?> 1
"There was a young man. I met him in the town. A few months ago now. We got to talking. Not about work. And I used my cover story, but he seemed to know it wasn't true. That got me wondering if he might be one of us."
Harris is not letting me off any more.
"You seriously entertained that possibility?"

1: Yes
2: No
3: Lie
?> 1
"Yes, I considered it. He seemed to know all about me. He... he was quite enchanted by my achievements."
The way Harris is staring I expect him to strike me, but he does not. He replies, "I can see how that must have been attractive to you," with such plainΓÇöspokeness that I think I must have misheard.

1: Yes
2: No
?> 1
"It's a lonely life in this place," I reply. "Lonely - and still one never gets a moment to oneself."
"That's how it is in the Service," Harris answers.

1: Argue
2: Agree
?> 1
"I'm not in the Service."
Harris shakes his head. "Yes, you are."
Then he waves the thought aside.
"Go on with your confession."
That gives me pause. I hadn't thought of it as such. But I suppose he's right. I am about to admit what I did.
"There's not much else to say. I took the part from Bombe computing device. You seem to know that already. I had to. He was going to expose me if I didn't."
"This young man was blackmailing you over your affair?"
As Harris speaks I find myself suddenly sharply aware, as if waking from a long sleep. The table, the corrugated walls of the hut, everything seems suddenly more tangible than a moment before.
Whatever it was they put in my drink is wearing off.

1: Yes
2: No
3: Tell the truth
4: Lie
?> 3
         "Yes. I suppose he was their agent. I should have realised but I didn't. Then he threatened to tell you. I thought you would have me locked up: I couldn't bear the thought of it. I love working here. I've never been so happy, so successful, anywhere before. I didn't want to lose it."
"So what did you do with the component?" Harris talks urgently. He grips his gloves tightly in one hand, perhaps prepared to lift them and strike if it is required. "Have you passed it to this man already? Have you left it somewhere 
for him to find?"

1: I have it
2: I don't have it
3: Lie
4: Tell the truth
?> 4
                                        "I still have it. Not on me, of course. The missing component of the Bombe computer is hidden in a small cavity in a breezeΓÇöblock supporting the left rear post of Hut 2. I put in there anticipating a search. I intended to dispose of it once the fuss had died down. I suppose I was foolish to think that it might."
"Indeed. And Mr Manning: God help you if you're lying to me."
Harris stands, and slips away smartly. Then the door closes. I am alone again, as I have been for most of my short life.

1: Make your peace
?> 1
I am waiting again. I have no God to make my peace with. I find it difficult to believe in goodness of any kind, in a world such as this.
But I am no traitor. Not to my country. To my sex, perhaps. But how could I support the Reich? If the Nazis were to come to power, I would be worse off than ever.
I have no place here. No way to fit. I am caught, in the middle, cryptic and understood only thinly, through my machines.

1: I must seem very calm.
2: Perhaps I should try to escape.
?> 1
I must seem very calm.                   I suppose I do not believe they will hang me. They will lock me up and continue to use my brain, if they can. I wonder what they will tell the world ΓÇö perhaps that I have taken my own life. 
That would be simplest. The few who know me would believe it.
Well, then. Not a bad existence, in prison. Removed from temptation.
A monastic life, with plenty of problems to keep me going.
I wonder what else I might yet unravel before I'm done?

1: The door is opening.
?>
JBenda commented 5 months ago

The tab error still remains, seems like tabs get not striped away in some situations.

JBenda commented 5 months ago

Thank you for spotting it, in one place only for whitespace but not for tabs was checked, now changed