Hi, I can’t work out why when I run this segment of code a space is appearing between the quotation mark and the start of the text? It’s supposed to be a bit of dynamic dialogue based on the player stats, but it is currently showing as:
" You are a loyal servant of the King. You are ambitious and wise."
Code
"
*if (patronage > 65)
You are a loyal servant of the King.
*goto nextcheck
*else
*goto nextcheck
*label nextcheck
*if (respect > 65)
You command the respect of the armies.
*goto nextcheck2
*else
*goto nextcheck2
*label nextcheck2
*if (ambition > 65)
You are ambitious and wise.
*goto elzar2
*else
*goto elzar2
I suspect that’s just the way choicescript works. The space is probably automatic. There’s likely a few work arounds you could use to get the same effect. All the sentences start with You, so perhaps just do "You
1 Like
You either have a space after the quotation mark above, or an extra space right before the “You”.
Edit: how large is one of your indents?
I have neither, honestly.
1 Like
Because the quotation mark and text are on separate lines ChoiceScript automatically adds a space. It’s a bit annoying, but in this case @FairyGodfeather’s proposed workaround should work.
3 Likes
Hi Cecilia how would that work in this case they are 3 seperate sentences? The If statements determine which sentences will be displayed together.
You tweak the phrasing of them.
1 Like
It may be more trouble some, but you could make six in total, 3 starts, and 3 ends to the sentences.
@Synapse
Just to be clear; "You is where currently " is in your code at the very top.
Alternatively you can write: "You are at the top then change the respect entry to read: respected by the armies.
The text for each will then show:
"You are a loyal servant of the King…
"You are respected by the armies…
"You are ambitious and wise …
1 Like
Alternately, is there a reason not to delete the beginning inverted commas (quotation marks), and add them manually to the text in each choice, since there’s the spacing issue with punctuation and *if statements?
By the by, one runs into the same issue if, say, you’d put the closing full stop (period) after a series of *if statements that redirect to the same place, not just before.
1 Like
You could add a brief start and finish clause that’s not *if-dependent, e.g.
"Who are you?
*if (patronage > 65)
You are a loyal servant of the King.
*if (respect > 65)
You command the respect of the armies.
*if (ambition > 65)
You are ambitious and wise.
All these things are true."
*goto elzar2
Those example clauses are so generic they’re kind of awful, but knowing the context I’m sure you can come up with something more satisfying.
Incidentally, coding it the way I do above should work the same as your code without all the *gotos
and *labels
. You’d only need the *else/*goto/*label
business if the *else
had some text after it, e.g.
"Who are you?
*if (patronage > 65)
You are a loyal servant of the King.
*goto nextcheck
*else
You are a traitor and blackguard.
*goto nextcheck
*label nextcheck
*if (respect > 65)
You command the respect of the armies.
*goto nextcheck2
*else
You look terrible in uniform.
*goto nextcheck2
*label nextcheck2
*if (ambition > 65)
You are ambitious and wise.
*goto elzar2
*else
You're a f*#&ing idiot.
*goto elzar2
*label elzar2
All these things are true."
Edit: or, inspired by a re-reading of Zolataya’s suggestion, you could use semicolons:
"You are
*if (patronage > 65)
a loyal servant of the King;
*if (respect > 65)
respected by the armies;
*if (ambition > 65)
ambitious and wise;
and a true scion of your homeland."
*goto elzar2
As long as there’s something appropriate and non-stat-dependent for that last clause.
5 Likes