Author Topic: Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME  (Read 1933 times)

Offline Argent77

  • Planewalker
  • *****
  • Posts: 187
Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME
« on: May 31, 2016, 07:34:01 AM »
Considering that Beamdog is adding support for one new file type after another to their games I'd like to suggest to expand COPY_EXISTING and FILE_EXISTS_IN_GAME, so that they can process even files of unsupported type without terminating the installation process with an error.

Code: [Select]
COPY_EXISTING optNoBackup fromFile toFile [ (resType) ] ...

FILE_EXISTS_IN_GAME fileName [ (resType) ]

The optional numeric argument "resType" can be used to override the resource type
which would be derived from the file extension, otherwise.

Example usage:
Code: [Select]
ACTION_IF ( FILE_EXISTS_IN_GAME ~kitlist.2da~ AND
            FILE_EXISTS_IN_GAME ~bgconfig.xml~ (1036) AND
            FILE_EXISTS_IN_GAME ~journal.js~ (1037) ) BEGIN

  COPY_EXISTING ~kitlist.2da~  ~override~
                ~bgconfig.xml~ ~override~ (0x40c)
                ~journal.js~   ~override~ (0x40d)

END

I don't know whether it's possible to add this functionality to COPY_EXISTING_REGEXP as well.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME
« Reply #1 on: July 09, 2016, 06:25:43 AM »
This would require doing awful things to WeiDU. Pass.

Offline Magus_BGforge

  • Planewalker
  • *****
  • Posts: 75
Re: Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME
« Reply #2 on: July 10, 2016, 12:52:11 PM »
Could you please clarify how is COPY_EXISTING not able to support a file type? I thought it just draws the file, whether from override or biff.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME
« Reply #3 on: July 10, 2016, 03:14:04 PM »
WeiDU supports file types just fine. But only the code that reads and writes the key file has any concept of key values (or whatever you want to call them). Drawing plumbing for key values from TP2 to the unbiffing code would not be nice.
« Last Edit: July 10, 2016, 03:20:27 PM by Wisp »

Offline Argent77

  • Planewalker
  • *****
  • Posts: 187
Re: Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME
« Reply #4 on: July 10, 2016, 05:28:19 PM »
Main problem is currently that you can't fetch a number of new file types (LUA, MENU, PNG, TTF) from the game's biff archives. LUA is needed for properly registering journal entries to the game. LUA, MENU and PNG are heavily used for GUI-related modding.

A feature like this would allow us to modify resources of types that are not yet supported by WeiDU without waiting for a new stable release.

Offline Magus_BGforge

  • Planewalker
  • *****
  • Posts: 75
Re: Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME
« Reply #5 on: July 11, 2016, 11:54:55 AM »
WeiDU supports file types just fine. But only the code that reads and writes the key file has any concept of key values (or whatever you want to call them). Drawing plumbing for key values from TP2 to the unbiffing code would not be nice.
I'm sorry, but I can't make sense of this. What's "plumbing" in this context, and what does it have to do with tp2?

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME
« Reply #6 on: July 24, 2016, 04:27:09 AM »
WeiDU supports file types just fine. But only the code that reads and writes the key file has any concept of key values (or whatever you want to call them). Drawing plumbing for key values from TP2 to the unbiffing code would not be nice.
I'm sorry, but I can't make sense of this. What's "plumbing" in this context, and what does it have to do with tp2?
Successive function calls. A TP2 action calls one (OCaml) function with certain arguments, which may call another, etc. This infrastructure only supports file types, like ARE, ITM and CRE. Adding support for key values would require and almost entirely parallel infrastructure.

Offline the bigg

  • The Avatar of Fighter / Thieves
  • Moderator
  • Planewalker
  • *****
  • Posts: 3804
  • Gender: Male
Re: Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME
« Reply #7 on: July 24, 2016, 10:47:00 AM »
Wouldn't it be far more reasonable (both from Wisp's side and the modders' side) to add a TP2 action to call Key.assoc with user-given values?
Author or Co-Author: WeiDU (http://j.mp/bLtjOn) - Widescreen (http://j.mp/aKAiqG) - Generalized Biffing (http://j.mp/aVgw3U) - Refinements (http://j.mp/bLHoCc) - TB#Tweaks (http://j.mp/ba02Eg) - IWD2Tweaks (http://j.mp/98OFYY) - TB#Characters (http://j.mp/ak8J55) - Traify Tool (http://j.mp/g1Ry9A) - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics (http://j.mp/9UeIwB) - Nalia Mod (http://j.mp/dng9l0) - Nvidia Fix (http://j.mp/aRWjjg)
Code dumps: Detect custom secondary types (http://j.mp/hVzzXG) - Stutter Investigator (http://j.mp/gdtBn8)

If possible, send diffs, translations and other contributions using Git (http://j.mp/aBZFrq).

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1176
Re: Expanding COPY_EXISTING and FILE_EXISTS_IN_GAME
« Reply #8 on: July 24, 2016, 01:21:31 PM »
I suppose. The proposal is that a modder could in TP2 create new and/or alter existing associations between file type XYZ and key value N, for arbitrary XYZ and N. Is there any use for such a feature outside of this particular scenario (EE has new file types but a new WeiDU has not yet been released)?
« Last Edit: July 24, 2016, 01:28:25 PM by Wisp »

 

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)?: