News:

Please request registration email again and then check your "Spam" folder

Former www.henthighschool.com

[Tool] Tiquionophist's Class Scheduler [1.6.0]

Started by tiquionophist, May 31, 2022, 06:19 AM

Previous topic - Next topic

tiquionophistTopic starter

Sorry for the slow update; the latest release 1.5.0 now supports the new SQLite save file format (in addition to the old XML one) so it should work with HHS+ 1.10.5 out of the box. Please let me know if you run into any issues!


Quote from: TBBle on May 21, 2023, 09:26 PM
Quote from: tiquionophist on Jun 01, 2022, 05:46 AMAnd if anyone has ideas for lighter-weight ways to make the program easier to use I'd be happy to hear them :)

What about a HHS+ mod that outputs the current timetable as a string to be copied into the tool, and can take a string back from the tool to overwrite the timetable. That would isolate the tool from parsing the save-game format, at least.

That would make my job easier :P I'm not terribly interested in writing my own mod for it (if that's even possible without diving into the game engine) but I'd be happy to integrate with something like this. But I did see (at a brief glance) that 1.10.5 also adds some more scheduling functionality so maybe this tool will be less and less necessary over time (which I'd be quite happy with).

TBBle

Quote from: tiquionophist on May 25, 2023, 05:34 AMThat would make my job easier :P I'm not terribly interested in writing my own mod for it (if that's even possible without diving into the game engine) but I'd be happy to integrate with something like this.

That's fair. I believe it is possible from VEE: before I posted I checked that we seem to be able to extract and set timetables and teacher/classroom assignments, (mostly?) without "GetPropByName", but I didn't actually test it.

Perhaps if I have some spare time (and no one gets to it first), I'll look closely at exactly what data your (awesome) tool uses from and to the save file, and see if I can knock-out a mod to dump/load that same data in some parsable text format. (This would also make life easier for anyone who might want to try a different approach to the problem, perhaps.)

No promises though. And honestly, I suspect SQLite-formatted save files means that such an approach isn't as huge a win as it is with XML saves. SQLite is widely and safely supported, and so any system changes that break code using it would likely break the mod too, so it more shifts the maintenance burden than eliminates it.

tiquionophistTopic starter

Sounds good! If it's helpful, the XML properties my program looks at are listed in this file, if you can decipher that - mainly just the subjects/classrooms for each class on day of the week, whether each subject "CanBeTaught", and the people who have associated "TeacherSubjects" (aka employed teachers) and their subject experience levels.

Quote from: TBBle on May 25, 2023, 01:24 PMNo promises though. And honestly, I suspect SQLite-formatted save files means that such an approach isn't as huge a win as it is with XML saves. SQLite is widely and safely supported, and so any system changes that break code using it would likely break the mod too, so it more shifts the maintenance burden than eliminates it.
Definitely agreed here, but just a note that even in the new format, SQLite is just a wrapper on a massive XML blob that still contains all the relevant data (previously the same blob was compressed and encoded in the top-level XML file). But I presume this is the start of a process of moving the actual data into SQLite which would definitely make processing it much more pleasant and standardized.

⚧ Squark

This tool does not work with Lexville saves. It throws the following error:

Error: Invalid UTF-8 middle byte 0x0 (at char #102, byte#-1)

tiquionophistTopic starter

Quote from: ⚧ Squark on Jun 24, 2023, 09:32 AMThis tool does not work with Lexville saves. It throws the following error:

Error: Invalid UTF-8 middle byte 0x0 (at char #102, byte#-1)

Thanks for the report. I'm not able to reproduce this on my own Lexville save in 1.10.5.7, can you share some more details? In particular, are you using version 1.5.0 (or .1 for extra error logging) and at what point do you get this error - importing or exporting the save file?

⚧ Squark

#20
Just downloaded 1.5.0 and now it's throwing a different error:
(I'm using the standalone version)

Error: java/sql/Driver

Hang on, going to try something. BRB
Nope. Might it be that I'm trying it on a previous existing save on 1.10.5.6 and not 1.10.5.7?

The jar version crashes before it even starts with a Java VM error. My Java is the latest version.
I don't particularly want to install the msi build.

Also tried starting a new game with only Lexville running.

GemGem

Quotejava.lang.NoClassDefFoundError: java/sql/Driver
   at java.base/java.lang.ClassLoader.defineClass1(Native Method)
   at java.base/java.lang.ClassLoader.defineClass(Unknown Source)
   at java.base/java.security.SecureClassLoader.defineClass(Unknown Source)
   at java.base/jdk.internal.loader.BuiltinClassLoader.defineClass(Unknown Source)
   at java.base/jdk.internal.loader.BuiltinClassLoader.findClassOnClassPathOrNull(Unknown Source)
   at java.base/jdk.internal.loader.BuiltinClassLoader.loadClassOrNull(Unknown Source)
   at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
   at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
   at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
   at java.base/java.lang.Class.forName0(Native Method)
   at java.base/java.lang.Class.forName(Unknown Source)
   at java.base/java.lang.Class.forName(Unknown Source)
   at org.jetbrains.exposed.sql.Database$Companion.connect(Database.kt:204)
   at org.jetbrains.exposed.sql.Database$Companion.connect$default(Database.kt:195)
   at com.tiquionophist.io.SaveFileIO.openSqliteDb(SaveFileIO.kt:252)
   at com.tiquionophist.io.SaveFileIO.extractData(SaveFileIO.kt:55)
   at com.tiquionophist.io.SaveFileIO.read(SaveFileIO.kt:78)
   at com.tiquionophist.ui.MenuBarKt$MenuBar$4$1$3$1$1.invokeSuspend(MenuBar.kt:122)
   at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
   at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
   at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:570)
   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:677)
   at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:664)
Caused by: java.lang.ClassNotFoundException: java.sql.Driver
   at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(Unknown Source)
   at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(Unknown Source)
   at java.base/java.lang.ClassLoader.loadClass(Unknown Source)
   ... 24 more
Above error I got when trying to import from a save file.
I'm using the LexVille mod as well and the TeacherCompendium mod.

tiquionophistTopic starter

Thanks for the detailed reports! This issue (which was from my release process stripping key dependencies, so I didn't notice it in my own builds) should be fixed in the latest release 1.6.0. I've tested from the release artifacts directly now, but let me know if there are still any issues.

⚧ Squark

#23
Quote from: tiquionophist on Jul 01, 2023, 04:14 AMThanks for the detailed reports! This issue (which was from my release process stripping key dependencies, so I didn't notice it in my own builds) should be fixed in the latest release 1.6.0. I've tested from the release artifacts directly now, but let me know if there are still any issues.
Thanks for that. It works now ^^

dalzomo

I have been using this with the latest releases and haven't had any apparent problems. What, if anything, should I do to eliminate the "checksum doesn't match" popup when loading the scheduler exported save though?

⚧ Squark

#25
The checksum error doesn't matter.
If you're using mods on the save that you run this tool on, that's what happens.

But if it happens with a modless base game then something doesn't quite match up with what the tool expects.