Tuesday, 26 February 2013

Some Campaign Information

At this stage of module creation, there is not a lot I can say that would not be considered too much of a spoiler. Suffice to say, I have been continuing with quests, conversations and journal entries, moving me ever closer to completion. However, I am a little reluctant to move the percentage figure forward at this point, as there are still one or two major conversations I want to address before I do that.

As I was writing some of the plot entries this week, I did think about giving the reader some statistics about the module, which I thought may interest them. Such as the number of quests, the number of areas, etc. However, after giving this more thought, I considered even that information may be too much information. Then I thought of another set of statistics I could offer as an indication of the module's scope: file additions and changes. I refer to XML and 2DA files in particular, as XML relates to new or altered official campaign GUIs (graphical user interfaces), and altered 2DA's can give an indication of altered game play in other aspects, like additional new items or new faiths.

Anyway, whether this information is interesting to you or not, I will let you decide. At the very least, you will be able to have an indication of the amount of "custom content" involved in this campaign ... and as I had already been keeping track of this information over the years, I thought I would share it with you now. NB: These alterations impact the whole campaign, and some alterations may not be seen until modules 2 and 3.


nx2_crafting.2da - Update Crafting.
nx2_enchanting.2da - Update Enchanting.
placeables.2da  - New placeables, including BCKII.
appearance.2da  - New monsters. PC Camera height to simulate FPS.
visualeffects.2da - New monsters effects. (E.g. Beholder)
wingmodel.2da - New monster effect.
des_crft_spells.2da - Prevent spells making certain potions. (E.g. Light)
des_crft_scroll.2da - SPELL FIXES
des_treas_magic.2da - Random treasure item descriptions made generic.
feat.2da  - Add Althea Feats (Menu etc)
skills.2da  - TLK correction for Craft Armour & Craft Trap description.
ranges.2da  - Increase spotting/attack range of creatures.
spells.2da  - MENU & feat systems & alter "named" spells.
nwn2_scriptsets.2da - Allow added PCs to control like companions.
baseitems.2da  - Allow larger Stacking of smaller objects like Life Essence.
iprp_spells.2da  - Correct CLW cost & alter "named" spells (E.g. Bigby spells.)
nwn2_icons.2da   - Adds new images required.
nwn2_deities  - Alters deities allowed in Althéa Campaign
backgrounds.2da - Removes background traits not in Althéa Campaign.
classes.2da  - Alters classes allowed in Althéa Campaign & Ensures cleric good or evil.
Classes Removed: 28, 37, 46, 47, 53, 54, 60 (Harper, Red Dragon Disc, Shadow thief Amn, Neverwinter Nine, Red Wizard, Arcane Scholar, Doomguide)
doortypes.2da - Blocker doors & BCKII & RWS.
metatiles.2da - RWS.
tilesets.2da - RWS.
tiles.2da - RWS.


All the following 2DA files were mostly altered to make a much more controlled economy system:

baseitems  - Reduce items back to base level. (Were twice value.)
armorrulestats  - Mithral and armour prices.
Itempropdef: Contains a factor used in calculating costs.
Itemprops: To correct (remove) some invalid property entries from the toolset.
iprp_arcspell: To alter arcane failure costs. (5-50%)
iprp_bonuscost: To alter ability costs. (1-12)
iprp_bonushp: HP Costs.
iprp_chargecost: To alter costs related to number of uses and charges.
iprp_damagecost: Damage costs.
iprp_damagereduction: To alter damage reduction costs. (1-40)
iprp_damagetype: To alter factors involved with various damage types. (Cold etc.)
iprp_immuncost: To alter cost of immunity percentage. (5-100%)
iprp_immunity: To alter cost of a specific immunity. (Poison etc.)
iprp_meleecost: To alter enhancement value costs, including AC. (1-20)
iprp_monsterhit: Alter more OnHit property costs. (Poison etc.)
iprp_onhit: OnHit special costs.
iprp_onhitcost: OnHit Damage costs.
iprp_onhitspell: Spell hit reduction costs.
iprp_redcost: Special container costs.
iprp_resistcost: To alter damage resistance costs. (Resist 5/- to Resist 50/-)
iprp_saveelement: Save costs.
iprp_skillcost: To alter costs of skills (ranks). (1-40)
iprp_spellcstr: Caster level costs.(1-40)
iprp_spellvcost: To alter costs of spell level related benefits. (0-9)
iprp_spells: To alter spell costs. (A factor that can vary with other files.)
iprp_srcost: To alter spell resistance costs. (10-40)
iprp_trapcost: Trap type costs.
iprp_traps: Trap strength costs.
iprp_weightcost: To alter weight reduction costs. (1-80%)
skillvsitemcost: To reduce ID MAX factor cost.


areamap.xml - My Fog of War mapping system.
barter.xml - Allow plot items to update. (May not be needed now. To check!)
characterscreen.xml - Fixes Temporary Hit Points Feedback when switching PCs.
container.xml - Allow limited capacity.
creatureexamine.xml - Examine and abandoned companion fix.
examine.xml  - Allows distance feedback in header.
inventoryscreen.xml - Inventory feedback fix.
journal.xml  - Large journal option.
loadgamescreenx2.xml - Henchman crash fix (for own death system).
minimap.xml - Allow bigger mini maps.
modebar.xml - Emergency Lighting.
optionsmenu.xml - Henchman crash fix.
partygen.xml - Makes newly created PCs follow the correct PC on entry.
playermenu_popup.xml - Added Statistics, Main Menu and Combat Autopause options.
quickchat.xml - Uses larger style conversation screen with NWN1 conv. (Party opt removed.)
splitstack.xml  - Split a stack fix.
store.xml  - New store system.
worldmap.xml - Allow Map Within Maps.
worldmapnx1.xml - Allow limited travel without food.
fontfamily.xml - Read Books Font.


Dozens of new XML (user interfaces) to add to the game play, from readable books and scrolls and other information type GUIs, to choice panels, input panels and puzzles of all types.

Monday, 11 February 2013

One For Me & One For You (Variable Split Fix)

One of the things I have been looking at since I last wrote is what happens to variables on "stacked items" that are split up by the player to share among their PCs. I had to do this when I noticed one PC, after taking a potion, had less duration for the potion taken than another PC who took one from the same stack.

The problem was that when a player splits a stack of items that have a variable set on them, the variable would be lost on one of the split stacks. Consequently, any code that relied on that variable was affected. In my case, I have some potions that vary in effect level according to a local variable on them. So, to fix the problem, I had to edit the splitstack.xml and create a new script that was called from the xml script, which fixed any splits after they had taken place.

Below is the code from the two scripts that fixes the problem. This version of the fix relies on the builder having an original template of the "item" in question, so that the code can recreate the working object by referencing it. However, I believe it may be possible to make a more robust version of the fix (that does not rely on a template) by using both the CopyItem and CopyObject functions. I might look at that in the future if I ever need that level of fix, but mention it now in case other builders needed such.

The XML Script: splitstack.xml:
I have highlighted the only changes needed for this campaign original XML script.
As always, please be sure to only work on copies of any official campaign scripts, and place your edited copies into either a campaign or override folder, so they are referenced rather than the original.

The gui_splitfix script:

The script that handles the callback when the player clicks OK from the split GUI.
And here are the results:

Player is about to split a stack of ten potions (That have a variable set on them).

New confirmation feedback says what the player has just split.

Debug feedback shows the first stack has kept the variable of 2 when the potion is used.

Debug feedback also shows the second stack has kept the variable of 2 when the potion is used.
One thing that I discovered during this fix, is the way to have the object that the player is targeting made available to the coder via the use of the following function in the following manner:

object oTarget = GetPlayerCurrentTarget(oPlayer);

This will be useful to other coders who may wish to alter other aspects of GUI targeted objects.