Jump to content


Photo

Discussion: Porting WeiDU Mods to Mac OS X


15 replies to this topic

#1 CamDawg

CamDawg

    Just returned from a triumphant carpet-bombing of Eden 7

  • Gibberling Poobah
  • 8732 posts
  • Gender:Not Telling

Posted 09 April 2004 - 07:12 AM

edit: this thread was started as a request for a Mac port tutorial request. Now the tutorial is written but I don't feel like locking it so it's now a comment thread. :D

I know there are many folks here who play BG2 on the Mac side. Not having a Mac around to test mods on, I was hoping we could get someone to help with some Mac-friendly tips. The two items I do know:

* EXE files won't execute on a Mac (of course) so self-extracting exe installers are out. I know StuffIt is a popular compression format for Macs and zip files also work. Not sure about other formats--rar, ace, etc.
* File paths in the tp2 should not be delimited with \. Use / instead as it works on both Mac and Windows.

Can anyone help?

What makes a good man go neutral? Lust for gold? Power? Or were you just born with a heart full of neutrality?


#2 Idobek

Idobek

    Dust Bunny

  • Modders
  • 1001 posts
  • Gender:Male
  • Location:England

Posted 09 April 2004 - 07:51 AM

If you think you can handle a few rants about the short comings of Windows and the superiority of Macs, I suggest you post this at the Adventurers' Spa & Grill. Unless you already have. :D

Disclaimer: Idobek is joking when he makes comments refering to Mac/PC users and their differences of opinion.
<SimDing0> Did you know G3 has secret forum rules?
<CamDawg> Yep. They're generally of the nature 'don't annoy Idobek.'

#3 icelus

icelus

    Do you have a flag?

  • Modders
  • 1929 posts
  • Gender:Male
  • Location:Houston, Texas

Posted 09 April 2004 - 08:01 AM

This would be most helpful. Although there are a few different ways to code the same thing in a .tp2, it would be nice to know which way is the most universally compatible.

#4 CamDawg

CamDawg

    Just returned from a triumphant carpet-bombing of Eden 7

  • Gibberling Poobah
  • 8732 posts
  • Gender:Not Telling

Posted 12 April 2004 - 08:47 PM

Lo folks,

Scar was kind enough to post some pointers over at the Spa and Grill. I've already asked for a copy of Mac WeiDU v154 so we can use BUT_ONLY_IF_IT_CHANGES. (Best. WeiDU. Flag. Ever.) Also, I requested a little bit more info on #6 for the ogg -> wav conversion on OS X.

Normally a WeiDU mod for Windows works fine on a Mac with little to no changes. Yet, a few basic rules:

1. Use / instead of \ in paths.
2. For regexps \ is fine and necessary [1].
3. Don't use EXE installers. RAR and ZIP work fine (even the self extracting versions).
4. A setup-xyz.exe for Windows doesn't help much. Either include a Mac version or leave it out completely.
5. The latest WeiDU readily available for Mac is v148 [2].
6. For distribution of OGG audio files, you need a little CLI tool called sox and a proper shell script.
7. Speaking of shell scripts, WeiDU requires Mac OS X (if you wanna post system requirements).
8. Some installation instructions would be handy [3].
9. Last but not least, use VIEW instead of notepad to display a ReadMe at exit.

[1] If you're using regexps, put big fat warnings everywhere not to use Mod Organizer (that's a little GUI app that calls WeiDU with the proper arguments and replaces any \ with / (in any TP2 in the BG 2 folder!), which is BAD for regexps).

[2] Yet, compiling the newest version on your own is not difficult. I've got one handy (v154), so, if anybody wants to distribute it with his mod, give me a call and I'll mail it over...

[3] Well, 3 steps:
- Copy the mod folder and TP2 into the BG 2 folder.
- Start Mod Organizer (GUI) or WeiDU itself (CLI).
- Follow WeiDU's instructions on screen.

Mod Organizer is quite easy to handle, but not the best bet, given it's problems with regexps. The safe way would be to start WeiDU via a Terminal Window, but we are Mac users, remember, and easily intimidated by a CLI . Now, if someone could whip up a doubleclickable shell script doing all the typing, that would be nifty... (doubleclicking an aptly named weidu.app doesn't work, since it starts out with the user's 'home' as working dir ).

Armin


What makes a good man go neutral? Lust for gold? Power? Or were you just born with a heart full of neutrality?


#5 Idobek

Idobek

    Dust Bunny

  • Modders
  • 1001 posts
  • Gender:Male
  • Location:England

Posted 12 May 2004 - 04:17 PM

The LinkMaster provided me with "this" regarding TISPack.
<SimDing0> Did you know G3 has secret forum rules?
<CamDawg> Yep. They're generally of the nature 'don't annoy Idobek.'

#6 jcompton

jcompton

    Lord Bigenvy

  • Members
  • 626 posts

Posted 12 May 2004 - 07:30 PM

Oh, yay for the linkmaster, I couldn't find it. I've put it on the PPG TISpack site as well.
"[I]t's a testament to the determined RPG fraternity that a number of Baldur's Gate II mods have been successfully produced. The best can be found at pocketplane.net." PC Gamer UK

#7 jcompton

jcompton

    Lord Bigenvy

  • Members
  • 626 posts

Posted 14 May 2004 - 08:46 AM

TISpack's author, Per Olofsson, is now compiling Mac binaries with the new official distros, V0.91 has both PC and Mac OS X executables. Click here.
"[I]t's a testament to the determined RPG fraternity that a number of Baldur's Gate II mods have been successfully produced. The best can be found at pocketplane.net." PC Gamer UK

#8 Caedwyr

Caedwyr
  • Modders
  • 1286 posts
  • Gender:Male

Posted 04 July 2004 - 12:28 PM

I'm curious, does the Mac version treat .bcs files that have been compiled in Windows the same as on a Win9X system or should I distribute the .baf and compile it during the installation?

#9 Idobek

Idobek

    Dust Bunny

  • Modders
  • 1001 posts
  • Gender:Male
  • Location:England

Posted 04 July 2004 - 01:06 PM

The operating system makes no difference in the compilation of bcs files.
<SimDing0> Did you know G3 has secret forum rules?
<CamDawg> Yep. They're generally of the nature 'don't annoy Idobek.'

#10 Caedwyr

Caedwyr
  • Modders
  • 1286 posts
  • Gender:Male

Posted 04 July 2004 - 02:01 PM

Ok, then to further the question. Is it better practice for mods in general to use Weidu to compile the .baf file on the user's computer or is it better to package a pre-compiled .bcs file?

#11 Idobek

Idobek

    Dust Bunny

  • Modders
  • 1001 posts
  • Gender:Male
  • Location:England

Posted 04 July 2004 - 02:07 PM

I'd compile during install, it's generally easier because you only have to deal with the one file. ie Just the baf, not the baf and the bcs.

EDIT: Clarifcation

Edited by Idobek, 04 July 2004 - 02:08 PM.

<SimDing0> Did you know G3 has secret forum rules?
<CamDawg> Yep. They're generally of the nature 'don't annoy Idobek.'

#12 Loriel

Loriel
  • Fixpackers
  • 39 posts

Posted 03 January 2005 - 05:17 AM

First of all, thanks to CamDawg for compiling this tutorial and for helping to make all the G3 mods Mac-friendly! All four of us that download and use them are extremely appreciative! :)

Second, I'd like to give a (hopefully) better solution for listing all the .ogg files in the .command script. I'm going to assume that the reasoning behind listing the files in the ogg_files variable is for two reasons: expansion of wildcards doesn't work with sox (as stated in the tutorial) and that you only want to affect the .ogg files used by this particular mod (not all .oggs by any mod). While listing all the oggs will work, there is a much simpler way of doing it that will save on potential install issues from spelling errors.

#!/bin/sh

ogg_files=`ls path/to/audio/folder | grep '.ogg'`

for file in $ogg_files; do
  echo Converting $file...
  path/to/sox path/to/audio/folder/$file override/${file%.ogg}.wav
done

Notice the backquotes used in the ogg_files variable (same key as the tilde). They tell the script to use the output of this unix command. This will simply make a listing of all the files in your mod's audio folder that have .ogg in the filename, thus eliminating the need to manually type each one. For uninstalling the wavs, you will need a slightly modified version:

#!/bin/sh

wav_files=`ls path/to/audio/folder | grep '.ogg' | sed s/.ogg/.wav/g`

for file in $wav_files; do
  if [ -e override/$file ]; then
    echo Removing $file...
    rm -f override/$file
  fi
done

This time, the script took the list from the audio folder and substituted the .wav suffix (instead of .ogg). Then, it checked for the existence of the file in the override folder before deleting each one.

Finally, I have run into a problem with early versions of OSX that makes the script choke. The problem comes from the fact that it runs as if located at the root of the system (which isn't where BG2 is!). To compensate for this problem, you can simply add this snippet to the top of the script:

#!/bin/sh

command_path=${0%/*}
cd "$command_path"

# rest of the script below...

I use this in all my scripts that must affect files relative to the script's location (such as installing the mod/ogg/tiz, etc). It simply assigns the absolute path of this script's location to the $command_path variable, then cd's to it. Makes life easier for the tech support people... :)

#13 the bigg

the bigg

    The Avatar of F/Ts

  • Awaiting Authorisation
  • 2317 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 25 December 2005 - 02:26 PM

Changes with WeiDU v187:

- \ is automatically converted to / (except for regexp) for Mac OS X (hopefully).
- AT_* NOTEPAD this and AT_* EXPLORER this now defaults to AT_* VIEW this.
- .DS_Store is ignored by the COMPILE action (hopefully).
Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#14 the bigg

the bigg

    The Avatar of F/Ts

  • Awaiting Authorisation
  • 2317 posts
  • Gender:Male
  • Location:Modena (Italy)

Posted 13 April 2006 - 05:26 AM

A quick note: to copy wav or tis files to the override, you should probably use COPY_LARGE (which is slightly faster and won't choke on TIZ files that are > 16 Mb), rather than usual COPY.

EDIT: also, for the sake of Linux-porting, you should run the .bat file if WEIDU_OS STRING_COMPARE_CASE ~WIN32~ = 0, since Linux would use the same .sh file and has x86 as WEIDU_ARCH as well.

Edited by the bigg, 13 April 2006 - 05:29 AM.

Italian users: help test the Stivan NPC!

Author or Co-Author: WeiDU - Widescreen - Generalized Biffing - Refinements - TB#Tweaks - IWD2Tweaks - TB#Characters - Traify Tool - Some mods that I won't mention in public
Maintainer: Semi-Multi Clerics - Nalia Mod - Nvidia Fix
Code dumps: Detect custom secondary types - Stutter Investigator

If possible, send diffs, translations and other contributions using Git.

#15 CamDawg

CamDawg

    Just returned from a triumphant carpet-bombing of Eden 7

  • Gibberling Poobah
  • 8732 posts
  • Gender:Not Telling

Posted 13 April 2006 - 05:41 AM

Cheers, edits made.

What makes a good man go neutral? Lust for gold? Power? Or were you just born with a heart full of neutrality?




Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users