Pocket Plane Group

Friends and Neighbors => Weimer Republic (WeiDU.org) => WeiDU => Topic started by: Grammarsalad on June 21, 2020, 02:16:37 PM

Title: Using Weidu in non-IE games
Post by: Grammarsalad on June 21, 2020, 02:16:37 PM
So, I've started modding a game called Low Magic Age using Weidu. Unfortunately, in order to do that (locally--obviously, this isn't something I would distribute), I've had to copy my bg dialog.tlk and chintin.key into the Low Magic Age game directory. I'll experiment with dummy files shortly, but thought I would go to the source and see if there is another solution. I'm interested primarily in the simple things--e.g. COPY and REPLACE_TEXTUALLY, but especially the backup folder) so end users don't have to worry about backing up their files. I could see myself using weidu for a number of different games for these basic features.

Is it feasible to make it so weidu doesn't crash if these files--again chintin.key and dialog.tlk--are absent?
Title: Re: Using Weidu in non-IE games
Post by: Argent77 on June 22, 2020, 05:07:09 AM
I don't think chitin.key and dialog.tlk checks can be skipped. From a quick look at the sources these checks are made multiple times throughout the code, so it's probably not trivial to change it. However, it's a simple matter to satisfy this check with (empty) dummy files.

Code: [Select]
// Empty chitin.key
COPY ~.../fl#inlined/null.file~ ~chitin.key~
  INSERT_BYTES 0 0x18
  WRITE_ASCII 0 ~KEY V1  ~ (8)
  WRITE_LONG 0x10 0x18
  WRITE_LONG 0x14 0x18

// Empty dialog.tlk
COPY ~.../fl#inlined/null.file~ ~dialog.tlk~
  INSERT_BYTES 0 0x12
  WRITE_ASCII 0 ~TLK V1  ~ (8)
  WRITE_LONG 0x0e 0x12

Btw, WeiDU will also create an override folder whether you need it or not.
Title: Re: Using Weidu in non-IE games
Post by: Sam. on June 22, 2020, 12:03:28 PM
--nogame ?
Title: Re: Using Weidu in non-IE games
Post by: Grammarsalad on June 23, 2020, 01:14:57 AM
I don't think chitin.key and dialog.tlk checks can be skipped. From a quick look at the sources these checks are made multiple times throughout the code, so it's probably not trivial to change it. However, it's a simple matter to satisfy this check with (empty) dummy files.

Code: [Select]
// Empty chitin.key
COPY ~.../fl#inlined/null.file~ ~chitin.key~
  INSERT_BYTES 0 0x18
  WRITE_ASCII 0 ~KEY V1  ~ (8)
  WRITE_LONG 0x10 0x18
  WRITE_LONG 0x14 0x18

// Empty dialog.tlk
COPY ~.../fl#inlined/null.file~ ~dialog.tlk~
  INSERT_BYTES 0 0x12
  WRITE_ASCII 0 ~TLK V1  ~ (8)
  WRITE_LONG 0x0e 0x12

Btw, WeiDU will also create an override folder whether you need it or not.

Awesome, thanks Argent!

--nogame ?

?

If I understand the question correctly, no, I'm certain that any GAME_IS or ENGINE_IS check will fail.  But, so far I am able to REPLACE_TEXTUALLY, COPY, traify, display a readme, mod version, create folder variables, and so on.  It looks like almost nothing is hardcoded in Low Magic Age, and everything is in lua, so it's pretty easy to make modifications.  I'll be seeing what I can do for a few other games as well, including Realms Beyond, Knights of the Chalice 2, and maybe others as I come across them.  I can upload a simple proof of concept if you like (if you have Low Magic Age).  The only thing that stopped me from uploading it before is I don't want to distribute BG files.  Argent fixed that issue. 
Title: Re: Using Weidu in non-IE games
Post by: Sam. on June 23, 2020, 09:13:39 PM
--nogame ?

?
I ? your ?...

--nogame (https://weidu.org/~thebigg/README-WeiDU.html#hevea_default103) from WeiDU Readme:
Quote
--nogame   Do not load any default game files. Unless you also specified --tlkin, no DIALOG.TLK will be loaded. Unless you also specified --search, no override directory will be used.
Sounds like exactly what you are looking for.  BAM Batcher uses it since it it designed to be a tool independent of a particular game.
Title: Re: Using Weidu in non-IE games
Post by: Grammarsalad on June 25, 2020, 04:05:09 PM
--nogame ?

?
I ? your ?...

--nogame (https://weidu.org/~thebigg/README-WeiDU.html#hevea_default103) from WeiDU Readme:
Quote
--nogame   Do not load any default game files. Unless you also specified --tlkin, no DIALOG.TLK will be loaded. Unless you also specified --search, no override directory will be used.
Sounds like exactly what you are looking for.  BAM Batcher uses it since it it designed to be a tool independent of a particular game.

oohh, awesome!  Thanks!