Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
The Append on print 3 works fine for some reason.
But if I replace:
What version of the game are you using? (1.0.9?)
On what ingame computer did you run your code (type and location, or better name)?
And i suspect that is the only code you had on this computer?
(And no other computer connected to this computer and did things (remote execution interrupts the local program flow as far as i remember)? Though this is probably not the reason..)
I remember there being something a bit fishy with array handling last time i checked the EHB code.. but this was half a year ago.. maybe i get back to it during the holidays and can give a you a more in-depth answer. In the meantime some random facts about EHB arrays:
- For arrays I always use `var` instead of `array`, although i don't remember the exact reason why.. just that there was some.. xD
- array initialization from a string is kinda messed up (check the standard code of stoves, and replace `array letters` with `string letters` or `var letters` to see what i mean)
- EHB "arrays" are actually more like "dictionaries" in other progamming languages, meaning you can use arbitrary things as index, not only numbers. e.g. `list["hey"] = "you"` is valid.
To answer the previous comment:
1.0.9 yes.
A few of the computers, some on the walkway above the plaza, the hotel's lobby computer and other random ones. And yes it was the only code I used.
It still doesn't work really as expected but I have at least found an easy work-around.
To get it to work. you have to declare empty arrays for them to be 'Append'-able.
If you assign any number of elements using the '=' operator to a variable, a subsequent 'Append' will crash the execution of the whole program. (with no smoke smoke or sparks visible).
I have written a simple function to be able to declare an array with pre-existing elements if anyone else also stubles uppon this problem:
EDIT:
Also tried the game through proton, doesn't seem to work either. So not a linux problem most likely.
Running the latest version, not running Linux, so it's a safe assumption (including the output errors from Unity) that it applies to all versions and OS.
After running the broken code, output_log.txt contains the following:
Doubt it'll get officially fixed, but I read something about open source, so someone might come along and drop a solution.
(I've also managed to break Print doing unusual things, except that bug doesn't result in an invisible failure -- It instead complains about not being able to pretty text. Related but separate, I've also managed to cause in-game run-time errors (program compiles fine but smokes out mid-run) by trying code reflection, attempting to daisy-chain connects and remote calls.)
Will compile fine, and run "fine", and give the output of:
However, after doing so the computer/program will smoke, and upon checking it will have 2 errors (also logged to output_log.txt from Unity):
Error: Can't find the index 'System.Collections.Generic.SortedDictionary`2[ProgrammingLanguageNr1.KeyWrapper,System.Object]' (array) in the array 'arr1'
Error: Can't access value (have you forgotten to return a value from a function?)
The unusual part is that it runs to completion before smoking, and acts as if the Append was never there until after the fact...
One last thing on Append, this will work and spit out no errors:
Unrelated but also bugged: You can soft-lock yourself by moving into your inventory
-- From any Recorder, or TrapAPI, MovePerson("Sebastian","SebastianCreditCard") if it's in your inventory, or by Slurping to the same place with Connect("SebastianCreditCard") Slurp()
I had thought to use Count() but wasn't familiar with it yet so I hadn't used it. I wonder if Count is faster than looping over the array hmm
On your first example:
It seems like it's trying to use the type or the "address" of 'arr1' to try and dereference the array or something like that. You can get the same behavior by decalring another array or var with no value (instead of Generic.SortedDictionary, you get a Generic.UknownType something like that) and Append to arr1[<var>].
But yeah, the fact that it runs to completion is weird. I put the append and print part into a loop, it runs once, but you get an error on the second iteration on the Append's line.
On you second example I think it works because you are actually Appending to a empty array, "arr1[arrc]" is an undeclared/undefined index/variable, when you Append to it you create an array and it doesn't crash since that array is empty.
This works too for example: