Aller au contenu

Photo

Nymph Cloak Blues


  • Veuillez vous connecter pour répondre
17 réponses à ce sujet

#1
Dann-J

Dann-J
  • Members
  • 3 161 messages
I'm implementing Hellfire's horses on my overland map, and I'm automatically switching cloaks in the OnEnter script and re-equipping the old cloak again OnExit. However my sorcerors and bards wearing nymph cloaks aren't too happy with the arrangement, as they're losing spells-per-day with every unequip.

Is there a workaround to stop this happening? So far I've tried the following:
  • Copying the existing cloak's item properties to the 'riding cloak' before swapping (didn't work)
  • Boosting the player's charisma fleetingly while cloaks are being swapped (made things worse!)
It seems that spells-per-day for sorcerors and bards (and perhaps favoured souls?) are automatically decremented whenever charisma is reduced - but not incremented when it is increased again (unless you rest). I'd rather not ForceRest() players every time they leave the overland map, and there's no function to increment spells like there is for feat usage.

Now I'm wishing for a set of riding *boots* instead of a riding cloak...

#2
kamal_

kamal_
  • Members
  • 5 254 messages
The problem is anything in that slot that gives a bonus to the casting stat. It's not just nymph cloaks, actually nymph cloaks are an easier problem. I think you can actually increment uses of the charisma casters. It's intelligence and wisdom casters that are the problem, since they have to memorize specific spells. You'd have to record those and give back the ones that were lost.

#3
I_Raps

I_Raps
  • Members
  • 1 262 messages
Copy the bonus from the cloak onto some other item (possibly Skin/Hide) before removing the cloak, then remove it when they dismount.

Be sure to check for WIS and INT bonuses as well.

#4
Morbane

Morbane
  • Members
  • 1 883 messages

I_Raps wrote...

Copy the bonus from the cloak onto some other item (possibly Skin/Hide) before removing the cloak, then remove it when they dismount.

Be sure to check for WIS and INT bonuses as well.


If the switching of the bonus doesn't zip spells; an elegant workaround :wizard:

#5
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
I'd guess that you'd have to do the swapping of properties when the nymph cloak is initially equipped, before they memorized new spells.

So maybe equipping a nymph cloak runs a script that adds a CHA bonus permanently to the PC, and also adds a CHA penalty property to the nymph cloak, negating it's bonus. Then on un-equip, you just remove the penalty property from the cloak, and remove the added bonus from PC when appropriate.

#6
PJ156

PJ156
  • Members
  • 2 985 messages
You could not have Nymph cloaks in the campaign ...

Headbands of intellect could also be of the Nymph etc, Other cloaks could be come stock in trade that do not affect spell levels.

Sorry I'm no scripter so while you guys look for the scripted solution I am mostly forced to look elsewhere.

On the plus side I am willing to bet my mods are a whole lot easier to trouble shoot :)

PJ

Modifié par PJ156, 19 octobre 2012 - 10:38 .


#7
Dann-J

Dann-J
  • Members
  • 3 161 messages
After a bit of experimentation, it seems that sorcerer spells-per-day are decremented whenever charisma is reduced - regardless of what level charisma is at afterward. Adding CHA bonuses to any other equipped item (like a hide) won't stop the problem happening. It will in fact multiply the problem.

I tried boosting charisma to +10 via a temporary effect while the nymph cloak was being replaced by the riding cloak with identical properties. Spells-per-day decremented both when the nymph cloak was swapped out (despite the identical CHA bonus on the riding cloak replacing it) AND when the +10 effect expired shortly after.

Since there aren't any standard cloak blueprints that add bonuses to intelligence or wisdom (that I know of), it's really only nymph cloaks that are the problem. I certainly won't be selling any in the module, but it's quite likely that the sorcerer or bard characters people play the module with will have them.

I may have no choice but to ForceRest() bards and sorcerers after leaving the overland map if a nymph cloak is equipped. Or exclude them from the automatic cloak-swapping, and have a once-only warning popup stating that sorcerers or bards with nymph cloaks can manually don riding cloaks on the overland map at their own risk. Who really lets sorcerers or bards lead their party on an overland map anyway?

The best way around the problem would be to do away with riding cloaks altogether, and change the appearance of equipped cloaks insitu (or spawn a temporary riding cloak if no cloak is currently equipped). I doubt there are any functions that let you do that though - and even if there were, chances are you'd have to unequip and re-requip in order to see the changes to the character (which would defeat the purpose).

#8
MasterChanger

MasterChanger
  • Members
  • 686 messages
I've looked in vain for a scripted way add uses of a particular spell per day, whether for memorizing or non-memorizing classes. This is an issue that affects many potential projects; I was looking into it in terms of a spell-point/mana-based casting system. Unfortunately, it seems like it would only be doable via NWNX-type plugins, which are way beyond my programming abilities.

#9
Dann-J

Dann-J
  • Members
  • 3 161 messages

MasterChanger wrote...

I've looked in vain for a scripted way add uses of a particular spell per day, whether for memorizing or non-memorizing classes. This is an issue that affects many potential projects; I was looking into it in terms of a spell-point/mana-based casting system. Unfortunately, it seems like it would only be doable via NWNX-type plugins, which are way beyond my programming abilities.


Yes, it's certainly annoying. There are matching increment and decrement functions for feats, but only a decrement function for spells.

I suppose it could be possible to note how many uses of each spell there are before swapping cloaks, force-rest when leaving the overland map, and then decrementing usage where necessary to get back to the right number of spells.

Such an approach might work for memorised spells, but I suspect the sorcerer/bard casting system would make the scripting even more complex than it would already be. If you have three level-4 spells available, and five uses for either of them, then the script might think you can cast 20 level-4 spells. You'd have to separate out just one spell per level and ignore the others, and hope that decrementing that one spell takes care of the others in the same level.

#10
MasterChanger

MasterChanger
  • Members
  • 686 messages
And of course force-resting will remove any Magical effects. If you tried to re-apply these you'd have to go hunting for the effect's creator, re-assign durations, etc. This may not matter if removing effects on transition works for your particular situation, but it certainly created an obstacle for the system I was envisioning.

#11
Dann-J

Dann-J
  • Members
  • 3 161 messages
The function called when leaving the overland map removes all effects anyway. Thanks for reminding me though, since this was another issue I was meant to investigate. One of my test characters has ten levels of red dragon disciple, and it seems that leaving the OLM causes him to lose his fire immunity temporarily.

#12
Dann-J

Dann-J
  • Members
  • 3 161 messages
I've created a couple of elegant little functions that store spells prior to removing the nymph cloak, then decrement spells after re-equipping it again and force-resting. Now I just have to turn them into inelegant messes by factoring in the sub-radial spells that confuse the functions (energy immunity, shadow conjuration, polymorph, etc).

I've learned something important about ForceRest(). You have to wait at least two seconds after re-equipping the nymph cloak before calling the function, otherwise it doesn't recognise the charisma bonus. That would explain why spells-per-day get deprecated when you swap out a nymph cloak for an identical nymph cloak - charisma is decreased as soon as the equipped cloak is removed, but doesn't come into effect from the replacement cloak until two seconds later.

ForceRest() also restores hit points and feat usage. I can deal with hit points easily enough (just one more variable, and a DAMAGE_TYPE_ALL effect), but I'm not sure I can be bothered decrementing feat usages. Sorcerers don't really have activatable feats anyway (except for summon familiar, and how many of us bother using it?). Bards, on the other hand, have several song feats with usage per day. I don't think I mind making my module bard-friendly though. Who am I to deprive the world of song?

#13
Dann-J

Dann-J
  • Members
  • 3 161 messages
It's not quite the work-around I was hoping for, but it works:

// Store spells-per-day on creature before removing
// equipment that boosts a spell-casting ability
void StoreSpells(object oPC)
{
int i = 0;
int iSpell;
int iSkip;
while (i < 1216)
{//exempt subradial spells
if (i > 102 && i < 107) iSkip = 1;//magic circle
if (i > 135 && i < 141) iSkip = 1;//protect align
if (i > 343 && i < 354) iSkip = 1;//shadow conj & greater
if (i > 386 && i < 397) iSkip = 1;//polymorph & shape change
if (i > 529 && i < 533) iSkip = 1;//vine mine
if (i > 968 && i < 988) iSkip = 1;//shades, meteor, energy imm, blade b
if (i > 1055 && i < 1058) iSkip = 1;//scorch ray

iSpell = GetHasSpell(i, oPC);
if (GetSpellKnown(oPC, i) && iSkip == 0)
{
SetLocalInt(oPC, "Spell"+IntToString(i), iSpell);
}
i++;
iSkip = 0;
}
}


// Reset spells-per-day after ForceRest()
//
// ForceRest() must be called at least two seconds after
// equipment that boosts a spell-casting ability is re-equipped
void RestoreSpells(object oPC)
{
int i = 0;
int iSpell;
int iLocalSpell;
int iSkip;

while (i < 1216)
{//excempt subradial spells
if (i > 102 && i < 107) iSkip = 1;//magic circle
if (i > 135 && i < 141) iSkip = 1;//protect align
if (i > 343 && i < 354) iSkip = 1;//shadow conj & greater
if (i > 386 && i < 397) iSkip = 1;//polymorph & shape change
if (i > 529 && i < 533) iSkip = 1;//vine mine
if (i > 968 && i < 988) iSkip = 1;//shades, meteor, energy imm, blade b
if (i > 1055 && i < 1058) iSkip = 1;//scorch ray

iSpell = GetHasSpell(i, oPC);
iLocalSpell = GetLocalInt(oPC, "Spell"+IntToString(i));
if (GetSpellKnown(oPC, i) && iSpell > iLocalSpell && iSkip == 0)
{
DecrementRemainingSpellUses(oPC, i);

iSpell = GetHasSpell(i, oPC);
}
DeleteLocalInt(oPC, "Spell"+IntToString(i));
i++;
iSkip = 0;
}
}

Modifié par DannJ, 26 octobre 2012 - 01:03 .


#14
Dann-J

Dann-J
  • Members
  • 3 161 messages
Great! Now I've discovered that repeatedly equipping and removing equipment that grants bonus spells per level also progressively decrements spells-per-day for bards and sorcerers. The poor guys just can't get a break.

#15
MasterChanger

MasterChanger
  • Members
  • 686 messages
I vaguely recall something about spell slots being added from the right and subtracted from the left. The only way to learn this for sure would be to look at memorizing classes, but the principle is probably the same: a bonus spell slot will be added as an empty one until resting, and then when the bonus is removed a full slot will be taken away.

We really do just need a way to increment spells per day. Even doing as you did above is far from ideal, though currently unavoidable: we currently have no way to know which are the spells a character can cast without checking if they can cast each spell one by one. This may be an acceptable loop to run on transitions, but I wouldn't touch it for something that happens more frequently.

#16
Lugaid of the Red Stripes

Lugaid of the Red Stripes
  • Members
  • 955 messages
To modify my earlier idea, maybe you could just replace the nymph cloak with a custom version that has no actual bonuses attached to it. Instead, the bonuses are applied via a tag-based script. Within the script, you could check to see whether it's a legitimate occasion to apply or remove the bonus. So when you want to don the riding cloak, just set some variable somewhere. The bonuses then don't get removed, and when you re-equip the nymph cloak, the bonuses are not re-applied, but the variable is switched back.

On module load, you could check for the default nymph cloak in the player's inventory, and replace it with your custom version.

#17
I_Raps

I_Raps
  • Members
  • 1 262 messages
How about this - can you just leave the nymph cloak (or whatever custom cloak they may have) on the character and change its appearance?  I know you can do it out-of-game without impacting spells available.

Modifié par I_Raps, 26 octobre 2012 - 03:25 .


#18
Dann-J

Dann-J
  • Members
  • 3 161 messages

I_Raps wrote...

How about this - can you just leave the nymph cloak (or whatever custom cloak they may have) on the character and change its appearance?  I know you can do it out-of-game.


Then you'd be left with a rider floating in mid-air (or on an invisible horse). The horse is the cloak appearance.

If only there was a way of changing the underlying appearance of an equipped cloak. Then you wouldn't have to swap cloaks at all.