Jump to content


Photo

TotDG on Linux


  • This topic is locked This topic is locked
8 replies to this topic

#1 grodrigues

grodrigues
  • Member
  • 9 posts

Posted 18 January 2011 - 12:05 PM

Hi all,

I have downloaded the mod and made a few simple changes so it can be installed in linux (played via Wine).

For any users out there, the instructions are:

- download WeiDU for linux.
- put the executables (WeiDU, WeInstall, tolower, tisunpack at least) in your path; e.g. /usr/local/bin.
- install oggdec. In Ubuntu (and all its variants) this is just:

sudo apt-get install vorbis-tools

For other linux distros check the docs.

- download the mod and run tolower on its contents (and to the whole bg2 folder if you haven't yet).
- download the attached zip file and extract its content into the root TotDG folder.
- apply the included patch to the setup-totdg.tp2 file.
- run WeInstall totdg.
- Play with wine bgmain.exe.

*If* the mod author wants to provide a Linux version, then what he has to do is:

- include the two .sh scripts of the attached zip file in the package.
- apply the included patch to the setup-totdg.tp2 file.
- you can apply tolower to the mod files. If you don't then warn the reader that he *must* do it himself (and to the whole bg2 folder actually).
- make sure to add a notice to the readme that the user *must* have oggdec installed and in the executable path.
- you can delete the oggdec executable and the setup-TotDG.exe file. No harm leaving them in though.

The installation went fine, although I have not installed the map component (changes to the map leave me nervous). I have not played it yet; but once I do I'll provide some feedback -- although play-time is very scarce so this won't happen in a while.

These instructions *may* also work for Mac OS X, but I cannot test it since I have no access to a Mac. If any changes are needed they have to do with filename casing -- but I *think* this is irrelevant. Don't quote on this though.

Any doubts just holler.

Regards,
G. Rodrigues

Attached Files



#2 Lava Del'Vortel

Lava Del'Vortel

    Fiction Enforcer

  • Modder
  • 2299 posts

Posted 18 January 2011 - 12:13 PM

Thanks! I've never used Linux so this is a bit black magic to me, however I have a lot of exams on Uni at the moment. I'll try to take a look at it this weekend, but I can't promise. Well, you can make the version and send it to my e-mail adress too, however I understand that you may have better things to do ;) When this is done, I will upload Linux version in TotDG downloads :) The thing is I have no possibility to check if it works fine...

:cheers:

Edited by Lava Del'Vortel, 18 January 2011 - 12:19 PM.


#3 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 18 January 2011 - 01:15 PM

You don't need shell scripts or batch files. You can call oggdec (or sox or tisunpack or whatever) directly from your tp2 file. E.g. here's how the next version of Kelsey will do it:
ACTION_IF ~%WEIDU_OS%~ STRING_EQUAL_CASE win32 BEGIN
  AT_NOW ~kelsey\audio\oggdec kelsey\audio\soa\*.ogg~
  ACTION_BASH_FOR ~kelsey/audio/soa~ ~.*\.wav$~ BEGIN
    MOVE ~%BASH_FOR_FILESPEC%~ override
  END
END ELSE ACTION_IF "%WEIDU_OS%" STRING_EQUAL_CASE osx BEGIN
  ACTION_BASH_FOR ~kelsey/audio/soa~ ~.*\.ogg$~ BEGIN
    AT_NOW ~kelsey/audio/sox %BASH_FOR_FILESPEC% kelsey/audio/soa/%BASH_FOR_RES%.wav~
    MOVE ~kelsey/audio/soa/%BASH_FOR_RES%.wav~ override
  END
END ELSE ACTION_IF "%WEIDU_OS%" STRING_EQUAL_CASE unix BEGIN
  AT_NOW ~oggdec kelsey/audio/soa/*.ogg~
  ACTION_BASH_FOR ~kelsey/audio/soa~ ~.*\.wav$~ BEGIN
    MOVE ~%BASH_FOR_FILESPEC%~ override
  END
END


#4 grodrigues

grodrigues
  • Member
  • 9 posts

Posted 19 January 2011 - 07:55 AM

You don't need shell scripts or batch files. You can call oggdec (or sox or tisunpack or whatever) directly from your tp2 file.


Thanks Wisp, this is really helpful.

@Lava Del'Vortel: On second thought, I would advise against uploading a linux version of TotDG. The reason is very simple: you have no way of testing it. If you have to fix bugs or want to add new stuff, the linux version will fall out of synch and become useless. IMHO, what you should do is the following:

1. Apply the patch attached at the end of this post to the main .tp2 file.

The patch uses Wisp code to call in the necessary utilities according to platform. At the moment this is the *only* compatibility problem that must be solved by tinkering with the mod itself. You can delete the .bat scripts as all the conversion and moving of ogg files is done within WeiDU. It should also work on Mac OS X as long as the user has oggdec in the executable path.

If you have any doubts about applying patches just holler.

Note: the patch file is zipped. For some reason, I am not allowed to upload .patch files.

2. Add a note to the readme about Linux install and point to this thread (even pin it?). Put the burden on the user and, like Pontius Pilate, wash off your hands of the whole business.

3. In the meantime, I will edit my first post with even more details about getting TotDG to work on Linux (even to the point of pedantery) -- probably in the weekend, as I am tight on time right now. The plain matter of fact is that BG2 is a Windows program and to run it from Linux you have to jump through some hoops. OTOH, the general linux user is more tech-savvy, and if he really wants to play BG2 he must dirty his hands. For the record, the best advice for linux users and modders can be found here: BG2 for linux users and modders. Of course, to *really* understand the instructions one must understand the differences between linux and windows. I'll say something about that when I come around to edit my first post.

Regards,
G. Rodrigues

Attached Files



#5 Turambar

Turambar
  • Modder
  • 935 posts

Posted 20 January 2011 - 12:21 AM

You don't need shell scripts or batch files. You can call oggdec (or sox or tisunpack or whatever) directly from your tp2 file. E.g. here's how the next version of Kelsey will do it:

ACTION_IF ~%WEIDU_OS%~ STRING_EQUAL_CASE win32 BEGIN
  AT_NOW ~kelsey\audio\oggdec kelsey\audio\soa\*.ogg~
  ACTION_BASH_FOR ~kelsey/audio/soa~ ~.*\.wav$~ BEGIN
    MOVE ~%BASH_FOR_FILESPEC%~ override
  END
END ELSE ACTION_IF "%WEIDU_OS%" STRING_EQUAL_CASE osx BEGIN
  ACTION_BASH_FOR ~kelsey/audio/soa~ ~.*\.ogg$~ BEGIN
    AT_NOW ~kelsey/audio/sox %BASH_FOR_FILESPEC% kelsey/audio/soa/%BASH_FOR_RES%.wav~
    MOVE ~kelsey/audio/soa/%BASH_FOR_RES%.wav~ override
  END
END ELSE ACTION_IF "%WEIDU_OS%" STRING_EQUAL_CASE unix BEGIN
  AT_NOW ~oggdec kelsey/audio/soa/*.ogg~
  ACTION_BASH_FOR ~kelsey/audio/soa~ ~.*\.wav$~ BEGIN
    MOVE ~%BASH_FOR_FILESPEC%~ override
  END
END

To make the uninstallation complete, I think we could also add some uninstallation info, to delete the wav files when you uninstall the mod (and thus restoring the original situation).
The move should be reversed by weidu, so I think something like
AT_UNINSTALL ~rm kelsey/audio/soa/*.wav~
could work.
There are many mods which could be easily modified like this to support all os (other AT_actions I've seen are, for instance, tisunpack, which works approximately like oggdec, some temporary directories which have to be removed, and some mods which still make biffs in an old way, with an AT_EXIT action). Ive just tried with SOS, you can have a look at this.

edit: i think you could use the new ACTION_MATCH instead of three ACTION_IF ... THEN... ELSE...

Edited by Turambar, 20 January 2011 - 03:12 AM.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#6 grodrigues

grodrigues
  • Member
  • 9 posts

Posted 20 January 2011 - 03:47 AM

To make the uninstallation complete, I think we could also add some uninstallation info, to delete the wav files when you uninstall the mod (and thus restoring the original situation).
The move should be reversed by weidu, so I think something like

AT_UNINSTALL ~rm kelsey/audio/soa/*.wav~
could work.


Unless I am reading the WeiDU docs wrong, the AT_UNINSTALL command is *not* necessary, as the MOVE command is "undone" at install. Quoting from the docs:

You may specify as many fromFile-toFile pairs as you like. Each fromFile is moved to its associated toFile. Wildcard support will be added on request.
Safety notes: when uninstalling, MOVE is restored first, then all generic actions are restored, then AT_*!UNINSTALL is handled. As such, do your AT_NOW, then do your COPY, then do your MOVEs (exception: if you MOVE for biffing purposes, it is safe to call MAKE_BIFF after MOVE.


Regards,
G. Rodrigues

#7 Turambar

Turambar
  • Modder
  • 935 posts

Posted 20 January 2011 - 05:09 AM


To make the uninstallation complete, I think we could also add some uninstallation info, to delete the wav files when you uninstall the mod (and thus restoring the original situation).
The move should be reversed by weidu, so I think something like

AT_UNINSTALL ~rm kelsey/audio/soa/*.wav~
could work.


Unless I am reading the WeiDU docs wrong, the AT_UNINSTALL command is *not* necessary, as the MOVE command is "undone" at install.
Regards,
G. Rodrigues

It's not necessary, you're right, but I think it can be useful.
Without that, you would have, after uninstalling, in the audio folder, both the .ogg and .wav versions of the audio files (the MOVE to the override folder will be reversed, but not the conversion). That's not a problem for the game, as it's not in a game folder anymore, but it would occupy quite a lot of space (wav files are quite heavy), and it could interfere with re-installation as the ogg decoder will find already existing files.

Turambar

Currently supporting: DSotSC for BGT, NTotSC - forum

Turambar's fixes and tweaks for BG2, BGT, DSotSC, NTotSC, SoBH and more!

 

Before posting questions (even regarding posts written by myself), please look at Jarno Mikkola's FAQs for the Megamods!
(how to correctly report CTDs)

 


vipersig.jpg


#8 Wisp

Wisp
  • Modder
  • 1353 posts

Posted 20 January 2011 - 05:24 AM

It's not necessary, you're right, but I think it can be useful.
Without that, you would have, after uninstalling, in the audio folder, both the .ogg and .wav versions of the audio files (the MOVE to the override folder will be reversed, but not the conversion). That's not a problem for the game, as it's not in a game folder anymore, but it would occupy quite a lot of space (wav files are quite heavy)

If you are uninstalling the mod and are concerned by a few hundred megabytes of disk space, you should delete the mod folder. OGG files aren't that small themselves.

and it could interfere with re-installation as the ogg decoder will find already existing files.

It doesn't interfere.

Edited by Wisp, 20 January 2011 - 05:25 AM.


#9 grodrigues

grodrigues
  • Member
  • 9 posts

Posted 20 January 2011 - 05:59 AM

It's not necessary, you're right, but I think it can be useful.
Without that, you would have, after uninstalling, in the audio folder, both the .ogg and .wav versions of the audio files (the MOVE to the override folder will be reversed, but not the conversion). That's not a problem for the game, as it's not in a game folder anymore, but it would occupy quite a lot of space (wav files are quite heavy), and it could interfere with re-installation as the ogg decoder will find already existing files.


Right, but IMHO this is not a big problem and not worth adding extra coding to the delete the converted wav files. Even more so, because as Wisp said, the oggdec decoder will not get confused. The burden should be left to the user to clean up the mod folder.

Regards,
G. Rodrigues

Edited post: misread Turambar's comments, so fixing my earlier comment.

Edited by grodrigues, 20 January 2011 - 06:13 AM.