Discussion Using the Journal in Unity

Ok so before everyone gets too mad..... I'm a total newb at Unity and C#...

I saw a video of Na'Qan's overlay and thought "I need that in VR" so I can have a Remlok deploy on screen basically telling me things EDDI says.

So I have gotten this far - I have the image displayed in SteamVR on top of the game, I can make things on the overlay do stuff (i.e. time and switch pictures at a button press)

I can read in the log file if I apply a wrapper round it and add commas to the end of every line. I can change the file to have said wrapper at the start and end of every file but for the life of me I Can't read in a journal file because it's line delimited not comma delimited.

I assume this is a stupid question but if anyone has any ideas I would really appreciate it!

TL:DR How do I use the Journal in Unity?
 
This honestly doesn't sound very much like a "Unity" specific question. I'm making a lot of assumptions here because you're not saying explicitly, but...

I assume by "wrapper" you mean you're adding a '[ ]' at the beginning and end of file.
I assume you're doing this (along with adding a ',' at the end of every line) in order to turn this into a valid JSON array.

Since you're doing this, I assume you're using a JSON parser (Newtonsoft?) to parse in the array.

If this is all true, then instead of trying to parse the whole file at once, parse it one line at a time.

- Read a Line from the Journal File
- Parse that valid JSON
- Store it in an array
- Repeat

Don't bother wrapping the file in '[ ]' or adding commas if you go this route
 
Last edited:
Hi thanks I'm using unitys json utility but it doesn't work with arrays I'm thing I'll need to use a different json tool there is a json.net plugin for unity so will try that

Thanks
 
Hi thanks I'm using unitys json utility but it doesn't work with arrays I'm thing I'll need to use a different json tool there is a json.net plugin for unity so will try that

Thanks

Alright hope that works out for you. The way I mentioned doesn't require parsing a JSON array though, and it's how I read the journal entry. Instead of trying to parse the entire array at once, just load the entire file as text, split the string on "new lines" to get an array of json objects, and parse each of them separately. Just an alternative that doesn't require editing the input Journal
File
 
Back
Top Bottom