Jump to content

Search the Community

Showing results for tags 'tutorial'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • General Discussion
    • G3 News and Announcements
    • Infinity Engine Modding News
    • General Mod Discussion
    • Theorycrafting
    • Fan Fiction
    • Noobermeet
  • Modding Discussion
    • IESDP Updates and Info
    • Modding How-Tos and Tutorials
    • Modding Q&A
  • Mods and Tools
    • Tools
    • NPC Mods
    • Tweaks and Fixes
    • Item, Kit, and Spell Mods
    • Quest Mods and Other Mods
    • Miscellaneous Released Mods
    • Unreleased Projects


  • NPCs
  • Quests and Others
  • Tweaks & Fixes
  • Items/Kits/Spells
  • Portrait Packs
  • Mini Mods
  • Tools
  • In Progress


  • Fixes
  • Items
  • Kits
  • NPCs
  • Quests
  • Spells
  • Tweaks
  • Other
  • Tools

Product Groups

There are no results to display.

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start




Website URL









Mods Worked On

Found 7 results

  1. EDIT: Turns out the code is incompatible with AUTO_TRA. Until future investigation, you can't use this if you are not wiling to resign from using AUTO_TRA function. EDIT: Guide was updated to reflect recent WeiDU 249 changes. AUTO_TRA is now fully supported. Introduction: Since introduction of HANDLE_CHARSETS, modders have given the ability to support translation for both classic and enhanced editions of the Infinity Engine games. The function itself was doing it's job: convert file encoding from one to another. But it also had annoyances which various modders was able to overcome via custom code. Now, with the introduction of `out_path` parameter, all of the annoyances are gone. This is an attempt to show how to get the best out of HANDLE_CHARSETS. How it was handled before: translators provide .tra files using their own preferred local encoding HANDLE_CHARSETS function convert those files into UTF8 encoding when mod was installed on enhanced game editions How it is handled now: translators provide .tra files using UTF8 encoding when the mod is installed on classic game editions, the temporary copy of translation files are converted into ASCII encoding so the source files are not touched no modification of original UTF8-files when mod is installed on enhanced game editions Using new way will save you from annoyances and allow for new features: modders no longer need to watch-out to not break custom encoding when editing foreign tra files modders can receive translations via forum posts and it can be used instantly, without hustle translators are no longer required to send files just to update one single line translation can be provided by editing files directly via GitHub online interface DOS/Shell console messages can finally have localized characters displayed properly (required Windows 10 1903 and above, for Windows 7/Windows 8.1 you have to use Cmder/ConEmu/other modern terminal with "chcp 65001" command) Requirements: required minimum version of WeiDU is 249 if you are updating old mod, you have to properly convert .tra files to UTF8 using correct codepage for specific language Full code example: https://github.com/InfinityMods/WeiDU-UTF8 Code explanation: BACKUP "weidu_external\backup\WeiDU-UTF8-Example" // move backup folder outside of the main mod data folder Move backup folder outside of the main mod data folder. The %MOD_FOLDER% is read from this value but WeiDU 249 should correct it to the main mod folder name. // do not convert Setup.tra files, those should be UTF8 already ACTION_DEFINE_ARRAY arrayNoConvert BEGIN Setup END ACTION_DEFINE_ARRAY arrayReload BEGIN Mod NPC NPCP NPC25P END Define two arrays for `noconvert_array` and `reload_array` parameters of `HANDLE_CHARSETS` function because those parameters require array. You cannot provide the filenames directly. The .tra file extension is optional. Do not convert Setup.tra files, those should be UTF8 already. LAF HANDLE_CHARSETS INT_VAR from_utf8 = 1 //the source tra files of all languages are UTF8 infer_charset = 1 //set the correct encoding for classic games based on the detected game and associated encoding verbose = 1 //display more debugging info Parameter from_utf8 = 1will tell WeiDU that the source tra files of all languages are UTF8. The infer_charset = 1 will set the correct encoding for classic games based on the detected game and associated encoding. The verbose = 1 will display more debugging info. // define variable for HANDLE_CHARSETS out_path so it can be reused later OUTER_TEXT_SPRINT "HANDLE_CHARSETS_OUT_PATH" EVAL "weidu_external\Lang\%MOD_FOLDER%" Define variable for HANDLE_CHARSETS out_path so it can be reused later and it will keep it in sync. tra_path = "%MOD_FOLDER%\lang" // path to translation files, do not add slash at the end of it Path to translation files, do not add slash at the end of it. out_path = EVAL "%HANDLE_CHARSETS_OUT_PATH%" // location of converted .tra files This is very important. WeiDU documentation says: "Note that if %tra_path and out_path are the same directory, the conversion will naturally happen only once regardless of how many times HANDLE_CHARSETS are invoked, but if the directories are different, the conversion will happen for every invocation (notably, if HANDLE_CHARSETS is invoked among the ALWAYS actions)." So when WeiDU preforming conversion operation, it overwrite original mod files and it can also change their encoding if the mod was installed on the classic editions of the games. So in order to keep original files intact, we need to provide two different path for `out_path` and `tra_path` parameters. Since WeiDU doesn't have concept of 'temporary work directory' we need to create it manually earlier. Also, if you mod uses AUTRO_TRA, you have to use the "%TRA_LOCATION%" path: // for the EE games, the variable will point to the untouched .tra files // for classic games will point to the HANDLE_CHARSETS out_path value where converted files are stored AUTO_TRA "%TRA_LOCATION%\%s" The rest of the mod that code covers changing game string and creating of default NPC with initial dialogues are only to quickly test the results and they are not related to the main goal of this guide. Please refer to WeiDU Documentation or ask here.
  2. LIST LOCATIONS The information should be functionally identical for each of these lists. -Beamdog General Modding Forum: Contains raw board code for ease of quoting and editing. -Gibberlings3: Lacks raw board code. FORENOTES -Mods that add spells to items or to NPCs but which player characters can't learn are purposefully excluded from this list. The same goes for mods that merely change spell functionality instead of making new spells. -Mods that add spells only to kits included in the same mod aren't emphasized, but may be included. -Entries below starting with - add spells directly to the standard arcane or/and divine lists. Entries below starting with ** use alternative spell systems. -Arcane spells that Wizards can learn are assumed also to have scrolls so you can add these spells to your repertoire. -As of this writing, there is a hardcoded limit of only 50 spells per spell level at a time. (That's 50 arcane per spell level and another 50 divine per spell level.) Any spells beyond this limit won't show on the spell select screen and character creation screen, and mods that would install spells beyond this limit refuse to install. -All information regarding new spells I've obtained from reading mod documentation or/and from mod authors/maintainers directly. I've not played enough with most these mods to fairly state from first-hand experience what they add. WHAT ADDS PLAYER CHARACTER-USABLE SPELLS TO THE BG ENGINE? -Normal and Enhanced Editions of Baldur's Gate and Baldur's Gate II, including the Tales of the Sword Coast and Throne of Bhaal expansions. -B_Spells (Spells and Magic) Adds a small number of arcane spells and divine spells to the game, some of which are already in Faiths & Powers. -Chaos Sorcerer Automatically adds these Chaos Sorcerer kit-only arcane spells to the Chaos Sorcerer's list of spells known: Conjure Chaos Elemental, Conjure Greater Chaos Elemental, Chaotic Weave, Nahal's Wildstrike, and Surge Control. -Dark Side of the Sword Coast (DSotSC) Adds many new spells, some arcane and some divine. The mod's new arcane spells are reviewed at that link as of June of 2018. Note that most of these spells in this mod are already in BG2, meaning if you're playing in EET (Enhanced Edition Trilogy), installing these spells is probably a waste of space! -deratiseur's Spell Mod (FRENCH ONLY!) Adds 30 arcane spells learnable via scrolls and 25 spells learnable via the spell learning UI, such as for spontaneous casters. For BG2, BG2EE, and IWDEE. (It may also work on EET, but I've not confirmed it yet.) -deratiseur's Unused Kits Mod The kits Shadowmage (AKA Ombremage) and Warlord have unique spell lists according to the author. May be in French only. -Dimension Gate: Or How TV Bunny Searched Remote Control. Adds about 20 arcane teleportation spells to warp to player-specified preset points. (It's like Morrowind's Mark and Recall spells.) Also adds some quests and lightsabers. -Divine Remix Adds 13 divine spells: Cause Medium Wounds, Cause Blindness or Deafness, Cure Blindness or Deafness, Detect Good, Divine Shell, Faerie Fire, Impregnable Mind, Protection from Good, Protection from Good 10', Resist Acid and Corrosion, Strength of Stone, Conjure Air Elemental, and Energy Drain. -IWDification Adds Icewind Dale arcane spells and divine spells to normal Baldur's Gate II, Throne of Bhaal, and the Enhanced Editions of BG1 and BG2. Also adds other Icewind Dale-specific content listed in the documentation outside the scope of this post. -Made in Heaven Spell Pack (MiH Spell Pack) Adds a few new arcane spells and divine spells. -Faiths and Powers (F&P, FnP) Adds a small number of divine spells from the mod B_Spells. New spells in Faiths & Powers are described here. -Northern Tales of the Sword Coast (NTotSC) (Spells from this mod don't count against the 50 spells per level limit but can't be learned by spontaneous casters like Sorcerers! They can still be added to spellbooks and prepared and cast that way normally!) Adds Fiery Cloud and Skeleton Guard as arcane spells with scrolls in Sorcerous Sundries (Baldur's Gate city). -OlvynSpells (Spells from this mod don't count against the 50 spells per level limit!) Adds many arcane and divine spells for all casting classes, each of which is listed in the post. Many spells like fly or reverse gravity require EEex to function! Noteworthy is that, as of this writing and OlvynSpells 2.2.0, these spells have been converted to use Olvyn's Spell Tool, thereby no longer counting against the 50 spells per spell type (arcane/divine) per spell level! -Out! Brief Candlekeep Adds one level 1 arcane spell, Vanishing Act. -Red Dragon Summoning Spell Adds a single level 9 arcane spell. -Region of Terror (RoT) Adds new spells that, according to the readme, are "mostly kit-specific." (Thus, you can only access these new spells if you're playing a character using this mod's new kits.) These kits also don't work with Baldur's Gate II: Enhanced Edition. However, this page lists all mod-added spells & kits. -Spell Revisions (SR) and Spell Revisions Revised (SRR) Revises all vanilla and some Icewind Dale spells into a cohesive package for Baldur's Gate games. -Saradas Magic & Saradas Magic II (Spells from these mods don't count against the 50 spells per level limit!) Saradas Magic 1 (and seemingly also 2) adds high-level arcane spells, including something for each school. Dragon Disciple Sorcerers also get an exclusive spell. **Shadow Magic (Spells from this mod don't count against the 50 spells per level limit!) Adds many, many new spells (level 1-9 and seemingly arcane) specific to the new Shadow Adept Mage kit and Shadow Disciple Sorcerer kit. -Shards of ice Adds Summon Cow as a learnable, scribable arcane spell in addition to being a Wild Magic effect. (In Vanilla, Summon Cow is normally available only as a Wild Surge effect on the d100 roll of an 88. It's quite possible to play through the entire BG saga and never cast this spell under normal means) -Siege of Dragonspear to Baldur's Gate II: Enhanced Edition Item Upgrade (SoD to BG2EE Item Upgrade) Adds 5 arcane spells. -Spontaneous Casting for Clerics and Druids Adds Magic Fang as a divine spell. -Stone of Askavar Adds these 6 arcane spells. -Sword Coast Stratagems (SCS) Has the option at install time to include Icewind Dale arcane spells and divine spells for player characters. If Spell Revisions is installed, AI casters also use SR spells. According to the mod's author, the AI only uses some IWD spells (arcane and divine), not every IWD spell. Also, SCS accommodates the new spells from SCS, from IWDification, and from Spell Revisions. SCS also adds an option to add a level 9 arcane spell, create boneguard which summons d2 boneguards. -Teleport Without Error Spell for BG2 & BG2EE Adds the level 7 arcane spell Teleport Without Error. (The linked version - version 15 - is EE compatible, and maybe also EET compatible.) Using this spell may result in bugs due to warping places the game expects you to walk. You've been warned! The Darkest Day (TDD for Pre-EE Games, TDDz for EE Games) This mod (TDDz for EE and TDD for pre-EE) adds many new spells listed here of all spell levels and for Sor/Wiz, Cleric, and Druid spell lists! -Test Your Mettle! Adds Spacewarp as a level 5 arcane spell. -Tome and Blood Among other things, Tome and Blood (TnB, Tome & Blood, etc.) includes options for radically changed illusionary clones (mislead, simulacrum...), rebalanced spell schools, and cantrips (infinite-use innate abilities that count as level 0 spells or/and treating level 1 spells as infinitely usable). -Trials of the Luremaster (BG2 TotLM) Adds Icewind Dale arcane spells and divine spells if these spells haven't already been added by another mod, like IWDification. **Warlock (Spells from this mod don't count against the 50 spells per level limit!) Adds Warlock as a Bard kit with many kit-specific invocations, usable at-will. -Weasels! Adds a small number of arcane and divine spells, all weasel-themed. -Wild Mage Additions Adds 27 new arcane spells for Wild Mages only. VERSION HISTORY 2.5: December 23, 2022 -Added Region of Terror Fandom wiki page for mod-added spells & kits. 2.4: October 8, 2022 -Added mention in Sword Coast Stratagems (SCS) of it adding an install option for create boneguard. 2.3: October 29, 2021 -Updated Saradas Magic II (Saradas Magic for BG2) link. 2.2: October 19, 2021 -Added Tome and Blood. -Fixed a bit of the formatting. 2.1: October 1, 2021 -Added deratiseur's Unused Kit Pack and Divine Remix. 2.0: September 23, 2021 -Updated certain mods' GitHub links to point to their latest release. 1.9: May 30, 2021 -Added Dimension Gate. 1.8: February 23, 2021 -Added the Red Dragon Summoning spell. 1.7: February 21, 2021 -Added deratiseur's Spell Mod (French only). 1.6: February 15, 2021 -Thanks to subtledoctor of Gibberlings3 for telling me that Northern Tales spells can't be learned by spontaneous casters but also don't count against the limit of spells per spell level. -Thanks to Greenhorn of Gibberlings3 for telling me that Stone of Askavar has a small number of arcane spells! 1.5: February 14, 2021 -Explicitly mentioned which mods' spells don't count against the limit of 50 spells per type (arcane/divine) per spell level. 1.4: February 12, 2021 -Added TDDz (The Darkest Day) because I felt like it. Thankee to Azazello & Jarno for the mention in the Gibberlings3 thread months ago! -Updated link to teleport without error. This newer version (version 15) includes BG2EE compatibility. Alleluia! 1.3: September 7, 2020 -Added Chaos Sorcerer because I felt like it. -Clarified SCS AI casters to also cast Spell Revisions spells if SR is installed. 1.2: September 7, 2020 -Added Out! Brief Candlekeep. -Clarified that SCS AI used some arcane and divine spells from Icewind Dale if installed. -Added forenote about how I obtained the information about what spells are in each mod. 1.1: September 6, 2020 -Clarified the default spell limit per spell level to be 50 instead of 49. (The range of available spells by default is IDs 0 to 49.) -Clarified what SCS AI did and that Spell Revisions only added some IWD spells. -Added common acronymns for certain mods. -Added IWDification, Wild Mage Additions, and B_Spells. 1.0: September 5, 2020 -Initial Release. Alleluia!
  3. tl;dr: Add "LabelType = GloballyUnique" line into mod metadata file. Then for each mod component add WeiDU LABEL keyword by combining modder prefix or author name, mod display name (read warring!) and the component name. Then never even change it. You will help other modders, people who create so called 'mod compilations' and players who do use mod managers. Introduction: Project Infinity feature status: implemented You might wonder, what is LABEL? Why I should add LABEL's to my mods? LABEL is a better DESIGNATED. It allows assigning a unique textual identifier for a given mod component. And use this identifier to handle internal dependencies between the components of the same mod and external dependencies of the mods from different authors. By using globally unique LABEL's locally, you are saving yourself the trouble of fixing dependences after DESIGNATED changes. By using external mods LABEL's for defining dependencies, you avoid 'locking' DESIGNATED numbers changes of those mods so the author can freely change them when he needs to. Finally, those are extra advantages that mod ecosystem will get when LABEL's will be treated as globally unique instead of being bound to tp2 name: label can help you to properly handle mod component dependencies of the other mods, other modders could use labels from you mods the same way so-called mod compilations will not become obsolete after changing the DESIGNATED numbers or even donating components to other mods installation order guides will not become obsolete after changing DESIGNATED numbers or even donating components to other mods mod conflicts list will not become obsolete after changing the DESIGNATED numbers or even donating components to other mods players can safely keep the list of selected mod components and use it without this kind of nightmare The goal is to create LABEL that is globally unique across ALL existing and future mods. It's easy and straight forward when you keep simple general rule: Modder'sPrefixOrAuthorName-ModDisplayName-ComponentName WARRING: It seems natural to use the so-called tp2 basename as part of the LABEL. Of course, you can do it, but you should be aware that the whole LABEL is locked and remains the same forever even if the component (its code) would be moved to another tp2 file/different mod, no matter if it's your mod or someone else. You should absolutely leave it unchanged. This is a very important distinction that is not obvious at first glance. If a mod MyTweaks.tp2 contains a component with the label 'xx-MyTweaks-RemoveDragons' and later is donated to cdtweaks.tp2 mod/file, the LABEL STAYS THE SAME with modder prefix and tp2 name! How to enable: Step 1: Add the Add "LabelType = GloballyUnique" line into mod metadata file. Step 2: For each component of your mods, create labels according to below requirements and best practices. Label requirements: no spaces no special characters no Unicode characters minimum 4 characters cannot be the digits-only, using digits-only (LABEL '100', '1000' etc) for LABELS in fact removes it's advantages cannot be combination of 'ID:DESIGNATED' as actual LABEL (LABEL 'MyMod:0' etc) cannot be ONLY tp2 basename, the main component of you mod could be easy constructed by adding '-Main' suffix Label best practices: kebab-case, snake_case, PascalCase it's best to start with modder prefix: xx-MyMod-Main from the most significant to the least significant: "xx-MyMod-Portrait-Brath" / xx-MyMod-Portrait-Wallo" instead of "xx-MyMod-Wallo-Portrait" / "xx-MyMod-Brath-Portrait" avoid using the component category in the label name Component category (equivalent to WeiDU GROUP feature) is a virtual concept and depends on individual preferences. After transferring components to a different mod or category, the label will have a mismatched and confusing name so it may mistakenly prompt people to change this part of the LABEL, but it should never be done. Example: BEGIN "MyMod" LABEL "MyMod-Main" Wrong label names: "a" - not enough characters "Spells" - too general name "Main" - too general name, add mod display name "MyMod" when tp2 is MyMod.tp2/Setup-MyMod.tp2, please add '-Main' suffix Proper label names: Labels of the main component of Ascension mod by DavidW: ////////////////////////////////////////////////////////////////////// // Ascension main component: rewritten Chapter 10 // ////////////////////////////////////////////////////////////////////// BEGIN @104001 DESIGNATED 0 GROUP @101000 LABEL Ascension-RewrittenFinalChapterOfToB Labels of the main component of Transitions by Lauriel: //////////////////////////////////////////////////////////////////////////////////// // MAIN COMPONENT FOR ALL GAMES: ALLOW CONTINUED PLAY AFTER DEFEAT OF BOSS ENEMY // // OPEN THE PALACE AND MODIFY DUKE BELT TO ALLOW FOR BG1 CONTINUATION // // OPEN SULDANESSELLAR AND MODIFY QUEEN ESSEMINE TO ALLOW FOR BG2 CONTINUATION // // HANDLES PC'S ROOM IN THE PALACE AND IMOEN'S TRAINING IN MAGIC IN EET // //////////////////////////////////////////////////////////////////////////////////// BEGIN @2 // MOD 0 LABEL "#L-TRANSITIONS-MAIN"
  4. Introduction: The current way of handling mod dependences is relying on DESIGNATED numbers. Due to how DESIGNATED numbers are inseparably connected to the mod components structure and order, it's inevitable that sooner or later those numbers will be changed and all dependencies will have to be updated. And when they do, everything breaks. Instead of using REQUIRE_COMPONENT, FORBBIT_COMPONENT with DESIGNATED numbers, we will use mod LABEL with combination of MOD_IS_INSTALLED and ID_OF_LABEL as an improved way that won't rely on DESIGNATED numbers and it won't prevent modders from changing them. Please remember that it's not only about improving your mods, it's also about giving a good example for new modders. The common practice of new people is reading other mod's code to figure out how to do things instead of reading WeiDU documentation. Q: What is LABEL and why I should add LABEL's to my mods? A: LABEL is a better DESIGNATED. It allows assigning a unique textual identifier for a given mod component. And use this identifier to handle internal dependencies between the components of the same mod and external dependencies of the mods from different authors. By using globally unique LABEL's locally, you are saving yourself the trouble of fixing dependences after DESIGNATED changes. By using external mods LABEL's for defining dependencies, you avoid 'locking' DESIGNATED numbers changes of those mods so the author can freely change them when he needs to. Q: I would like to add LABEL's for all my mods so other modders can use it. How to create proper LABEL? A: Read this guide: What is LABEL, why you should create it and how to do it properly How it was handled before: mod provide DESIGNATED numbers assigned to it's components other mods and tools create dependences based on those numbers after a mod update, the DESIGNATED numbers had to be changed and with it, all mod dependencies need to be updated How it is handled now: mod provide globally unique LABEL's assigned to it's components other mods and tools create dependences based on those LABEL's even if DESIGNATED numbers will be changed due to the evolution of the mod, their LABEL's won't so all mod dependencies will still be correct Advantages: using the new way will allow for the dependences to no longer rely on DESIGNATED numbers and survive when they change avoid 'locking' of external mods DESIGNATED numbers changes, author will be able to freely change them when they need Prerequisites: the mod that we want to add dependencies must have LABEL's added to it's components Example: Let's consider a NPC mod that has 3 components: the component that add NPC with all it's content into the game the component that allows to change NPC portrait, this component requires main component to be installed the component that allow assigning a special kit from an external mod, this component requires an external mod main component to be installed NPC.tp2: BACKUP "weidu_external\backup\NPC" // move backup folder outside of the main mod data folder SUPPORT "forum.com/thread-1" VERSION "0.1.0" AUTO_EVAL_STRINGS BEGIN "NPC Main Component" LABEL "NPC-Main" DESIGNATED 1000 OUTER_SET ID-NPC-Main = ID_OF_LABEL "NPC.tp2" "NPC-Main" PRINT "ID of the NPC-Main LABEL: %ID-NPC-Main%" // Example of local dependency BEGIN "NPC Portrait Component" LABEL "NPC-Portrait" DESIGNATED 2000 REQUIRE_PREDICATE MOD_IS_INSTALLED "NPC.tp2" ( ID_OF_LABEL "NPC.tp2" "NPC-Main" ) "This component requires main component." OUTER_SET ID-NPC-Main = ID_OF_LABEL "NPC.tp2" "NPC-Main" PRINT "ID of the internal NPC-Main LABEL: %ID-NPC-Main%" OUTER_SET ID-NPC-Portrait = ID_OF_LABEL "NPC.tp2" "NPC-Portrait" PRINT "ID of the internal NPC-Main Portrait: %ID-NPC-Portrait%" // Example of external dependency BEGIN "NPC Kit Component" LABEL "NPC-Kit" DESIGNATED 3000 REQUIRE_PREDICATE MOD_IS_INSTALLED "Kit.tp2" ( ID_OF_LABEL "Kit.tp2" "Kit-Main" ) "This component requires the main component from the external Kit mod." OUTER_SET ID-Kit-Main = ID_OF_LABEL "Kit.tp2" "Kit-Main" PRINT "ID of the external Kit-Main LABEL from Kit mod: %ID-Kit-Main%" Kit.tp2 (for reference, must be installed before NPC.tp2): BACKUP "weidu_external\backup\Kit" // move backup folder outside of the main mod data folder, change only your mod data folder name SUPPORT "forum.com/thread-1" VERSION "0.1.0" AUTO_EVAL_STRINGS BEGIN "Kit Main Component" LABEL "Kit-Main" DESIGNATED 9999 OUTER_SET ID-Kit-Main = ID_OF_LABEL "Kit.tp2" "Kit-Main" PRINT "ID of the internal Kit-Main LABEL: %ID-Kit-Main%" Possible WeiDU improvements: remove the requirement of having '.tp2' for the ID_OF_LABEL tp2 name parameter (for now, you can use a local variable with full tp2 name) add a possibility to use ID_OF_LABEL for REQUIRE_COMPONENT and FORBBIT_COMPONENT so the syntax can be simplified
  5. Note: I expect that K'aeloree will create another darned good and simple-to-follow tutorial on this in the relatively near future, correctly outlined, and hopefully he will loot and pillage this attempt in the process. These materials are a consolidation and reference on the subject often passed quickly through on the way to getting dialog in the game. As a side benefit, they provide cut & paste template materials as "code shortcuts". -cmorgan There are many different dialog files the engine calls on when the game is unfolding. There are some great tutorials out there, but since I like to prep stuff beforehand, perhaps this breakdown will be a useful addition and save some folks some work coding their mods. Preparation Tutorial links useful to follow before/while/after reading this investigation of dialog file usage: The Road to Banter - by Blue, the Immortal Bard gives you a clue about some of the dialog files and their use, WeiDU Basics - by Japheth you basic IF THEN END states, a series of short tutorials/examples by Kulyok on PPG and several other sites gives you basic examples, and Definitions, Tools and Resources, NPC Creation Series, part 1, by berelinde and the follow up parts 2 and 3 give you a solid basis for all NPC creation including dialog files. A follow up with Theaceface's Ace's very long NPC creation guide should give you a crosscheck on ideas, so that you can get a handle on much of the syntax. Check out K'aeloree's new materials on SHS as well for follow-up and step-by-step breakdowns on things like "What is CD_STATE_NOTVALID and how do I use it?" or "Coding Interjections" or "Coding Friendships and Romances". If you are looking for item dialogs before I get there, there already is a great tutorial available on that: Easy Item Dialogs, for BG2 SoA and ToB by Smoketest. To organize the basic concepts, check out NPC Dialogue 101 by Ghreyfain, also found in a repost at SHS. This tutorial is an expansion of Ghreyfain's original work. After you have finished this tutorial, I suggest a quick visit to a pair of posts/tutorials, for the folks struggling with the whole "why does the order of states in a file matter" thing (or "why does my dialog not play correctly") which often has to do with the order that the engine 'sees' the various states in order to evaluate whether they are true or false. Weights - State Weights - by Japheth and the follow-up Another look at WEIGHT, by JCompton. So now you have some basics down, let's review again exactly what a state is, and what a dialog file is. Introduction: A review of States and Dialog Files Primary concept: dialog files are lists of states. At the most elementary logic level, a dialog file is no more than a list of possible text lines for the game to present. IF ~some_condition_exists~ THEN PRINT_TO_SCREEN ~some_text_with_or_without_additional_links~ END IF ~some_other_condition_exists~ THEN PRINT_TO_SCREEN ~some_text_with_or_without_additional_links~ END IF ~no_condition~ THEN PRINT_TO_SCREEN ~some_text_with_or_without_additional_links~ END Brought into the game by WeiDU reading in the file myMod.tp2, a dialog state is added when WeiDU compiles an IF THEN END code block through a ".d file" into a new or existing game resource designated by the extension .dlg Examples of usage in myMod.tp2: COMPILE ~myMod/c-aran.d~ COMPILE EVALUATE_BUFFER ~myMod/dlg/AnyNameYouwWant.d~ Reminder: when WeiDU compiles a .d file, it does not automatically add or start or set up references, or create a .dlg file. WeiDU still needs entries in the .tp2 file and .d file to set this into the game. So /* standard .d file with dialog */ COMPILE ~myMod/c-aran.d~ /* "evaluated" .d file with dialog and in-file variables that need to be evaluated before adding strings to the dialog.tlk */ COMPILE EVALUATE_BUFFER ~myMod/dlg/AnyNameYouwWant.d~ does not add the dialog files c-aran.dlg AnyNameYouwWant.dlg it just processes those files to find out what you *do* want added to the game. To add specific dialogs to the game, the .d file needs to have some entries. Why don't we start with adding a .dlg file so that the game will recognize a valid dialog: in myMod.tp2: COMPILE ~myMod/c-aran.d~ in the related c-aran.d: BEGIN ~c-aran~ So that gives the i.e. engine a chance at identifying and reading a new .dlg. Let's go on and add three states to c-aran.d. To keep things separated and simplified, we have begun a .dlg, and now we are going to add states to that .dlg - to "append" new materials to the existing file. BEGIN ~c-aran~ APPEND ~c-aran~ END The APPEND block contains all of the states that relate to a single dialog file, "c-aran". Now we add some actual states: BEGIN ~c-aran~ APPEND ~c-aran~ IF ~NumTimesTalkedTo(0)~ THEN BEGIN c-aranstarts SAY ~Aye, welcome, then. This is a fine day on Trade Way." IF ~~ THEN EXIT END IF ~NumTimesTalkedTo(1)~ THEN BEGIN c-aranagain SAY ~I do remember you - we talked before, didn't we..." IF ~~ THEN GOTO c-aranends END IF ~~ c-aranends SAY ~No matter. Welcome again, then. This is a fine day on Trade Way." IF ~~ THEN EXIT END END The only difference in the above three states is what brings them up to the engine's "use this now" list. While that's a whole other topic, we can shortcut to the following breakdown; When the game engine looks in the .dlg file c-aran, and begins evaluating each state in order. It checks agains State 1, and if it finds the condition NumTimesTalkedTo(0) is true, it fires off State 1 - and in the dialog box in-game, the player sees the text string "Aye, welcome, then. This is a fine day on Trade Way". If it finds State 1 is false (for example, if this is the second time we have called on the dialog file "c-aran.dlg"), then the engine skips State 1 and moves to State 2. It tries again; if it finds " number of times talked to = 1", then state 2 is fired, and the player sees the text string "I do remember you - we talked before, didn't we...". If this is the third time we have talked to the NPC assigned the .dlg "c-aran", then we have a problem. State 1 evaluates false and is skipped, state 2 evaluates false and is skipped, and state 3 has no condition - it literally cannot be evaluated. State 3 can only be linked from another state (in this case it is linked from State 2), so the dialog fails. What happens at this point depends on several factors not for discussion in this tutorial. For now, let's go back and fix this so there is no chance of failure: BEGIN ~c-aran~ APPEND ~c-aran~ IF ~NumTimesTalkedTo(0)~ THEN BEGIN c-aranstarts SAY ~Aye, welcome, then. This is a fine day on Trade Way." IF ~~ THEN EXIT END IF ~NumTimesTalkedToGT(0)~ THEN BEGIN c-aranagain SAY ~I do remember you - we talked before, didn't we..." IF ~~ THEN GOTO c-aranends END IF ~~ c-aranends SAY ~No matter. Welcome again, then. This is a fine day on Trade Way." IF ~~ THEN EXIT END END Now, either State 1 or State 2 will always be true, and we can look at the reply section of State 2. It creates a direct link to State 3. So the game evaluates State 2, then follows the reply, and we get two separate dialog boxes: I do remember you - we talked before, didn't we... No matter. Welcome again, then. This is a fine day on Trade Way. For great information on how to use and manipulate states, there are a large number of in-depth and beginner-friendly tutorials. So let's move on to the subject of this tutorial, which is more about organizing groups of states and forming and manipulating dialog file references. Here, we contextualize states, and break down what .dlg files are - what they do for our NPC.
  6. "Go on, wi' ye, then. I can write fine, but my speakin' is not so good, unless I really try. Here - let me give her a shot. Hrmmpf. 'Fair Ladies and Gentlemen, I bid you good morning. Please pay no attention to the minor inconveniences of last evening's disturbance. Our uninvited guests of yester-eve have passed on to other occupations, many of them involving plant fertilization. Our chef has prepared a special meal for your enjoyment; due to the small matter of our cookwagon being set ablaze last night while defending the camp, we have prevailed upon him to create a special morning repast of Frison Rodentia and Flatbread Carbona. This way, if you please, for your morning repast.' " *cough* "See, I can put it on, but it takes a mite o' effort, at that." Aran Whitehand is a human fighter and scribe for BG2, dual classable into either cleric or mage. Basically, a human utility player taken along for the friendship/cuddling. "Specials" include creation of minor scrolls through dialog and timer when in a party with another canon mage. Primarily a male friend who can grow into an extended courtship/romance, romanceable by female PCs, Aran has his own sense of humor and specializes in bringing others into the conversation. Functionally, Aran is a Companion mod. He has a minor optional quest with a new area, but comes with no special weapons or upgradeable items - his specialty is in interacting with the members of the party and adapting to situations. For him, the job is paramount, and his job is supporting the player. He is no stranger to having to carry out orders which bend morality, though he hates doing so. It should be noted that this mod is designed by adults for adults, and should not be installed unless you are comfortable with Faerunian swearing, occasional adult themes, and NC - 17 to R rated content in the Romance portion. Statistics immaterial these days, as folks can patch them how they want, but to start him off with some basics, a reorder based on Gavin. Berelinde did a bunch of soul searching and came up with a good 'common adventurer' set of stats, and why mess with success... power players can adjust him to build a Kensai/Mage dual class quickly enough "Warrior" configuration [player options on install, fighter] Strength 17 Dexterity 16 Constitution 15 Intelligence 12 Wisdom 13 Charisma 12 "Poet" configuration [player options on install, for Cleric dual class] Strength 16 Dexterity 13 Constitution 15 Intelligence 12 Wisdom 17 Charisma 12 "Thinker" configuration [player options on install, for Mage dual class] Strength 16 Dexterity 13 Constitution 15 Intelligence 17 Wisdom 12 Charisma 12 "Survivor" configuration [player options on install, for Thief dual class] Strength 16 Dexterity 17 Constitution 15 Intelligence 13 Wisdom 12 Charisma 12 Alignment Neutral Good. He thinks. "Bugger off, you sorry old jackass - I never said naught 'bout my alignment. Tymora's Bright Coin, you take liberties, you do. Tymora suits me fine. She even don't mind my speakin' so free, swearin' on th' gods, most times. At least, not yet." Friendship Aran will befriend any protagonist of any race or alignment,though how he reacts to situations will definitely let the player know how he feels. A rough - around - the - edges man, accustomed to mercenary service and caravan work both in front of and protecting the books, Aran hires on as a scribe or accountant as well as protection. He has learned to work with practically anyone not Drow, and chase any female within arms reach. His language is rough, his approach unrefined. And if you don't like it, he will gladly tell you exactly what your opinion is worth. Folks he would like and respect: Keldorn - Minsc - "Mad Minsc. That's not quite right, though. Make it Magnificent. I'd take him 'side me on a shield wall any day o' the week, 'giant space hampster' an' all." Ajantis - "Ajantis, laddie. There's fightin' fair, an' then there's winnin'. See, if you shine your armor like that, they knows you are an officer, an' the archers take you out first. Aint' no honor in dying before you can swing yer sword." Yoshimo - "Aye, then, deal th' cards again,. I'm down four tradebars an' three iron cresents, an' I want a chance to even the score, eh? While you are at it, tell me anouther tale o' Kara-Turan womenfolk, an' I'll buy th' next round." Angelo (Aran wasn't in BG, so he knows Angelo only by Flaming Fist contacts - "Hey, old man, lend some expertise here, eh? I'm havin' troubles wi' this parryin' position. Show me again, eh? A mug o' ale if you teach me..." Azure - "Now, she's a right fine lady, she is. Sharo's got one eye on me most o' th' time, though, so I'm not rightly sweettalkin' her any time soon." Alora - "Tymora's Smile, that halflin' lass is th' sprightliest an' happiest bein' I know! If <CHARNAME> ever drops me for good, me an' her, we should think o' teamin' up an' goin' on some adventures. She's right fun, she is!" Ninafer - "Pity she looks right through me, as if I'm not there. Bad taste in men, she has. But she's a right stalwort companion." Keto - "That lass is a right fine storyteller. She can drink me under th' table, sing like an angel, an' she's as smart as a whip. What's not to love? If <CHARNAME>'s not available or interested, now there be a lady what I would love to spark wi'. A real equal. I wonder what kind o' thinkg she might like as a courtin' gift?" Folks he would like and understand a little: Aerie - "Hey there. Come over here, girl. I have some drills you can do what's to strengthen your lips. Called 'kissin', I believe, among th' fair folk." Imoen - "You doin' all right, Imoen? You got someone troublin' you, let me know. Never met an argument I couldn't solve, thogh I do admit some were by fist an' sword instead o' words. Aww, who am I kiddin'. Who needs swattin'?" Nalia - "I don't quite understand you, Nalia. But you are a fine lookin' young women. You like dancin'?" Jaheira - "Awww, quit motherin' me, Jaheira. Here, I got these for you. They'll do fine in that stew you like to cook. Here, let me cut 'em up for you." Gavin - "Hey, watch it.... damn. Lathander's Golden Poop, Gavin, you gotta stop that backswing. Here, let's go work on it. I'll teach you to not knock me silly when I'm on the battle line with ye, and you argue wi' me about my immortal soul. Fair trade?" Sarah - "I don't blame ye for likin' the womenfolk, lassie; I sure as hells do! Say, next inn, let's go bar hoppin', an' I'll watch your back, you watch mine. If they swing your way, I steer 'em to ye, and vice versa. Sarah? Sarah? Mask's Left Hand, where'd that lassie disappear to..." Ainshai - "Sune's Slender Wrists, that one will drive a man to drink, she will. I suppose I should be keepin' my eyes on' th' business an' not on her, but the lass is right pretty. An' she can whup my arse on hand-to-hand. What's not to like?" Haldamir - "Helkaer Haldamir. Means 'icy one' in lammen Tel Quessir, that does. Good fighter, keeps to himself. I suppose you get that way if most o' th' folks you are fightin' alongside are younger than pre-apprentice age, an' will die out afore you blink your eyes a couple o' times. Never did understand why elves bothered wi' us mayflies." Alassa - Now why do some o' th' finest females come in evil, self-servin' packages? At least she's got spine an' gumption. But somehow, I don't rightly think she'd back me unless there was somethin' in it for her." Branwen - "That Tempus-lovin' girl is a sight for sore eyes, she is. I'd make a pass right quick, if every time I wandered by she didn't start all that serious discussion about dyin' an' goin' to fight alongside her god. I'm a mite more comfortable on this here plane o' existence, thank you very much. That whole dyin' thing, well, I tend to try to avoid it." Dynaheir - "Now there be a true lady. If we had more nobility like that, well, there'd be a sight more happy people in th' world. A little formal an' stuck on th' law, but what do you expect for a leader-type." Fade - "She be th' kind what sees what she wants, an' gets it. As long as I can keep th' goals coincidin' wi' hers, I get a great advantage. If our goals ever differ, I'd best watch my back. Wouldn't want to see nothin' sharp stickin' out o' it." Andrei - "A smart lad, just a raw recruit. A bit sheltered. But he listens to my stroies, an' takes pointers, an' all. I like him fine." Ghareth - "He tells some nice stories, he does. Good lad. Not much more to say, eh?" Hubelpot - "Corelon's Blade, he knows his food, he does. It's a right fine pleasure to watch him cook! Th' fightin, well... he's gettin' th' hang o' it. We are on a barter system, see. His recepies, my swordskills." Kelsey - "He knows merchant, he knows some fightin' ways - an' I do think he's a right fine party member. Th' boy's got some serious magic, he does. I just wish he weren't lookin' to spark wi' all th' available females. Puts us at odds, sometimes, on account o' that bein' *my* job!" Auren - "You look her direction, an' your eyes get stopped in their tracks, they do. In a good way, o' course. But she seems to like Nalia right propr, an' wears th' flower in th' other ear, so there's no use barkin' up that tree." Folks he would like alot and have absolutely no respect for at all: Bruce - "Barroom Bruce, named such on account o' I keep havin' to drag his sorry arse past, around, or out o' every single one we venture on. Good drinklin' companion until he gets drunk, an' not so much a fighter as an arrow-holder. I keep tellin' him that gettin' nekkid an' runnin' screamin' at kobolds weildin' short bows is not a valid battle tactic. O' course, he just tells me to sod off an' get us somethin' to drink." Kari - "Nice enough furrball, an' she's developin' some skills. Still scared o' her own shadow, though. She blushes about as much as I do, an' somehow I think th' gods have a nasty sense o' humor. Now where is she goin' to find someone to love her, eh? That just stinks. I spent way too long fendin' off kobold raids, an seein' them as scavenging animals. Not sure I can ever take her serious, as a party member an' all." Folks he would be neutral/unsure towards: Touchstone - "Not sure what to think, there. Nice enough on th' shield wall, an' strong. But I think either he's done taken one to many hits to th' head, or else he needs a decent tutor in common. Talks funny, he does. Hey, what are you laughin' at?" Callisto - "Nice enough to look at, good at her job. Wouldn't want to go carousin' wi' her, though. You don't rightly want to be around when she gets enraged, eh? There's no tellin' where her weapons get pointed." Nikitalleria - "Lathander's Light, what that girl can do wi' her fingers... But I am not sure she sees me th' same way. Somehow, I don't rightly think she likes me." Biddlekorak - "Not so bad for a shortaxe what's heard th' call. I get right tired o' all th' evangelical stories, but ghe don;t rightly get to talkative, so he's fine by me." Coran - "The boy's got charm, an' he's sharp, he is. But not much else goin' on, I think. I wouldn't trust him to hold my purse, or anythin' else, for that matter. Don't see what the ladies see in him." Iylos - "I suppose that insolent bastard knows his job. But th' backtalk, well, he could be a mite more respectful. <CHARNAME>'s been a force for a long time, an' here comes th' big bad investigator. If he plays fair an' backs <CHARNAME>, I might readjust my opinion. But if not, we will have to see if he really can stop a blade wi' his hand an live to tell the tale." Folks he would not like, but would respect and back up: Korgan - "Alright, ye black hearted Son o' Cyric, pass over those dice. You are cheatin' again." Valygar - "You are fine with a blade, friend, but magic is a powerful weapon. Why do you hate it when it'll save your arse nine times out o' ten?" Cernd - "Look, Cernd. Stop with all the talk, an' let's get down to brass tacks. What do we have to kill, an' how do we do it?" Saerileth - "Are you kiddin' me? A fifteen year old? I wouldn't kick her out o'... well, she's fine, I guess. But she don't know squat about livin', let alone fightin' proper. Tyr's Blasted Buttocks, don't send a child to do adult's work" Xan - "Doom an' gloom, all talk and no action. Shut up, ye pansy arsed jackass. Grab that Moonblade an' use it right proper, now - we got business to attend to. Don' understand quite a bit 'bout you, but you can kick arse when you've half a mind, for sure." Tashia - "Look, you are an eyeful, an armfull, an' just about the best sorceress I ever met. But when are you gonna get settled down an' take things serious? We aren't on a picnic, an' you already cost us pretty dear draggin' all that baggage onto th' party. Get with the program, lassie." Sarevok - "You made your play, an' lost. You backin' <CHARNAME> now? Fair enough. Just make sure you're on th' right side o' th' shield wall. I don't take kindly to triple crosses." Sebastian - "He be a slippery devil, that one. I 'm not rightly sure I have gotten a straight answer out o' him. Nine times out o' ten, I think he knows more than he lets on, eh?" Keen Kachiko. Keen mind, keen sword, keen tongue. Best to keep out o' all three's way." Folks he would dislike and not trust: Jan - "You talk too much, boyo. An' you keep blatherin' 'bout all those inventions. Ain't never seen a turnip soup worth eatin', neither. Keep out from underfoot, shorty." Amber - "You can take th' girl out o' the hells, but you can't take the hells out o' the girl. Only thing I can say for her is she aint' a drowess." Chloe - "I'm not sayin' nothin'. Anyone wi' divine blood's a damned sight scarier than findin' yourself penilless in Calimport. Well, exceptin' <CHARNAME>, o' course." Cassius - "Mask's Left Hand, the skald never shuts up, eh? Hey, don't be lookin' at me like that, Haer'Dalis! I shut up. Occasionally. When th' wind is right." Gozaloth - "That floatin' eyeball never did say what all that goo was. And I'm not rightly sure I want to know, anyways. Ten iron crescents says th' bastard gets skewered before th' second fight is over. An' whio do you think is gonna have to haul his goey stinkin' oozy bady back to a temple for to be healed? Well, it's not rightly likely to be <CHARNAME>, to be sure." Horace - "I still get th' shakes just lookin' at him reachin' for a weapon, straight through his own bony ribcage. I think I'm not likely to sleep at night wi' a skeleton for a companion. After all, what do you buy a skeleton to drink? Can't rightly buy him a round. That's just not right." Sheena - "Yeah, right. I know, you think I'm a racist son o' a bitch, but there be two bein's where you'd be right 100% o' th' time. I don't trust no dragon larger than a pseudodragon. An' wi' that... lady...well, th' language is all pretty an' correct, but I keep expectin' to wake up as th' main course for her when she goes all firedrake random-like." Folks he would hate: Tsjuatha - "Stay away from me, necromancer. Y'ain't natural. I respect the Tel'Quessirim, but anyone be dabblin' in the dark arts is not to be trusted." Viconia - "Move one step closer, Drowess, an' you are a dead woman. Sorry, a dead spider. Didn't mean no offence to women by associatin' you with 'em." Edwin - "Come on, Edwin, it ain't that bad. At least in that dress, your legs look good. In fact, that's about the only thing redeemin' about not kickin' you out in front o' the dragon, an' having you scout forrard." Anomen - "The worst of the officer class. Give me a crossbow, an' turn the other direction - I think there's gonna be an accidental 'friendly fire' incident." Faldorn - "Hey, wolf-girl. Get your smelly arse out where I can see you. An' keep your hands away from that spellpouch. Wouldn't want to have to disturb *your* balance, by loppin' off one o' your legs or arms, or such." Miriam - "Bane-blighted bloodsucker. I need to get me a new holy symbol an' some more garlic. An' a stake." SilverStar - "Keep that psychotic creature away from me, eh? Dangerous." Irenicus - "Bloody mad, an' evil. But I guess <CHARNAME> can handle him. As for me, well... when a dog goes mad, they try to cure him, an' if that don't rightly work, they put him down. This whole 'resurrect you opponent an' try an' redeem him' thing, that sounds way too complicated to me. Kill th' Bane-buggerin' bastard, disintegrate his head, toss his bones to th' wolves, then blow up th' wolves. An' blot his name out o' th' history books, just to make sure." Kindrek - "Bloody evil Cyric Buggerin' Bastard. Gotta keep both eyes open while I sleep, wi' him around, I do." Romance Aran will romance any female protagonist of any race save Drow, or any alignment. Again, how he reacts will definitely let the player understand his position. Good men fall for bad women as quickly as for good ones, and sometimes opposites really do attract. But romance on the trail is awkward, with a group of adventurers around, and the road to romance is both rocky and complicated. Exactly how does a strong man feel when his significant other turns out to be infinitely stronger than he, on so many levels? Can the two of you negotiate the attraction into something of an equal relationship, or is this destined to fail? When Aran Whitehand meets the party, he is looking for work having dropped from the rolls of a mercenary regiment.
  7. The GROUP flag came about in discussing component management with an abnormally large number of independent components, e.g. BG2 Tweaks, and was added as a feature in WeiDU v192. Previously WeiDU lacked a satisfactory way to organize such a modâ€"the closest feature would be the top level ASK_EVERY_COMPONENT, which only allows for a single all-or-none approach. The solution is a new component flag, GROUP, with the following syntax (and example): GROUP string BEGIN ~100% Learn Spells~ GROUP ~Convenience Tweaks~ // component code BEGIN ~Identify All Items~ GROUP ~Convenience Tweaks~ // component code BEGIN ~Give Edwin his BG2 Stats~ GROUP ~NPC Tweaks~ // component code BEGIN ~ Give Jaheira her BG2 Stats~ GROUP ~NPC Tweaks~ // component code Upon installing the mod, the player is now presented with meta-options on each group at a high level: Would you like to display the category [Convenience Tweaks]? [Y]es/[N]o Would you like to display the category [NPC Tweaks]? [Y]es/[N]o Selecting [N]o on any group suppresses those options from being displayed, leading to a simpler and more controlled installer experience for the player. In the provided example, selecting [N]o to Convenience Tweaks and [Y]es to NPC Tweaks would result in WeiDU starting installation by asking to install the Give Edwin his BG2 Stats component. GROUP operates independently of SUBCOMPONENT, meaning you can use both to organize the mod as needed. A few other items of note: A component can belong to multiple GROUPs; a component is not offered for install if and only if none of its member groups are selected You could, in theory, have two components in the same SUBCOMPONENT grouping but different GROUPs. Don't do this. If some components of a mod are in a GROUP, but others are not, the non-GROUPed components will always be presented. Using a GROUP anywhere in your mod will act as an implied ASK_EVERY_COMPONENT tp2 flag.
  • Create New...