Mimic Logic

Mimic Logic

Not enough ratings
How to Fix "1 Mimic is hiding in a Red/Blue/Black box."
By Onion_Bubs
Ever been surprised when a red chest saying 1 mimic is red turned out to be a mimic? Here's how to change that statement to something much clearer.
   
Award
Favorite
Favorited
Unfavorite
Introduction
A lot of people misunderstand the clue "1 Mimic is hiding in a Red/Blue/Black box" and think it means there's at least one mimic of that colour, just like the clue "There is a Mimic among the Red/Blue/Black boxes". This leads to surprise and frustration when a chest says 1 mimic is hiding in its own colour, a player believes the chest can't be a mimic because then it'd be a truthful mimic, and opens the chest only to discover that it is a mimic along with another chest of the same colour. You see, when a chest says there's 1 mimic of a particular colour, it means there's exactly 1 mimic of that colour. If there's 2, then that chest is lying.

A lot of people have brought this up in the bug report and feedback threads for this game in the Steam forum and a few have submitted screenshots as well, yet the developer has done nothing to resolve the issue. Well, players of Mimic Logic, I bring to you the knowledge that will allow you to say:

.jpg]
Finding the File to Edit
To make the necessary change to the game, you will need to edit a specific game file. To find it, first navigate to your Mimic Logic folder in Steam. A quick way to get there is to right-click the game in your Steam library, and then go to Manage > Browse Local Files.

Once you're there, you need to go into the "www" folder, followed by the "js" folder, and finally the "plugins" folder. In there, you should see a lot of JavaScript (.js) files. The one you need to edit is called BoxTex.


Note: In this screenshot, it says my Steam folder is on my D drive because that's where I installed it. Yours will most likely be in your Program Files (x86) folder on your C drive unless you chose to install Steam somewhere else on your computer.

⚠️ Before you make any changes or even open the file, make a backup copy of this file somewhere on your computer. If you mess up while editing the file, you can break the game to the point where it is literally unplayable. I am not kidding.
Finding and Editing the Right Lines
You made a backup copy of the BoxTex file? Good. You might think you want to double-click the file to open it up, but if you try this, it will try (and fail) to run the JavaScript program. Instead, you need to right-click on the BoxTex file and open it in a text editor of some kind. Notepad works if you don't have anything else, but there are better ones out there.

Once you have opened BoxTex in the text editor of your choice, you need to find the lines that need editing. Luckily, there is a particular phrase on those lines that you can use to find them easily. Open your text editor's Find tool (Ctrl + F is the usual shortcut for this) and look for the phrase "hiding in". You should find this phrase appears on two lines.

One line starts like this:
baseTex = "\x1b>" + tex2 + (tex2 == 1 ? " Mimic is" : " Mimics are") + "\n\x1b>hiding in\n\x1b>"
The other starts like this:
baseTex = "\x1b>" + mimicCount + (mimicCount == 1 ? " Mimic is" : " Mimics are") + "\n\x1b>hiding in\n\x1b>"

They both come out the same in the game and I haven't figured out yet when each one is used or if one of them is unused. Also, you can completely ignore everything after the "hiding in", you won't need to change anything there.

What you need to do now is type the word "Exactly" followed by a space, and you need to type this inside the first set of quote marks on each line just after the text that's already there. If you've done it right, it should look like this in both lines:
baseTex = "\x1b>Exactly " + etc.

Once you have done this, save the BoxTex file and start up Mimic Logic. Now, when you play through the game, you should start seeing that those statements about the number of mimics of a certain colour now begin with the word "Exactly".
But Wait, There's More!
This section is optional as it only improves the presentation of the clue. If you're not that bothered by how it looks in game, you can skip this.

When you first see a chest say "Exactly 1 Mimic is hiding in a Blue box." you might think the text box is a bit wide. This is because:
  1. The game automatically resizes the text box to accommodate the longest line of text in the clue
  2. The game relies on the BoxTex file to tell it when one line ends and another begins
How does the BoxTex file tell the game to start a new line? Any time you see this sequence of characters:
\n\x1b>
That's when the game decides to start a new line in the text. I believe the "\n" is the actual line break and the stuff afterwards is to ensure the new line is properly aligned and formatted in the text box, but I'm not 100% sure. Since every "\n" in the file is followed by those characters, I am assuming you need them there.

So, let's say you want to start a new line after the word "Mimic(s)" instead of "is/are". You can add that series of characters to make a new line in between the words "Mimic" and "is", and the words "Mimics" and "are", replacing the spaces between those two words like this:
== 1 ? " Mimic\n\x1b>is" : " Mimics\n\x1b>are"
And then, where you see those characters before the word "hiding", just delete those and put a space in instead, like this:
+ " hiding in

Additionally, if you've been experiencing the confusion that I mentioned at the beginning of the guide, you might want the game to put extra emphasis on the word "Exactly", maybe by changing it to another colour. Fortunately, there is a special tag that'll let you do just that from within the BoxTex file. The tag looks something like this:
\x1bC[#]
The # will be replaced by a number corresponding to a particular text colour. The ones I've found so far are:
  • 0 = white (default)
  • 1 = blue (as in "There is a Mimic among the Blue boxes.")
  • 2 = red (as in "There is a Mimic among the Red boxes.")
  • 4 = pastel blue (like when you see "no" or "not" in a clue like "The top row contains no Mimics.")
  • 8 = grey (as in "There is a Mimic among the Black boxes."
When you put that colour tag before a word, that word will have its colour changed. But so will everything else after it, since the game doesn't know when to stop unless the code tells it when to stop. So you need to put a second colour tag after it to change back to the usual text colour. You can also use the tag without the square brackets and number to go back to the default colour.

What all this means is, if you want to make the word "Exactly" appear in pastel blue and the rest of the clue to use the same colours it always did, you need to add tags around the word so the code looks like this:
baseTex = "\x1b>\x1bC[4]Exactly\x1bC " + etc.

You can change other things in the BoxTex file to rephrase some of the other clues the chests give you. If you're going to do this, make sure you:
  • Back up the BoxTex file before changing anything
  • Test each change individually so that, if the game ends up screwed up, you know what you did that broke it
  • Begin a new run to test each change - if you load a save file from within a dungeon, the change won't be applied immediately
  • Check Kyper's guide to see which game modes and levels you should do to maximise the odds of seeing your rephrased clues as soon as possible
https://gtm.steamproxy.vip/sharedfiles/filedetails/?id=3173999119
Oops, I Broke It
So you made changes to the BoxTex file, and now when you try to do a dungeon, the game just has a black screen with a message saying something about BoxTex not being referenced or some error message like that.

Did you make a backup copy of BoxTex like I told you to? If so, then you can fix this easily. All you have to do is copy and paste that backup BoxTex file into the folder where the BoxTex file normally goes, making sure you replace the file in there with your backup. The game will go back to how it was before.

If you didn't, then you may have to try to undo the changes within the BoxTex file, verify the integrity of the game files through Steam, or uninstall and reinstall the game. But hopefully you were smart enough to heed my warning and it won't come to this.
5 Comments
Onion_Bubs  [author] 16 Jul @ 4:04am 
@hellie: Imagine seeing a clue that says "Only 3 Mimics are hiding in Red boxes" in a puzzle with 3 mimics.
hellie 16 Jul @ 2:23am 
why exactly instead of only? it's shorter
vCherry_kAI.16 30 Dec, 2024 @ 7:24pm 
One more thing. I REALLY should have tested everything before sending the first two messages. There are unused color code IDs.
5 = Light gray.
7 = Dark gray, darker than 8.
9 = Blue, seemingly identical to 1? Might be a smidge darker
10 = Red, brighter than 2
11 = Dark green
12 = Blue, seemingly lighter than 1 by a smidge
13 = Lavender
15 = Black
16 = Pastel blue, it might be the same as 4 but I have not checked.
18 = Bright red
19 = Very dark gray
20 = Orange
21 = A goldish color that may or may not be the same as 14
22 = A desaturated 1
23 = A blue that is slightly lighter than 1, unsure if it's the same as 12
24 = Pastel green
25 = Brown
26 = Purple
28 = Dark green again?
29 = A slightly different green
30 = Violet
I don't dare test more colors.
vCherry_kAI.16 30 Dec, 2024 @ 6:35pm 
Another update. I didn't think to check the other .js files until after sending that last comment. There are 4 other text colors I found with their respective codes being as follows:
3 = Green. Found in heiretsu.js as the "D" rank text.
6 = Pale yellow. Found in getItem.js.
17 = Yellow. Found in heiretsu.js as the "C" rank text.
27 = Pink. Found in heiretsu.js as the "S"(and above) rank text.
vCherry_kAI.16 30 Dec, 2024 @ 6:15pm 
Very helpful! Also something you might wanna update: I combed all instances of "\x1bC" because I knew there was a color code you hadn't mentioned- a gold-like yellow- and found its ID: 14. It can be found later in the BoxTex file, at line 1049. I did test it, before you ask.