inkle / ink

inkle's open source scripting language for writing interactive narrative.
http://www.inklestudios.com/ink
MIT License
4.14k stars 494 forks source link

Variable is not included in the choice if it is in the start of the choice #825

Closed Adam-A-O closed 1 year ago

Adam-A-O commented 1 year ago

I am very new to Ink, just started using it 20 mins ago, watched a few tutorials and wrote something in it, but I came across an issue, VAR is not included in the choice if it is in the start of the choice

VAR saidPrice = 10
Can I buy this item for {saidPrice} bucks?
* {saidPrice} is not enough.
* no problem.

in the ink interface it shows something like this:

Can I buy this item for 10 bucks?
- is not enough.
- no problem.

but it should be something like this:

Can I buy this item for 10 bucks?
- 10 is not enough.
- no problem.

how can I solve it?

joningold commented 1 year ago

ink is interpreting the variable as a condition. You can tell ink that the content of the choice has begun using a backslashed whitespace character (a \ followed by a space)