Author Topic: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2  (Read 592 times)

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
In the Early Days of Yore(tm), when Solaufain was a young mod, Smoketest and devSin and Nythrun battled Fierce Clashes in Arcane Languages, and the bigg was just cutting his baby teeth on OCaml, we went through some practice standardization about the position of the .tp2 and "best practices". While WeiDU kept legacy position maintained, most folks moved from

->[MyMod]
->setup-mymod.tp2

to

-> [MyMod]
- - >setup-mymod.tp2

It worked pretty well, as transitions go, with a few bug reports here and there due to users extracting the old over the new, with two setup-mymod.tp2 on the same install (one in the same directory as the mod folder and the other new one inside that folder), and there was some adjustment of priority order for .tp2, and voila... the Mountain Moved. (Most of the Mountain. My mod archive has a few lingering "old skool" behaviors floating about in the field like prehistoric mammoths, peering over at all the nice domesticated cattle with their fancy ".ini files" and their "AUTO_TRA", etc.)

Now I am reading great stuff back and forth here and at G3 between the Heavies - folks who really are rebuilding again great functionality behind the scenes. Way cool. But I am fuzzy on the way WeiDU now really handles mod setup.

Are we now at a point where the other huge Legacy Behavior is able to be changed, dispensing with SETUP-MYMOD?

Such that (yes for cross-system-architecture all lowercase, but with caps here for clarity)

-> [MyMod]
- - > MyMod.ini
- - > MyMod.tp2
- - > [lib]
- - > [lang]
- - > [media]
- - > [docs]

etc.

Is there still a need for WeiDU to see and verify SETUP- as the trigger to do things like run the autoupdate, and do all the other "here is the instruction set that takes priority and does the Heavy Lifting"?

 I assume that this is the case, but I want to make absolutely sure and clear "frm the source". CamDawg has a great new Amber v5 package out, and I noticed the .tp2 change there. I am restructuring based on his example.

Follow-up question (probably for another topic, but might as well ask): Are there other extant legacy behaviors in .tp2/.d/.baf that are now really cruft being dragged along (stuff like DECOMPILE_AND_PATCH replacing DECOMPILE / COMPILE calls, etc.) ?



Offline The Imp

  • Planewalker
  • *****
  • Posts: 281
  • Gender: Male
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #1 on: February 03, 2019, 01:46:53 PM »
Quote
Such that (yes for cross-system-architecture all lowercase, but with caps here for clarity)

-> [MyMod]
- - > MyMod.ini
- - > MyMod.tp2
- - > [lib]
- - > [lang]
- - > [media]
- - > [docs]
The folder names can be what ever the cheese you wish them to be, their usability doesn't alter... you can even use your native languages names for them, as long as it's using the keys that are compatible with the "UTF-8 without BOM" code in the .tp2 file.
The .ini files are as far and few between as they were before. They don't offer anything new... so it being in a .ini or .tpa for example has no difference.

And to clarify, it's just:

[MyMod-folder]/setup-mymod.tp2

... not any of this mess:
"->[MyMod-folder]
- - >setup-mymod.tp2"

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 832
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #2 on: February 03, 2019, 02:34:33 PM »
I dropped the setup- from Amber since Alien mentioned it would make it easier for Project Infinity coding. The metadata ini is also for PI compatibility--while not strictly necessary, it does make it easier.

AFAIK the only difference between setup-mymod.tp2, mymod.tp2, mymod/setup-mymod.tp2, and mymod/mymod.tp2 is the order in which WeiDU looks when invoked from a setup program.
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #3 on: February 03, 2019, 03:59:32 PM »
That's the key question - glad it is just "order it looks for instructions". I would be happy to promote
(clarified for The Imp without arrows to denote file structure and the difference between a mod file and directory structure)

D:\mydirectory\mygamefolder\mymod\
D:\mydirectory\mygamefolder\mymod\mymod.ini
D:\mydirectory\mygamefolder\mymod\mymod.tp2
D:\mydirectory\mygamefolder\mymod\lib\  etc.


Offline Mike1072

  • Planewalker
  • *****
  • Posts: 296
  • Gender: Male
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #4 on: February 03, 2019, 11:38:14 PM »
Short version:

There's no need to prefix the .tp2 filename with setup-.

If you have an existing mod that uses a setup- prefix on the .tp2 and you want to remove it in a new version, that can be done without any issues assuming you're using WeiDU v239 or newer.
« Last Edit: February 03, 2019, 11:39:38 PM by Mike1072 »

Offline jastey

  • Planewalker
  • *****
  • Posts: 1325
  • Gender: Female
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #5 on: February 04, 2019, 10:55:00 AM »
I dropped the setup- from Amber since Alien mentioned it would make it easier for Project Infinity coding. The metadata ini is also for PI compatibility--while not strictly necessary, it does make it easier.
It's a tricky one, though, as there might be mods that check for MOD_IS_INSTALLED ~SETUP-modname.TP2~. I re-attached the setup- to the setup-ntotsc.tp2 because of this.

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 832
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #6 on: February 04, 2019, 11:34:08 AM »
I dropped the setup- from Amber since Alien mentioned it would make it easier for Project Infinity coding. The metadata ini is also for PI compatibility--while not strictly necessary, it does make it easier.
It's a tricky one, though, as there might be mods that check for MOD_IS_INSTALLED ~SETUP-modname.TP2~. I re-attached the setup- to the setup-ntotsc.tp2 because of this.

Huh. I actually got the exact opposite result when I tested this. MOD_IN_INSTALLED ~amber/setup-amber.tp2~ ~0~ (or whatever the exact syntax) still detected amber/amber.tp2. FWIW Alien also mentions it doesn't matter.
« Last Edit: February 04, 2019, 11:35:00 AM by CamDawg »
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline CamDawg

  • Infidel
  • Planewalker
  • *****
  • Posts: 832
  • Dreaming of a red Xmas
    • The Gibberlings Three
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #7 on: February 04, 2019, 12:02:18 PM »
Just did a quick test on my BGT install, and received success messages on all four variants using this:

Code: [Select]
ACTION_IF MOD_IS_INSTALLED ~bgt.tp2~ ~0~ BEGIN
  PRINT ~BGT detected using bgt.tp2~
END

ACTION_IF MOD_IS_INSTALLED ~bgt/bgt.tp2~ ~0~ BEGIN
  PRINT ~BGT detected using bgt/bgt.tp2~
END

ACTION_IF MOD_IS_INSTALLED ~setup-bgt.tp2~ ~0~ BEGIN
  PRINT ~BGT detected using setup-bgt.tp2~
END

ACTION_IF MOD_IS_INSTALLED ~bgt/setup-bgt.tp2~ ~0~ BEGIN
  PRINT ~BGT detected using bgt/setup-bgt.tp2~
END
The Gibberlings Three - Home of IE Mods

The BG2 Fixpack - All the fixes of Baldurdash, plus a few hundred more. Now available, with more fixes being added in every release.

Offline jastey

  • Planewalker
  • *****
  • Posts: 1325
  • Gender: Female
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #8 on: February 04, 2019, 12:47:27 PM »
Oh, that's good to know. Thank you for testing it out! I didn't know that.

Offline jastey

  • Planewalker
  • *****
  • Posts: 1325
  • Gender: Female
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #9 on: February 04, 2019, 12:48:44 PM »
This also works for "REQUIRE_COMPONENT", I assume.

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 1064
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #10 on: February 05, 2019, 12:14:40 PM »
The "setup-" prefix for TP2 files is historical baggage. WeiDU strips it off for internal use and as Mike said, "setup-" has lower precedence than just mymod.tp2 since v239. The "setup-" prefix for the executable is a different matter. WeiDU needs something to know it's supposed to run with certain implied arguments.

Offline cmorgan

  • Planewalker
  • *****
  • Posts: 1424
  • Gender: Male
  • Searcher of Bugs
Re: [Information Request] 2019 Revisit SETUP-MYMOD.TP2 vs MYMOD.TP2
« Reply #11 on: February 06, 2019, 10:33:57 PM »
Cool - now I know why something was ticking away in the back of my brain...

../setup-mymod.exe
../mymodfolder/mymod.tp2
../mymodfolder/mymod.ini

It is 😎

 

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