G3

Scriptable Spells

A Gibberlings Three Mod
Author:
Eric Kerr (aka Cirerrek)
On the web:
Home page and discussion forum

Version 3
Languages: English
Platforms: Windows, Mac OS X, Linux

Overview

Scriptable Spells fixes several SPCLxxx and SPINxxx spells that had their spell level incorrectly defined. The incorrect level definition would cause the game to crash when the spells were cast using the trigger HaveSpell(). The spells modified by this package are able to be scripted without causing the game to crash.

This functionality is already included in the BG2 Fixpack, and is not needed for the Enhanced Editions of the game.

Compatibility

This mod is designed to work with BG2: Shadows of Amn with or without the expansion pack Throne of Bhaal. At present there are no known incompatibilities.

Bug Reporting

If you should encounter any bugs, please report them to the authors at Cirerrek's AI Scripts forum.

Installation

Windows
Scriptable Spells for Windows is distributed as a self-extracting archive and includes a WeiDU installer. To install, simply double-click the archive and follow the instructions on screen.

Alternatively, the files can be extracted into your game directory using 7zip or WinRAR. When properly extracted, your game directory will contain setup-scriptablespells.exe and the folder scriptablespells. To install, double-click setup-scriptablespells.exe and follow the instructions on screen.

You can run setup-scriptablespells.exe in your game folder to reinstall, uninstall or otherwise change components.

Mac OS X
Scriptable Spells for Mac OS X is distributed as a compressed tarball and includes a WeiDU installer.

First, extract the files from the tarball into your game directory. When properly extracted, your game directory will contain setup-scriptablespells, setup-scriptablespells.command, and the folder scriptablespells. To install, double-click setup-scriptablespells.command and follow the instructions on screen.

You can run setup-scriptablespells.command in your game folder to reinstall, uninstall or otherwise change components.

Linux
Scriptable Spells for Linux is distributed as a compressed tarball and does not include a WeiDU installer.

Extract the contents of the mod to the folder of the game you wish to modify.

Download the latest version of WeiDU for Linux from WeiDU.org and copy WeiDU and WeInstall to /usr/bin. Following that, open a terminal, cd to your game installation directory, run tolower and answer Y to both queries. You can avoid running the second option (linux.ini) if you've already ran it once in the same directory. To save time, the archive is already tolowered, so there's no need to run the first option (lowercasing file names) either if you've extracted only this mod since the last time you lowercased file names. If you're unsure, running tolower and choosing both options is the safe bet.

To install, run WeInstall scriptablespells in your game folder. Then run wine BGMain.exe and start playing.

Note for Complete Uninstallation
In addition to the methods above for removing individual components, you can completely uninstall the mod using setup-scriptablespells --uninstall at the command line to remove all components without wading through prompts. .

Contents

This functionality is already included in the BG2 Fixpack, and is not needed for the Enhanced Editions of the game.

Somewhere along the way it was discovered that many of the kit class spells, such as Boon of Lathander and Helm Seeking Sword, would cause Baldur's Gate II to crash when scripted with the trigger 0x4031 HaveSpell(I:Spell Spell). This latter also proved true with several of the spells added by the expansion Throne of Bhaal. A work around for casting the spells was developed by one or more of the talented scripters, so scripting life continued unabated.

I am not 100% certain, but I believe it was Dave Gaider and Mark ?, employees of Bioware, who discovered how to fix this problem. The problem was that the level of the spells was incorrectly defined in their .spl files. Instead of being set to 1, they were set to the equivalent values of their mage or cleric counterpart spells. In short, probably a copy/paste error.

At some point it was, I believe, Vulgar Zildrah who compiled the fixed .spl files into a single package, Repaired_Innate_BG2_Spell_Files. Then sometime later, I came along and fixed some of the TOB spells and compiled them into another package, More_Modified_Innate_ToB_Spell_Files.

Scriptable Spells combines the two packs into one and uses WeiDU to install and modify the level of the spells.

Spell Code Spell Name Spell.IDS Reference
SPCL232 Inquisitor True Sight INQUIS_TRUE_SIGHT
SPCL412 Set Trap (Thief) SET_SNARE_TRAP
SPCL414 Set Trap (Bounty Hunter) SET_SPECIAL_SNARE_TRAP
SPCL621 Summon Animal Spirit TOTEMICDRUID_SUMMON_ANIMAL_SPIRIT
SPCL721 Talos Storm Shield TALOS_STORM_SHIELD
SPCL722 Talos Lightning Bolt TALOS_LIGHTNING_BOLT
SPCL731 Helm Seeking Sword HELM_SEEING_SWORD
SPCL732 Helm True Sight HELM_TRUE_SIGHT
SPCL741 Boon of Lathander LATHANDER_BOON
SPCL742 Lathander Hold Undead LATHANDER_HOLDUNDEAD
SPCL910 Set Spike Trap ROGUE_SET_SPIKE_TRAP *TOB
SPCL911 Set Exploding Trap ROGUE_SET_EXPLODING TRAP *TOB
SPCL912 Set Time Trap ROGUE_SET_TIME_TRAP *TOB
SPCL923 Paladin Summon Deva PALADIN_SUMMON_DEVA *TOB
SPIN683 Web Tangle FIGURINE_SPIDER_WEB
SPIN696 Moon Dog Sight MOONDOG_SIGHT
SPIN697 Moon Dog Mirror Image MOONDOG_MIRROR_IMAGE
SPIN698 Moon Dog Improved Invisibility MOONDOG_IMPROVED_INVISIBILITY
SPIN891 Moon Dog Howl MOONDOG_HOWL

Please note that the Spell Codes are correct for the individual spells, but the Spell Names may or not be correct and should be considered my interpretation of what the name of the spell should be. Many of the Spell.IDS References listed in the table above are CUSTOM, meaning I or others have manually altered the Spell.IDS file to change the name of existing spells or to add names of spells that did not have Spell.IDS references as shipped with the game. When attempting to script the spells, you should reference you own Spell.IDS file to determine the correct method to script the spells.

These spells will now work properly with the triggers, 0x4031 HaveSpell(I:Spell Spell) and 0x4031 HaveSpellRES(S:Spell*).

Contact Information

Eric Kerr (aka Cirerrek) maintains Scriptable Spells. You can visit The Gibberlings Three for information on this and any other mods on which we may be working.

Thanks and Acknowledgements

Black Isle Studios - For producing such an excellent RPG
Bioware - For the Infinity Engine and making such an outstanding RPG
Sarkyn (Greg Hodgson) - gSeries and gMinion
Xyx (Jochem van't Hull) - General Insight and Helpfulness
GBlucher (Gebhard Blucher) - GB-Scripts
Rich Martel - uScript
TeamBG - Editors, Tutorials, Forums
BWScripts - Defunct but not forgotten
BGScripts - Where player AI scripting really came to life
Jon Hauglid - Near Infinity and eSeries Debugging
SimDing0 - A little of this, a little of that, and all very helpful
Max (aka Potencius) - a font of information about everything Infinity Engine
Ivann Alvarado - XpertAi (IWD)
Grog - Smart Scripts
Jessica Kerr - seriously reducing my risk of developing carpal tunnel syndrome
Sir Alexander - French translation
King Diamond - BP Detectable Spells
CamDawg - hosting, installation package, G3'ifying documentation

Tools Used in Creation

Credits and Copyright Information

This mod may not be sold, published, compiled or redistributed in any form without the consent of its author.

Version History

Version 3 - September 3, 2018

  • Added Linux version
  • Streamlined code

Version 2 - April 25, 2008

  • WeiDU update to v206, Linux distribution, README/VERSION, cosmetic readme fixes

Version 1.5

  • Removed setup.bat
  • Updated to WeiDU v213

Version 1.4

  • Added OS X installer
  • Moved to The Gibberlings Three

Version 1.3

  • Some minor WeiDU coding changes
  • WeiDU v185

Version 1.2

  • Instead of copying the spell files over, it now uses WeiDU to modify the existing spells - Thanks to Idobek
  • WeiDU v140

Version 1.1

  • Added Cerebus specific innates, MOONDOG_HOWL, MOONDOG_IMPROVED_INVISIBILITY, MOONDOG_SIGHT, and MOONDOG_MIRROR_IMAGE - Thanks Horred the Plague
  • WeiDU v115

Version 1.0

  • Combination of the two spell packs, Repaired_Innate_BG2_Spell_Files and More_Modified_Innate_ToB_Spell_Files into one pack to be distrubted as a WeiDU installation package.