# Multireplace "invalid @{} variable substitution"

**URL:** <https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722>\
**Category:** ChoiceScript Help\
**Created:** [April 13, 2018, 2:46am UTC](https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722 "2018-04-13T02:46:38Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gregory\_Maus](https://avatars.discourse-cdn.com/v4/letter/g/c77e96/32.png) [@Gregory\_Maus](https://forum.choiceofgames.com/u/Gregory_Maus)\
**Post date:** [April 13, 2018, 2:46am UTC](https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722/1 "2018-04-13T02:46:38Z")

</div>

I’m having trouble with multireplace.

The error I’m getting is: “Error: court line 68: invalid @{} variable substitution at letter 1”

My code looks like this:

> It is  
> @{palace\_grandeur a squat room held up by thick columns | a fair hall of great columns | an airy hall with great columns | a large hall with great columns |  
> an incredible engineering achievement, as ceiling is supported by thin columns | easy to see why travelers think Ured was built by giants, for your  
> massive throneroom’s arched ceilings are supported by almost impossibly thin columns | easy to see why travelers think Ured was built by giants, for your  
> colossal throneroom is a truly-awe inspiring sight, a wonder of the world fit to seat the most honored of gods. Its columns }

The variable “palace\_grandeur” is established in startup as

> \*create palace\_grandeur 1

And altered in lines from the earlier part of the scene (potentially increased.) There’s no way that it would drop below 1 or rise above the maximum number of options.

---

<div class="post-metadata">

**Author:** ![Carlos.R](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/carlos.r/32/75837_2.png) [@Carlos.R](https://forum.choiceofgames.com/u/Carlos.R)\
**Post date:** [April 13, 2018, 3:11am UTC](https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722/2 "2018-04-13T03:11:51Z")

</div>

Try to add this in somewhere just to test if other stuff is working (then take it out later):

```
*temp test ""
*set test "@{palace_grandeur 1|2|3|4|5|6|7|8|9|10}"

palace_grandeur = ${test}

```

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [April 13, 2018, 3:18am UTC](https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722/3 "2018-04-13T03:18:24Z")

</div>

I don’t think you can add line break/enter inside multireplace.

---

<div class="post-metadata">

**Author:** ![Gregory\_Maus](https://avatars.discourse-cdn.com/v4/letter/g/c77e96/32.png) [@Gregory\_Maus](https://forum.choiceofgames.com/u/Gregory_Maus)\
**Post date:** [April 13, 2018, 3:20am UTC](https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722/4 "2018-04-13T03:20:45Z")

</div>

> [@Carlos.R](#):
>
> Try to add this in somewhere just to test if other stuff is working (then take it out later):
> 
> \*temp test “”  
> \*set test “@{palace\_grandeur 1|2|3|4|5|6|7|8|9|10}”
> 
> palace\_grandeur = ${test}

Thanks for the test.  
That part indeed functioned just fine.

> [@Szaal](#):
>
> I don’t think you can add line break/enter inside multireplace.

Oh. So you’re saying that it all has to be one very long line of code? That’s cumbersome.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [April 13, 2018, 3:22am UTC](https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722/5 "2018-04-13T03:22:19Z")

</div>

Well, you can always use `*if` for long paragraphs. There’s no much difference, and it’s also looks more tidier `¯\_(ツ)_/¯`

* * *

Or you can _endure the pain_

> **Summary**
>
> `A young, ${appearance} of teenage years with a ${skin_col} colored skin. @{(transmorphed = 4) Facial features include ${eye_col}|A transmorphed, with ${eye_col}} eyes and @{hair_l bald head, claimed that ${pc_he} can't grow ${pc_hisl} hair.|bald hair on registration date. Claimed that ${baldlol}, and the hair is of a ${hair_col} color and|||||} @{(hair_t + 1) |||Straight|Wavy|curly}@{(hair_l = 2) type when not bald.|,} @{hair_l ||very-short hair.|short hair.|fairly long hair.|fairly long hair.|long hair.}`  
> And deal with it 😈
> 
> * * *
> 
> It’s one of my single line-code in my WiP.

---

<div class="post-metadata">

**Author:** ![Franzinyte](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/franzinyte/32/170556_2.png) [@Franzinyte](https://forum.choiceofgames.com/u/Franzinyte)\
**Post date:** [April 13, 2018, 3:27am UTC](https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722/6 "2018-04-13T03:27:12Z")

</div>

> [@Szaal](#):
>
> I don’t think you can add line break/enter inside multireplace

You can add `*line_breaks` by typing in `[n/]`! I’m doing that in my WIP, actually.

---

<div class="post-metadata">

**Author:** ![Szaal](https://sea3.discourse-cdn.com/choiceofgames/user_avatar/forum.choiceofgames.com/szaal/32/112202_2.png) [@Szaal](https://forum.choiceofgames.com/u/Szaal)\
**Post date:** [April 13, 2018, 3:27am UTC](https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722/7 "2018-04-13T03:27:38Z")

</div>

Ah, yes. `[n/]` is an exception.

---

<div class="post-metadata">

**Author:** ![Gregory\_Maus](https://avatars.discourse-cdn.com/v4/letter/g/c77e96/32.png) [@Gregory\_Maus](https://forum.choiceofgames.com/u/Gregory_Maus)\
**Post date:** [April 13, 2018, 3:43am UTC](https://forum.choiceofgames.com/t/multireplace-invalid-variable-substitution/37722/8 "2018-04-13T03:43:00Z")

</div>

That worked. Thanks @Szaal for identifying the root of the problem.
