Tuesday, January 31, 2012

Even More Adventures Converting Windows RPG Games to Mac OS X

In my blog post More Adventures Converting Windows RPG Games to Mac OS X I described the steps I went through to get Baldur's Gate, Baldur's Gate II, Icewind Dale, and Icewind Dale II to work using Wineskin by doh 123. Wineskin allows you to create a mini-Windows environment wrapped in a Mac OS X compatible .app. Windows software can be installed and run from this mini-Windows environment. The technology is effective but isn't perfect, in part because Windows isn't really installed. And the creation of an application Wineskin can be more art than science. While my games worked because I installed from discs I still needed the discs to play. I could have hunted on the web for cracks but I prefer not to do that. Instead I bought the Dungeons and Dragons Anthology Master Collection from GamersGate.com which for only $20 includes all of the four games I had already converted as well as Temple of Elemental Evil and Planescape: Torment, neither of which I owned. This post will explain what I did to get all 6 of these games working in Wineskins. For BG, BG2, IWD, and IWD2 I used freely available Wineskins to start with. For ToEE and PS:T I was unable to find free Wineskins so I created my own from scratch using the free program Wineskin Winery which is available at the Wineskin site.

First a note about purchasing games from GamersGate. While both Mac and Windows games are available at GamersGate, if you buy Windows games then when you download it assumes you are using Windows and requires you run an exe to control the download. Fortunately I have Windows XP installed in a Parallels virtual machine and so I was able to run the exe from there. The download was roughly 9 GB (give or take) and so it took a while. In the end I had a DnD_Anthology folder with 12 cab files and a single .msi installer.


Baldur's Gate + Tales of the Sword Coast expansion

Wineskin.app initial menu
Paul the Tall's site has a Baldur's Gate the Original Saga Wineskin wrapper that I downloaded to start with. This wineskin uses the Crossover Games 10 engine, which works well for many older games. To install BG into the wrapper I did the following:

  1. Right click on Baldur's Gate.app and "Show Package Contents"
  2. Double-click Wineskin.app to launch it.
  3. Click the Install Windows Software button.
  4. Navigate to the DnD_Anthology folder and select the Classic.msi installer.
  5. The installer begins and allows the selection of which of the 6 applications to install. I selected Baldur's Gate and deselected the others and the install began.
  6. When the install completes you are prompted by Wineskin to choose the exe that should execute when Baldur's Gate.app is launched. I chose Baldur.exe. (This setting can be changed at anytime by going to Advanced > Configuration in Wineskin.app.)
  7. To allow multi-player games to be initiated (a benefit in BG because it allows you to create more than just one party member) I went to the Advanced > Tools screen in Wineskin.app and selected the utility Winetricks.
  8. Advanced > Tools dialog
  9. Click on Winetricks to launch the Winetricks utility. This utility is often used to install missing missing dll's and other Windows resources that are required by the application.
  10. On the Winetricks dialog check the Custom checkbox halfway down the dialog box and type directplay in the box to the right of "winetricks" and then click the Run button.
  11. Wineskin.app winetricks dialog
  12. Winetricks will then download and install directplay. When it completes you can click on the Close button to return to the Wineskin > Advanced dialog. Then click the Done button to return to the Wineskin.app initial menu.
  13. There can be a white screen delay when launching the game. To prevent this go into Wineskin.app's Set Screen Options and selecting Override and Full Screen and then click Done.
  14. On the Wineskin.app initial menu click Quit.
That's it. Afterwards launching Baldur's Gate.app will start Baldur's Gate. You can copy save game files and character files from any other BG installation you have by just copying them into the appropriate folders in the Baldur's Gate.app application. If you want to try installing mods then you should use the Install Windows Software option in Wineskin.app. I strongly recommend making a backup of your Baldur's Gate.app before playing around with it though or you may find yourself having to install it all over again.

The only problem I have had so far is that quitting the game sometimes causes the application to lock up. In that case just cmd-q to exit the Baldur's Gate.app. I have not tested playing multi-player on a LAN.


Baldur's Gate II + Throne of Bhaal expansion

I used Paul the Talls's Baldur's Gate 2 Complete Wineskin wrapper to begin with. For the most part the steps are identical to the ones for installing BG.

  1. Right click on Baldur's Gate 2.app and "Show Package Contents"
  2. Double-click Wineskin.app to launch it.
  3. Click the Install Windows Software button.
  4. Navigate to the DnD_Anthology folder and select the Classic.msi installer.
  5. Select BG2 and deselect the other applications.
  6. When the install completes choose balder.exe when prompted by Wineskin.app.
  7. Use winetricks to install directplay. (steps 7-10 above)
  8. Use Set Screen Options and select Override and Full Screen to prevent the white screen delay when launching the game.
  9. On the Wineskin.app initial menu click Quit.
For some reason every time I launched the game it would say that it was the first time and force me into the BGConfig program. So to get around this I changed the Windows EXE specified in Wineskin.app > Advanced > Configuration from  /Program Files/Atari/DnDMC/Baldur's Gate II/baldur.exe to /Program Files/Atari/DnDMC/Baldur's Gate II/BGMain.exe

Quitting and/or logging out of a game can cause it to lock up the application. If that happens just cmd-q to exit Baldur's Gate 2.app. I have not tested playing multi-player on a LAN.


Icewind Dale + Heart of Winter expansion + Trials of the Luremaster

I used Paul the Tall's Icewind Dale Complete Wineskin wrapper to begin with. The steps are similar to those for Baldur's Gate II above.
  1. Right click on Icewind Dale.app and "Show Package Contents"
  2. Double-click Wineskin.app to launch it.
  3. Click the Install Windows Software button.
  4. Navigate to the DnD_Anthology folder and select the Classic.msi installer.
  5. Select Icewind Dale and Trials of the Luremaster and deselect the other applications.
  6. When the install completes choose Config.exe when prompted by Wineskin.app.
  7. Use winetricks to install directplay.
  8. Use Set Screen Options and select Override and Full Screen to prevent the white screen delay when launching the game.
  9. On the Wineskin.app initial menu click Quit.
  10. Launch Icewind Dale.app and set the configuration as you wish.
  11. Right click on Icewind Dale.app and "Show Package Contents"
  12. Double-click Wineskin.app to launch it.
  13. Click the Advanced button.
  14. In the Windows EXE box change the program to IDMain.exe and click Done.
  15. Wineskin.app Advanced dialog
  16. On the Wineskin.app initial menu click Quit.
Quitting a game can cause it to lock up the application. If that happens just cmd-q to exit Icewind Dale.app. I have not tested playing multi-player on a LAN.


Icewind Dale II

I used Paul the Tall's Icewind Dale 2 Wineskin wrapper to begin with.  The steps are essentially the same as the steps for Icewind Dale.
  1. Right click on Icewind Dale 2.app and "Show Package Contents"
  2. Double-click Wineskin.app to launch it.
  3. Click the Install Windows Software button.
  4. Navigate to the DnD_Anthology folder and select the Classic.msi installer.
  5. Select Icewind Dale 2 and deselect the other applications.
  6. When the install completes choose Config.exe when prompted by Wineskin.app.
  7. Use winetricks to install directplay.
  8. Use Set Screen Options and select Override and Full Screen to prevent the white screen delay when launching the game.
  9. On the Wineskin.app initial menu click Quit.
  10. Launch Icewind Dale 2.app and set the configuration as you wish.
  11. Right click on Icewind Dale 2.app and "Show Package Contents"
  12. Double-click Wineskin.app to launch it.
  13. Click the Advanced button.
  14. In the Windows EXE box change the program to IWD2.exe and click Done.
Quitting a game can cause it to lock up the application. If that happens just cmd-q to exit Icewind Dale 2.app. I have not tested playing multi-player on a LAN.

I have noticed some cursor flickering which can be annoying. I'm not sure how to resolve that.


Temple of Elemental Evil

For ToEE I could not find an existing free Wineskin wrapper to use, so I created my own. To do so I used the following free tools:
Within Wineskin Winery you specify an Engine and wrapper version to use and then create a new blank wrapper. Engines and wrappers are downloaded for you within the utility. Once you start Wineskin Winery, to get the latest Wrapper version just click on the Update button. Following that click on the + button to download an Engine. For ToEE I used the WS8WineCX10.1.0 Engine. I tried a few others first and they did not display the opening screens correctly.

Wineskin Winery utility by doh123
When you create a new wrapper you will be prompted to allow X11 to communicate with your system, to which you should click Accept. You will also get a dialog asking you if you want to install Gecko. Gecko isn't needed for most games, so do not install it. When prompted to name your wrapper you should use the name you want the .app to be. In this case I chose Temple of Elemental Evil.

Once you have your Wineskin wrapper created you can quit Wineskin Winery.

Once you have your wrapper the steps are very few. Use Wineskin.app's Installed Windows Software to install ToEE from the Classic.msi installer; for the Windows EXE select ToEE.exe. You do not have to change the Screen Options or install directplay for ToEE.

To create the icon for the application I just Googled for a good image and then dragged it onto the Img2icns window and saved the results as icns. You can then browse in Finder to that created icon file and do Get Info on it. In the Get Info dialog click on the icon in the upper left and type command-c to copy it. Then do Get Info on your Temple of Elemental Evil.app and click on the Wineskin icon in the upper left corner and type command-v to replace that icon with the one you created. That's it.

Those familiar with ToEE know that there is a modding group called the Circle of 8 who released corrections and enhancements to ToEE. While installing those was tempting I could not find a way to do so from within Wineskin.app because they rely on .Net. It might be doable by installing the missing components with winetricks and then using Install Windows Software to install the mods, but I did not figure out the necessary steps to get the custom content installed.


Planescape: Torment

I saved the best for last. Getting PS:T working was in fact a torment. Here is the process I followed, based in part on the installation instructions at this blog.

First I used Wineskin Winery to create a blank wrapper using Wineskin 2.5 and Engine WS8WineCX10.1.0 and named it PlanescapeTorment.app

Second I used the Wineskin.app Install Windows Software option to install PS:T from the Classic.msi installer, and then setting the Windows EXE to Torment.exe

Then in Wineskin.app Screen Options I turned on Override and selected Fullscreen.

Then I used Img2icns.app to create a nice icon from the icon here and pasted it onto the PlanescapeTorment.app icon in the Get Info dialog.

At this point I tested the game and it worked, but the resolution was so low that everything was huge.  So I continued on installing the two mods suggested on the blog to address that. Before you do I strongly recommend you make a copy of your PlanescapeTorment.app. It is possible that any further mods will result in messing up your .app file and you would then have to start over.

I downloaded and installed The Bigg's Widescreen mod:
  1. Downloaded widescreen-v3.05.exe from <http://forums.gibberlings3.net/index.php?s=ab759621f20e6e33366f362095575c1e&app=downloads&showfile=896>
  2. Use Wineskin.app Install Windows Software to run widescreen-v3.05.exe. When it prompts for a directory type in the path to the Planescape Torment folder (for me it was C:\Program Files\Atari\DnDMC\Planescape Torment)
  3. After a while of spinning press command Q to quit the never ending Wineskin is currently busy dialog.
  4. Use Wineskin.app Install Windows Software to run setup-widescreen.exe and it should open up a text window and give instructions so you can install the component, choose your screen size (X 1024, Y 768 worked for me), and update your save files. Once it starts updating it will run for a few minutes and then say that it was successful and press enter to exit.
  5. Wineskin will tell you to select a new executable and if for some reason it does not allow Torment.exe then just accept it and then go into the Advanced configuration and change the Windows EXE back to Torment.exe
Then I downloaded and installed Ghostdog's UI mod which is recommended if you installed the widescreen mod:
  1. Downloaded Ghostdog's UI mod from <http://www.shsforums.net/files/file/683-ghostdogs-pst-ui-mod-v22/>
  2. To decompress it you'll need an app that can decompress 7zip files. I use Keka.
  3. Decompress Ghostdogs_PST_UI_mod_v2.2 and copy the contents to the same directory that Torment.exe is in.
  4. Use Wineskin.app Install Windows Software to run Setup-GhostDog's-PST-UI.exe
  5. Install the component and pick the percentage and language you want (use the image at <http://www.thunderpeel2001.com/webpics/font-sizes.jpg> to determine what size is most readable)
  6. Click OK when Wineskin asks you to select the executable
Following this I started up PS:T and everything was working.  At this point I suggest you either stop or you make a backup of your PlanescapeTorment.app file because all further attempts I made to install custom content failed and broke the game. I tried to install the Ultimate PST Fixpack, Unfinished Business, and the Qwinn's Tweak Packs. Those mods are supposed to be installed in that order. However I found that after installing the Ultimate PST Fixpack any attempt to start the game would just crash. So my advice is to just stop after installing the widescreen and Ghostdog UI mods.


Dungeon Master and Chaos Strikes Back

I whipped out functional wrappers for Dungeon Master and Chaos Strikes Back in no time at all, but suffered a set back when trying to create a wrapper for Dungeon Master II. Since those games do not have installers I just created new blank wrappers and then dragged their game folders into the Program Files folder in the wrapper and set the Windows EXE appropriately.

I think that Wineskin opens up a whole new world of gaming for Mac users, as well as helping us play games like Baldur's Gate whose Mac client will not work on OS X 10.7 or later.

Sunday, January 29, 2012

Making Over the Neverwinter Nights 2 Official Campaign


As a hobbyist most of my computer programming efforts over the years have been focused on singular tasks designed to solve specific problems. Every once in a while I have attempted large efforts, but most of those failed to come to fruition for various reasons, although I do not consider the hours spent on them wasted. The only constant through the years is that I do not charge for my work. I have no problem with those who charge shareware fees, it is just that I started doing this when the only term for software was "software" and I see no reason for attaching other terms to my efforts. Most of the tools I have used have also been freely distributed and I do not spend a significant amount on books or equipment so I have no need to recoup costs.

Apple's At Ease launcher for Mac OS 7
No Worries, my 1994 IIGS launcher inspired by "At Ease"
Most of my projects have been attempts to improve on a product that I felt to be lacking in some way. My downloads page is full of such projects. My Assorted Finder icons and the No Worries Hypercard GS stack are early cases in point; IIGS products inspired by products that Apple developed only for the Macintosh as they abandoned the IIGS in the late 80's. (Images provided courtesy of the outstanding freeware IIGS emulator Sweet16 by F.E. Systems and Eric Shepherd.)

Apple's "Copland" icons didn't materialize as planned

GSCopland icons I created for the IIGS inspired by magazine pictures of the Mac System 7 "Copland" desktop, which was then scrapped by Apple in 1996. I distributed mine via GEnie on July 12, 1995. Mine are yellow because I felt it looked better and more cheerful than periwinkle blue. Apple later incorporated the slanted Copland look in Mac OS 8 and 9 and it was then adopted in a reversed form by Microsoft for Windows XP. See Know Your Icons for more on the history of computer icons.
HyperBattleship! for OS9 was my correction for the Apple HyperBattleship! stack that broke with Mac OS 9 and Apple never bothered to correct since they were abandoning Apple Events and Hypercard. BalloonMaker GS and MacBallonMaker added Help Balloons in Hypercard stacks, a feature Apple added to the Mac OS but left out of Hypercard and GS/OS. HC Extra Menu Installer provided a customizable Extras menu in Hypercard, just as had been provided in the GS/OS Finder. KeyNavigator added the ability to navigate using the keyboard in Hypercard GS stacks. GSOS Splashscreen Editor allowed custom colors to be applied to the GS/OS Splashscreen. FixPodCal is an Applescript and Perl script that can be used to correct the inability of the iPod calendar to display event locations. Enhanced Clipboard to Note enhanced the functionality of Apple's Clipboard to Note Applescript. And EncryptSelectionTEA can be used in conjunction with a free utility called FileMarkMaker to securely store and retrieve encrypted text on an iOS device (like a passwords list).

When I started modding for games like Baldur's Gate and Icewind Dale II I also tended to develop things that I thought were missing in the games and would add enjoyment for players. BG1, for example, lacked the ammunition containers that some other Infinity Engine games had, so I developed a set of containers using resources from those games and made them available in BG1 Tutu via WeiDU - a free installer modding utility for Infinity Engine games. My containers were later adopted (without my knowledge) into a collection of fixes for BG and so were likely widely distributed. I developed similar containers and many other items for IWD2 as well. All of these are available on my downloads page.

When I began modding for NWN2 I first envisioned creating a large campaign to rival the Official Campaign. That campaign is the Gem of Power campaign, which I am still developing several years later. In the meantime though I developed the Harvest of Chaos: King's Festival + Queen's Harvest campaign based on the D&D campaign of the same name by Carl Sargent. The King's Festival chapter of my campaign was first released in May 2009 and I incorporated several of the features of the NWN2 Storm of Zehir (SoZ) expansion. Most importantly the death system, the party creation system, and the crafting system. It took a signifiant amount of effort to determine how those systems worked and to address weaknesses and bugs so that I could incorporate them into King's Festival. Shortly afterward there was a post on the now-defunct Bioware boards in which someone suggested that it would be great if the NWN2 OC could use the same death system and party creation system as SoZ. I replied without thinking too hard about it that I thought it would be possible since I had already developed the necessary scripts for King's Festival. From that moment on I was committed to making my statement a reality. And I was determined to make it happen quickly.  The result was that in October 2009 I released the NWN2 OC Makeover SoZ Edition. The Vault web page discusses the many features of the Makeover so it will suffice to simply say here that playing the OC with the Makeover installed is a completely different experience than playing without. As a result the OC Makeover to my surprise became one of the more popular mods for NWN2.  With the game's subsequent release on Steam and other online sites hopefully the number of Makeover users will increase further.


This graphic by PJ156 uploaded to the NWN2 Bioware Social boards shows the download counts in October for NWN2 mods in the Vault (note: not all mods are represented).
The most frequent request I received after release of the OC Makeover was for a similar makeover for the Mask of the Betrayer expansion. It took a year to complete that work and the MotB Makeover SoZ Edition was released in January 2011. A larger effort than the OC Makeover the MotB Makeover contains new areas and alters certain plot points that players complained about in addition to adding the features of the OC Makeover.

Since releasing the Makeovers I have continued to enhance the crafting system I incorporated into them that is based on the SoZ Crafting system. My version - SoZ Crafting Plus - addresses many of the bugs in the SoZ system and enhances in further by allowing recipes to be easily created without having to modify or merge 2DA files.

Links to all of my NWN2 mods are on this blog page.



More Adventures Converting Windows RPG Games to Mac OS X

In a recent post I detailed the steps I took to convert the Windows version of Neverwinter Nights to run natively on Mac OS X 10.7 "Lion" using Wineskin by doh123. Wineskin is a Mac OS oriented implementation of Wine, which is an open-source project that allows Windows apps to run on Linux and other OS's by converting the Windows API calls into native calls. This is basically how EA is releasing games like Sims 3 for both Windows and Macintosh; by developing a Windows app and then wrapping the application for Mac OS. From my experiences so far with Wine, which Wineskin relies upon to create wrappers, I would say that this is not a perfected technology, but it is often good enough. Wineskin wrapped applications, "ports", usually work on Mac OS X 10.5 "Leopard" and 10.6 "Snow Leopard"as well as 10.7 "Lion", so they are compatible with almost any Intel Mac. And since Wine and Wineskin are free, if you already own the Windows versions of the games, the only expense is the time to get the working port. This time can vary from minutes to days though and much of the trouble shooting is closer to art than science. My personal opinion is that any technology that allows running software that would otherwise be abandoned is a great thing and worthy of support.

Fortunately there are sites such as the WineApp Database at WineHQ.org, the Porting Team site, and the Paul the Tall site where Wineskin wrappers can be found for many Windows games. And even if you purchased the Mac version of a game and do not own the Windows version, often installable Windows versions can be purchased at a fraction of their original price at either GamersGate.com or GOG.com. Sometimes the Windows versions work better than the native Mac versions anyway.



The below instructions mostly involve installing from game discs and therefore included patching and in the end the discs were still required to play the games. I've since purchased the DnD Anthology Master Collection which includes digital versions of the games listed below as well as Temple of Elemental Evil and Planescape: Torment and have managed to get all of them ported to the Mac using Wineskin. For more on this see this blog posting.



So far I have been able to get "working" Mac OS X compatible versions of Baldur's Gate (BG1 + ToSC), Baldur's Gate II (BG2 + ToB), Icewind Dale (IWD1 + HoW + ToL), Icewind Dale II, and Neverwinter Nights (NWN1 + HotU + SoU). The quotes around "working" means that the games may not include all functionality, but are playable are far as I can tell. In each case I had to do a little more than simply downloading a wrapper and installing, but with some troubleshooting and help from doh123 and Paul the Tall I have working versions.

Baldur's Gate + Tales of the Sword Coast

Since I have the Windows game CD's for Baldur's Gate and the Tales of the Sword Coast expansion as well as the game patches, I didn't need to buy the game from GOG. I downloaded both the BG_ToSC wrapper by HiPhish available at PortingTeam.com and the BG The Original Saga wrapper by PaulTheTall. In the end I used PaulTheTall's, but I think either is usable. I have not yet tried to install BG1 Tutu, the project that allows you to play BG1 using the BG2 engine, even though I created Tutu compatible ammunition bags and a scimitar years ago.

To get a functional port I first used the Install Windows Software option in Wineskin.app (get to it by right-clicking on the downloaded BG wrapper and selecting "Show Package Contents") to do a complete install from CD of BG1 and ToSC. I also applied the patches the same way. I then used the Set Screen options of Wineskin.app to turn on Override and Full Screen (this is often needed for old games). I also confirmed that the Windows EXE path set in the Wineskin.app > Advanced > Configuration tab was the path to Baldur.exe. This was sufficient to start a single-player game, however I was unable to start a multi-player game. After some online searching and with suggestions from doh123 and PaulTheTall I determined that the solution to getting multi-player to work was to install DirectPlay. The installation of DirectPlay is done by going to the Wineskin.app > Advanced > Tools > Winetricks and then checking the custom checkbox and typing directplay into the winetricks (arguments) box and then clicking the Run button. After that install completed successfully I was able to start multi-player games in BG.  Because I installed from CD I do have to have the BG Disc 1 inserted in order to start a game. I suppose that would be one reason to purchase the GOG version instead of installing from CD.

Baldur's Gate II + Throne of Bhaal

Since I have the BG2 and ToB Windows discs, I only needed a wrapper. I downloaded HiPhish's Baldur's Gate II (+ Throne of Bhaal) wrapper available at PortingTeam.com.  The hardest part of this was the downloading process at PortingTeam.com, which I found to be less than usable. Basically the trick is that when you type in the captcha you have to press the enter/return key in order to get the real download screen. All of the bright and shiny download buttons on the screen with the captcha just download some Windows ad-ware.

With the wrapper downloaded the installation steps to getting it working were basically the same as for BG+ToSC above. Installed the game and patches with the Wineskin.app Installs Windows Software option; set the Screen Options in Wineskin.app to Full Screen; used winetricks to install directplay; and set the Windows EXE path to balder.exe. Because I installed from CD I have to have the ToB disc in to start a game. I suspect that if I purchased BG2 Complete from GOG I could put the CD away forever.

Icewind Dale + Heart of Winter + Trials of the Luremaster

This was the only time that having the discs did not help me get a working version. I used PaulTheTall's Icewind Dale Complete wrapper and tried to install from disc but afterward could not get it to run. So I purchased for only $5 the Icewind Dale Complete version from GamersGate and after the download was able to get it successfully installed in the wrapper. I again set the Screen Options in Wineskin.app to Full Screen; used winetricks to install directplay; and set the Windows EXE path to IDMain.exe. I only played briefly to test it out, but it seems to work well.

Icewind Dale II

For Icewind Dale II I used PaulTheTall's wrapper for Icewind Dale II and installed from my Icewind Dale II Collector's Edition discs and installed the IWD2 patch. I again set the Screen Options in Wineskin.app to Full Screen; used winetricks to install directplay; and set the Windows EXE path to IWD2.exe. I only played briefly to test it out, but it seems to work well.

Summary

With this process working reliably I will probably buy and convert some other games that don't work on Lion natively as well. (In fact, I am now downloading from GamersGame the Dungeons & Dragons Anthology: The Master Collection which for only $20 includes BG1 and BG2 + expansions, IWD and IWD2 + expansions, Planescape Torment, and the Temple of Elemental Evil. Hopefully this will allow me to put my CDs away and with the help of Wineskin play PT and ToEE on my Mac.)

My next post on porting will discuss how I used my newfound knowledge of Wineskin to convert Windows apps at work that either had no Lion version or no Mac version.

Sunday, January 22, 2012

Converting NWN2 modules to campaigns

With Neverwinter Nights the standard way of developing an adventure with the toolset was to develop a "module". A module is a collection of areas, scripts, conversations, blueprints for items and creatures, and effects. The early modders of NWN developed many modules and when NWN2 came along the early NWN2 modders did the same, possibly because many of them had learned first on NWN.

NWN2 however also has what are called "campaigns". A campaign is a collection of modules and shared resources which can include scripts, blueprints, and conversations. Just as a module can have properties, a campaign can have properties, and some of those properties are required in order to implement certain game features. For example, in order to allow the creation of a party, as is done in the Storm of Zehir expansion, you have to use a campaign because the campaign property PartyCreation must be set to True and PartyCreationSize must be specified.

Of course many of the modules produced for NWN2 will never be converted to campaigns by their authors because those authors have moved on to other games. But for those who want to use party creation to play those modules there is a solution, and that is to convert the module to a campaign. I published the steps for how to convert a module to a campaign in two threads in the Bioware NWN2 forums, in its own thread and in the Toolset How To thread. But considering the fate of the old Bioware forums, I think this is important enough to justify a blog post as well. So here are the instructions:

These instructions may not be perfect, but I have tested them with the module Tomb of Horrors Revisited and I believe they should work for most community authored modules.


Steps for converting a module to a campaign:

These steps require the NWN2 Toolset, and so this cannot be done on the Macintosh.
Sample module Tomb of Horrors Revisited Final

1. Acquire module and unzip if necessary to get the .mod file.
2. Copy the .mod file into ../My Documents/Neverwinter Nights 2/modules
3. Open the toolset by launching NWN2 and pressing the Toolset button.
4. If this is the first time you have used the Toolset then select the menu option View:Options and under the General tab change "Autosave" to False and click OK. This will turn off the autosave function. This is a good idea because relying on the autosave feature can lead to module corruption.
5. Select menu option File:Open and open the module. If the module is opened successfully then the name of the module (in this case ToH Revisitedv2) should be visible in the Toolset title bar.
6. Select menu option Plugins:Campaign Editor to open the Campaign Editor plugin dialog
7. In the right side of the dialog click Add Campaign.... This will create a "New Campaign" at the bottom of the campaign list on the left side of the dialog.
8. In the campaign list click on the "New Campaign". This will display the campaign properties in the right side of the dialog.
9. Under the Appearance tab populate the Description, DisplayName, and Name fields with the name of the campaign. Generally the name of module is acceptable. In this case use "Tomb of Horrors Revisited". (You can also use the descriptions from the Module properties)
10. Click Save Campaign and then in the save dialog click OK.
11. Close the Campaign Plugin
12. Select menu option Plugins:Campaign Editor to open the Campaign Editor plugin dialog. At the bottom of the campaign list you should now see the campaign with the name you entered (in this case Tomb of Horrors Revisited).
13. Click on the campaign you created (in this case Tomb of Horrors Revisited).
14. You may want to change some of the default campaign properties.
- If you want to allow companions to level up and select any class then set AllowUnrestrictedLevelUp to True
- If you have SoZ and want to use the Party Editor in the new campaign then set PartyCreation to True and PartyCreationSize to the number of party members you wish to create (the main PC counts as one).
15. Click on the Add Files button and select the new module
16. In the properties set StartingModule to the name of the module WITHOUT the .mod suffix (in this case ToH Revisitedv2)
17. Click save Campaign and OK.
18. Click "Set Module to Use Selected Campaign" and OK
19. Close the Campaign Plugin
20. Select menu option File:Save
21. Close the Toolset.

If the module has journal entries then they will need to be converted to the campaign journal. This can be done using these steps:

1. Open the toolset by launching NWN2 and pressing the Toolset button.
2. Select menu option File:Open and open the module.
3. With the toolset open, navigate to the ../My Documents/Neverwinter Nights 2/modules
4. In the folder there should be a temp folder. This folder's name will start with "temp_" and will end with the module name (in this case it will be something like temp_ctHEcsKtqkuZYU1x3+Q4MA==_ToH Revisitedv2). Open this temp folder.
5. Move the file module.jrl to the desktop
6. Close the toolset without saving
7. Open the folder ../My Documents/Neverwinter Nights 2/Campaigns
8. Drag the module.jrl file from the desktop into your new campaign's folder (in this case Tomb of Horrors Revisited) replacing the existing file.
9. Open the toolset by launching NWN2 and pressing the Toolset button.
10. Select menu option File:Open and open the module.
11. Select menu option View:Journal->Module. This will display the module journal entries.
12. In the journal toolbar click Collapse All
13. Select all of the journal entries and click the Delete key to delete them (click OK when asked if you are sure).
14. Close the Journal window.
15. Select menu option File:Save
16. Close the Toolset.

If you want to access the Party Editor then download the Deck of Trumps (bb_it_partyeditor.zip) from the Silverwand Sundries, unzip it and and copy the bb_it_partyeditor folder into your new campaign's folder. For instructions on using the Deck of Trumps in game see its read me file.

Saturday, January 21, 2012

Running NWN for Windows on Lion using Wineskin

Thanks to Apple dropping Rosetta from Lion it is no longer possible to run the Mac versions of Neverwinter Nights natively. While NWN plays fine in Parallels, I decided to undertake getting it to run natively.  I little Google searching and I came across Wineskin by doh123. Basically from what I can tell Wineskin is a Mac OS oriented implementation of Wine, which is an open-source project that allows Windows apps to run on Linux and other OS's by converting the Windows API calls into native calls. This is basically how EA is releasing games like Sims 3 for both Windows and Macintosh. They develop for Windows and then wrap the application for Mac OS.

doh123 is kind enough to not only provide Wineskin free of charge but also creates many Wineskin wrappers for specific Windows games, including one for Neverwinter Nights. This allows playing the game, although it does not allow using the Toolset. He has posted about this in the NWN Bioware forum.

I downloaded doh123's NWN Wineskin v4 and followed its installation instructions, copying my NWN folder from my Bootcamp partition into the wrapper. Unfortunately I had a couple of problems. If you want to get this working yourself read until the end of the blog post before doing anything otherwise you will be wasting your time.

The first problem being that when NWN was started the screen would turn white and then seem to freeze. Cmd-Q would quit so I don't think it was really frozen, but it definitely wasn't running either.  A little searching and I again found someone else who was having the same problem and eventually found a suggestion from doh123. The cause is that the intro videos are not compatible and need to be skipped. This is easy enough to do by editing the nwn.ini, and in fact doh123 provided in his wrapper a program called MovieFix that is run by the Wineskin startup script and updates the nwn.ini for you. Unfortunately the program was doing the opposite on my system, actually removing the needed lines from the Display Options section in nwn.ini:
Disable Intro Movies=1
SafeMovie=1

So I edited the nwn.ini to add in the lines and then deleted the MovieFix program from the Resources folder. This solved the white screen problem.

Update: At the end of the first chapter the game hung trying to display the in-game movie. I tried several things to resolve this, but in the end the only solution I found was to rename the movies folder to movies-old so that they cannot be found. No movie, but at least the game continues.

The second problem was that while I had music playing on the initial NWN menu (the one with Toolset), once I clicked Play all sound would cease including music, button presses, sound effects.  I played around with several settings and even tried using another Mac, but no matter what I couldn't get any sound.  I reported this to doh123 and he responded quickly but had no solution to suggest. Again I found by searching that another person was having the same problem. I was unable to solve the problem without doing much more, but I believe I have solved it. So if you try to use doh123's NWN v4 Wineskin wrapper and cannot get the sound to work, you may want to try the following:




Ideally I think that updating the wrapper and the Engine used by the wrapper should have been sufficient, and there are options for doing that built into the Wineskin.app program. Using them still requires installing Wineskin Winery and downloading them, but would have removed the need to copy files between doh123's wrapper and the new wrapper. However, when I attempted to use those options, any attempt to update the Engine would run and run and run. I cancelled it after 15 minutes, so I do not think the update option works very well with doh123's wrapper (at least not on either of my Macs).

From my testing so far Neverwinter Nights is working fine with my new wrapper as long as movies are disabled. If I run into any problems I will update this post.

Saturday, January 14, 2012

Making NPCs dance and sing

I've been posting NWN2 scripts in various places on the web for several years now. Unfortunately as time has passed some of those places have vanished. While I could and probably will post them at the NWN2 Vault site, I think it makes sense to start posting them here as well. Chances are Google isn't going away anytime soon, and even if I abandon this account it will likely live on for some time.

So here is a script that makes NPC's dance and sing. It is a heartbeat script that you put on the NPC. While it is based on an OC script, it is enhanced to allow singing, dancing, and playing instruments (flute, drum, and lute) with one script. I make use of this script in the Harvest of Chaos: King's Festival+Queen's Harvest campaign.