Author Topic: Using Weidu in non-IE games  (Read 1343 times)

Offline Grammarsalad

  • Planewalker
  • *****
  • Posts: 4
Using Weidu in non-IE games
« 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?

Offline Argent77

  • Planewalker
  • *****
  • Posts: 187
Re: Using Weidu in non-IE games
« Reply #1 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.

Offline Sam.

  • The moose man
  • Planewalker
  • *****
  • Posts: 86
  • Gender: Male
    • Classic Adventures Homepage
Re: Using Weidu in non-IE games
« Reply #2 on: June 22, 2020, 12:03:28 PM »
--nogame ?
"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"
-- <CHARNAME> to Portalbendarwinden

Offline Grammarsalad

  • Planewalker
  • *****
  • Posts: 4
Re: Using Weidu in non-IE games
« Reply #3 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. 
« Last Edit: June 23, 2020, 06:00:34 PM by Grammarsalad »

Offline Sam.

  • The moose man
  • Planewalker
  • *****
  • Posts: 86
  • Gender: Male
    • Classic Adventures Homepage
Re: Using Weidu in non-IE games
« Reply #4 on: June 23, 2020, 09:13:39 PM »
--nogame ?

?
I ? your ?...

--nogame 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.
"Ok, I've just about had my FILL of riddle asking, quest assigning, insult throwing, pun hurling, hostage taking, iron mongering, smart-arsed fools, freaks, and felons that continually test my will, mettle, strength, intelligence, and most of all, patience! If you've got a straight answer ANYWHERE in that bent little head of yours, I want to hear it pretty damn quick or I'm going to take a large blunt object roughly the size of Elminster AND his hat, and stuff it lengthwise into a crevice of your being so seldom seen that even the denizens of the nine hells themselves wouldn't touch it with a twenty-foot rusty halberd! Have I MADE myself perfectly CLEAR?!"
-- <CHARNAME> to Portalbendarwinden

Offline Grammarsalad

  • Planewalker
  • *****
  • Posts: 4
Re: Using Weidu in non-IE games
« Reply #5 on: June 25, 2020, 04:05:09 PM »
--nogame ?

?
I ? your ?...

--nogame 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!

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: