Jump to content


Photo

Some problems


  • Please log in to reply
9 replies to this topic

#1 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 27 August 2011 - 08:44 AM

1. I would suggest the exe-hacking stuff checks for the presence of bgmain.exe instead of checking if the OS is not OS X. The latter excludes Mac users who use WINE and the Windows version of BG2.

2. For Linux and OS X you need to use AT_NOW ~chmod +x %file%~ on tisunpack (and sox for OS X) prior to invoking them, or they may lack the sufficient permissions to do what they are supposed to do.

3. For the mod to work on Linux you need to include a Linux binary of tisunpack. Currently it tries to use the Mac binary. A Linux build of tisunpack is included in the Linux WeiDU package.

4. It'd be good form to mention that the mod also depends on oggdec on Linux. It's probably a vanishingly small number of Linux users who don't already have oggdec installed, but you never know (and it's no fun to find out you need it through trial and error).

#2 Yovaneth

Yovaneth

    The newly-appointed Master Builder of Baldur's Gate

  • Modder
  • 3058 posts

Posted 27 August 2011 - 11:43 AM

I need to leave Miloch to ponder this as he is my .tp2 patching/selecting guru, but it looks as if you have some good points there.

-Y-

#3 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 27 August 2011 - 06:51 PM

1. I would suggest the exe-hacking stuff checks for the presence of bgmain.exe instead of checking if the OS is not OS X. The latter excludes Mac users who use WINE and the Windows version of BG2.

Eh... so you're saying I should change similar such code in Aurora and IA too?

2. For Linux and OS X you need to use AT_NOW ~chmod +x %file%~ on tisunpack (and sox for OS X) prior to invoking them, or they may lack the sufficient permissions to do what they are supposed to do.

I vaguely recall having to do this (somewhere, in some mod, though I also recall it involved Yovaneth). But offhand I'm not sure where it would go.

3. For the mod to work on Linux you need to include a Linux binary of tisunpack. Currently it tries to use the Mac binary. A Linux build of tisunpack is included in the Linux WeiDU package.

Don't suppose you could provide the code needed since you seem to know about it? I do have Linux but am too lazy to try installing Wine, BG, etc. on it (I have enough problems trying to run a decent web/FTP server on it).

4. It'd be good form to mention that the mod also depends on oggdec on Linux. It's probably a vanishingly small number of Linux users who don't already have oggdec installed, but you never know (and it's no fun to find out you need it through trial and error).

If it was my mod, I would phase out use of oggdec entirely, by including compressed WAVs (WAVCs) instead, as we did eventually in Aurora, which seemed to work out a lot better without greatly increasing mod size (OGGs are lossy; WAVCs are not, if I'm not wrong; both are compressed; the latter is the game's default audio format, so it only made sense to me at least).

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#4 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 28 August 2011 - 04:31 AM

Eh... so you're saying I should change similar such code in Aurora and IA too?

Yeah, replace, replace.


Don't suppose you could provide the code needed since you seem to know about it?

Oh, something like this should do:
--- old_setup-dq.tp2	2011-08-28 14:23:56.000000000 +0200
+++ setup-dq.tp2	2011-08-28 14:23:48.000000000 +0200
@@ -85,7 +85,7 @@
 //**********************************************************
 //EXE patches to enable race strrefs and paperdolls are from Taimon and Erephine, respectively
 OUTER_SET tbex = 0 //Assume no TobEx unless detected
-ACTION_IF (~%WEIDU_OS%~ STRING_EQUAL_CASE ~osx~ = 0) BEGIN //if not OS X
+ACTION_IF FILE_EXISTS bgmain.exe BEGIN
   ACTION_IF ((FILE_EXISTS ~TobEx.ini~) AND (FILE_CONTAINS ~TobEx.ini~ ~Externalise Race Selection StrRef=1~)) BEGIN
     OUTER_SET tbex = 1
   END ELSE ACTION_IF (FILE_EXISTS ~TobEx_ini/TobExVer.txt~) BEGIN
@@ -1525,10 +1525,12 @@
   AT_INTERACTIVE_UNINSTALL ~del override\ysbhshrt.wav~
 END ELSE ACTION_IF (~%WEIDU_OS%~ STRING_EQUAL_CASE ~osx~ = 1) BEGIN
   AT_NOW ~shopt -s nocaseglob~
+  AT_NOW ~chmod +x dq/music/sox~
+  AT_NOW ~chmod +x dq/tizpacks/osx/tisunpack~
   AT_NOW ~dq/music/sox dq/music/ysbhall.ogg override/ysbhall.wav~
   AT_NOW ~dq/music/sox dq/music/ysbhshrt.ogg override/ysbhshrt.wav~
   ACTION_BASH_FOR ~dq/tizpacks~ ~.+\.tiz$~ BEGIN
-    AT_NOW ~dq/tizpacks/tisunpack -s -f -o override/%BASH_FOR_RES%.tis dq/tizpacks/%BASH_FOR_RES%.tiz~
+    AT_NOW ~dq/tizpacks/osx/tisunpack -s -f -o override/%BASH_FOR_RES%.tis dq/tizpacks/%BASH_FOR_RES%.tiz~
   END
   AT_INTERACTIVE_UNINSTALL ~shopt -s nocaseglob~
   AT_INTERACTIVE_UNINSTALL ~rm -f override/ys*.tis~
@@ -1536,10 +1538,11 @@
   AT_INTERACTIVE_UNINSTALL ~rm -f override/ysbhshrt.wav~
 END ELSE ACTION_IF (~%WEIDU_OS%~ STRING_EQUAL_CASE ~unix~ = 1) BEGIN
   AT_NOW ~shopt -s nocaseglob~
+  AT_NOW ~chmod +x dq/tizpacks/linux/tisunpack~
   AT_NOW ~oggdec -o override/ysbhall.wav dq/music/ysbhall.ogg~
   AT_NOW ~oggdec -o override/ysbhshrt.wav dq/music/ysbhshrt.ogg~
   ACTION_BASH_FOR ~dq/tizpacks~ ~.+\.tiz$~ BEGIN
-    AT_NOW ~dq/tizpacks/tisunpack -s -f -o override/%BASH_FOR_RES%.tis dq/tizpacks/%BASH_FOR_RES%.tiz~
+    AT_NOW ~dq/tizpacks/linux/tisunpack -s -f -o override/%BASH_FOR_RES%.tis dq/tizpacks/%BASH_FOR_RES%.tiz~
   END
   AT_INTERACTIVE_UNINSTALL ~shopt -s nocaseglob~
   AT_INTERACTIVE_UNINSTALL ~rm -f override/ys*.tis~

Edited by Wisp, 28 August 2011 - 04:31 AM.


#5 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 29 August 2011 - 04:44 PM

Cheers. Eh, remind me when you get to updating this, Yovaneth, unless you want to handle the changes.

While you're here Wisp, we could probably use some help looking at the sc#AddWmpAre function (pretty much the same as dq/wmp/worldmap.tph in FFT). It seems to be multiplying travel times out of control or something (as mentioned here and a few other posts). There is a small routine near the end of it that updates travel times - presumably when you add one link it goes through and updates the offsets for all the rest, but offhand I haven't been able to see where the glitch might be.

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#6 Yovaneth

Yovaneth

    The newly-appointed Master Builder of Baldur's Gate

  • Modder
  • 3058 posts

Posted 30 August 2011 - 02:11 AM

I'll remind you - that's way out of my league!!!:unsure:

-Y-

#7 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 30 August 2011 - 03:34 AM

While you're here Wisp, we could probably use some help looking at the sc#AddWmpAre function (pretty much the same as dq/wmp/worldmap.tph in FFT). It seems to be multiplying travel times out of control or something (as mentioned here and a few other posts). There is a small routine near the end of it that updates travel times - presumably when you add one link it goes through and updates the offsets for all the rest, but offhand I haven't been able to see where the glitch might be.

If I understand the problem correctly (maybe I don't), it's simply a design flaw in sc#addWmpAre. You have 8 hours travel time between Gov. West and the rest of Athkatla because the travel time you specify applies to all links, when what you really want is a per-link value.

You can circumvent the problem by redesigning your own linking strategy. Only link Gov. West to the other Athkatla areas, the same way the other Athkatla areas are linked up (they are linked to each other and only City Gates link to areas outside Athkatla). Then you link the areas outside of Athkatla to City Gates (just City Gates). That way you can have 0 hours between Gov. West and the rest of Athkatla and 8 hours between the whole of Athkatla and the other areas.

(I was originally going to suggest you do this anyway, but at the time I didn't have anything but pedantic reasons to draw upon.)

#8 Miloch

Miloch

    Barbarian

  • Modder
  • 6573 posts

Posted 30 August 2011 - 06:38 AM

If I understand the problem correctly (maybe I don't), it's simply a design flaw in sc#addWmpAre. You have 8 hours travel time between Gov. West and the rest of Athkatla because the travel time you specify applies to all links, when what you really want is a per-link value.

I'm not sure I understand it exactly either, but that makes sense. Would it be easier to fix this in sc#addWmpAre? Though even so, Yovaneth might have to revise the links in the tp2 I suppose since they will differ by direction. He wrote the worldmap patching (or if not, SConrad or someone else did) so he can't pin that one on me :D. (All the areas in my mods are interiors, so I've never had a need to use sc#addWmpAre.)

Infinity Engine Contributions
Aurora * BG1 NPC * BG1 Fixpack * Haiass * Infinity Animations * Level 1 NPCs * P5Tweaks
PnP Free Action * Thrown Hammers * Unique Containers * BG:EE * BGII:EE * IWD:EE
================================================================
Player & Modder Resources
BAM Batcher * Creature Lister * Creature Checker * Creature Fixer * Tutu/BGT Area Map & List * Tutu Mod List
================================================================
"Infinity turns out to be the opposite of what people say it is. It is not 'that which has nothing beyond itself' that is infinite, but 'that which always has something beyond itself'." -Aristotle


#9 ScuD

ScuD
  • Member
  • 492 posts

Posted 30 August 2011 - 08:41 AM

sc#addWmpAre is now included in WeiDU. Are the functions identical in both WeiDU and the mod?

#10 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 30 August 2011 - 09:52 AM

I'm not sure I understand it exactly either, but that makes sense. Would it be easier to fix this in sc#addWmpAre?

It wouldn't not a fix per se. sc#addWmpAre lacks the functionality to give different links different travel times. I guess such functionality could be added, but it wouldn't be backwards portable (mods would need to explicitly make use of it).

sc#addWmpAre is now included in WeiDU. Are the functions identical in both WeiDU and the mod?

They currently do not differ in any pertinent way.