Jump to content

the "Faiths and Powers" mod


subtledoctor

Recommended Posts

I must say, as I think about this, it appears to be a huge problem (or, at least whatever size problem it already is) not just for this mod, but for *any*mod that adds spells. Want clerics to be able to cast Breach, or some kit have it as an innate ability? (Like Wizard Slayer Rebalancing.) Any script structured like this will fail.

 

I'm not sure what the answer is. If scripts are written to rely on this then it means mods can basically never add new spells with similar effects to existing ones, and can never change existing spells to a different level. That would be terrible.

 

An obvious solution from the other side of the coin is not to write scripts that way. Instead of looking for particular spells, look for the effects of spells. But, this depends on what script triggers are available and what would work in any given situation. A script trigger to detect *effects* instead of spells would be ideal, and would basically solve all of this. But alas, it doesn't exist. :(

I am not sure which game you use for reference - my search for fpellcastonme returned 8621 hits, about two thirds of them reference PC, GOODCUTOFF or a joinable PC as the caster of those spells. Of course I have a megamod BGT installations and possibly many of them come from mods - fact is, the code is used frequently and the spells referenced by IDS

Just one example

IF

OR(2)

!Global("inafight","LOCALS",1)

!Allegiance(Myself,ENEMY)

!Gender(Myself,20)

!Gender(Myself,20)

OR(14)

AttackedBy([GOODCUTOFF.0.0.0.0.20],DEFAULT)

AttackedBy([PC],DEFAULT)

AttackedBy([FAMILIAR],DEFAULT)

AttackedBy([ALLY],DEFAULT)

AttackedBy([CONTROLLED],DEFAULT)

AttackedBy([CHARMED],DEFAULT)

SpellCastOnMe([GOODCUTOFF.0.0.0.0.20],0)

SpellCastOnMe([GOODCUTOFF],WIZARD_BLINDNESS) // SPWI106.SPL (Blindness)

SpellCastOnMe([GOODCUTOFF],WIZARD_FEEBLEMIND) // SPWI509.SPL (Feeblemind)

SpellCastOnMe([GOODCUTOFF],WIZARD_CHARM_PERSON) // SPWI104.SPL (Charm Person)

SpellCastOnMe([GOODCUTOFF],WIZARD_DIRE_CHARM) // SPWI316.SPL (Dire Charm)

SpellCastOnMe([GOODCUTOFF],CLERIC_CHARM_PERSON) // SPPR204.SPL (Charm Person or Mammal)

SpellCastOnMe([GOODCUTOFF],CLERIC_MENTAL_DOMINATION) // SPPR405.SPL (Mental Domination)

SpellCastOnMe([GOODCUTOFF],WIZARD_RAY_OF_ENFEEBLEMENT) // SPWI221.SPL (Ray of Enfeeblement)

THEN

RESPONSE #100

Enemy()

SetGlobal("inafight","LOCALS",1)

SetGlobalTimer("stayontarget","LOCALS",TWO_ROUNDS)

SetGlobalTimer("seedefences","LOCALS",ONE_ROUND)

Continue()

END

from DW2MP3GE.bcs

 

Or the skelleton from Bone Hill

IF

OR(2)

SpellCastOnMe([PC],CLERIC_LESSER_RESTORATION) // SPPR417.SPL (Lesser Restoration)

SpellCastOnMe([PC],CLERIC_RESTORATION) // SPPR713.SPL (Greater Restoration)

Global("Restored","LOCALS",0)

THEN

RESPONSE #100

SetInterrupt(FALSE)

SetGlobal("Restored","LOCALS",1)

Wait(2)

StartDialogueNoSet([PC])

END

 

Here is my list

Link to comment

So basically, you are saying that those scripts will fail when the player is running with any sort of mod-added spells.

 

Like, one of the ones I see up there is,

SpellCastOnMe([GOODCUTOFF],WIZARD_BLINDNESS) // SPWI106.SPL (Blindness)
If some modder adds a cleric variant of Blindness, or adds a kit that can cast Blindness innately, or edits an existing kit like the Shadowdancer to cast it innately, that script will miss it.

 

So I guess one question is, should the response be, plant a big sign that says "No One Except Wizards Shalt Cast Blindness" ?

 

That's a reasonable position - at least, it's a position that would result in fewer mod conflicts. But it's also kind of absurd, to say no one should be able to use Blindness as a kit ability.

 

And it seems to me that an equally valid position to take is that those scripts could be improved and made more flexible. Especially since they are using a technique that doesn't occur intend vanilla game, it's hard to see how the kit modder could possibly expect to encounter it.

 

There's also a communication problem. If a player uses Spell Revisions (one of the best and most popular mods out there) and casts Refenerate Light Wounds multiple times on your character, your script will fail to acknowledge the healing. But last I checked, your mod readme doesn't say anything like "this is incompatible with mods that add new healing spells to the game." So I don't see how the SR devs could be on notice about it.

 

(See that's why threads like this are great, they help us identify these issues.)

 

I wonder if you have any thoughts about how to address this issue. I can look at the code and try to match up the IDS names for cleric spells, but what about wizard spells - how can we turn certain wizard spells into cleric spells? How can I make Breach into a priest spell in the sphere of Magic?

Link to comment

I am not sure which game you use for reference - my search for spellcastonme returned 8621 hits... in megamoded game etc.

Well, the (nearly) original ToB game has only 41 hits in .bcs files, that's not of course an excuse to pass the feature as acceptable.

So it's mostly a AI script improvers you are going to deal with... which will be difficult without their makers action, as one should be able to extend the scripts to allow other kinds of IDS than the WIZARD_*, CLERIC_* ... if you just add them to the system.

Partly the reason why the ADD_SPELL and the hidespl.2da etc is so good that you can easily enable the use of scripts based on them. Yes, weidu.exe commands can insert the custom ADD_SPELLS identifier to .baf files and they work strait from there.

 

There's also a communication problem. If a player uses Spell Revisions (one of the best and most popular mods out there) and casts Refenerate Light Wounds multiple times on your character, your script will fail to acknowledge the healing. But last I checked, your mod readme doesn't say anything like "this is incompatible with mods that add new healing spells to the game." So I don't see how the SR devs could be on notice about it.

See they can add a compatibility fix that adds a SpellCastOnMe([GOODCUTOFF],CLERIC_*) // (Regenerate Light Wounds) to the conditions of that script, if the mod is installed.

And so it's very easy to fix. It's in *, just cause I don't have the SR's beta, so I have no clue what the CLERIC_* will be for that spell ... The thing is, I don't need to know it, cause this work for all the other spells as well.

Link to comment

one should be able to extend the scripts to allow other kinds of IDS than the WIZARD_*, CLERIC_* ... if you just add them to the system.

Partly the reason why the ADD_SPELL and the hidespl.2da etc is so good that you can easily to with script them.

Right - I can ADD_SPELL CLERIC_BREACH to add Breach as a cleric spell, and I can enable it to be scripted and enable scripters to use it in their mods, etc. etc. But, if they don't use it - if they don't include it in their scripts, what am I supposed to do about it?

 

(Actual question - what to do about it. Brainstorming solves problems!)

Link to comment

 

one should be able to extend the scripts to allow other kinds of IDS than the WIZARD_*, CLERIC_* ... if you just add them to the system.

Partly the reason why the ADD_SPELL and the hidespl.2da etc is so good that you can easily to with script them.

Right - I can ADD_SPELL CLERIC_BREACH to add Breach as a cleric spell, and I can enable it to be scripted and enable scripters to use it in their mods, etc. etc. But, if they don't use it - if they don't include it in their scripts, what am I supposed to do about it?

 

(Actual question - what to do about it. Brainstorming solves problems!)

 

The real problem is that this is affecting a number of modders. Like Imp and yourself pointed out, the functionality used is an original feature - not much used in vanilla - but excessively used in mods.

Ignoring it will lead to a high degree of incompatibility with other mods for a new mod arriving on the scene. Most likely the blame will go to the new mod.

Link to comment

if they don't include it in their scripts, what am I supposed to do about it?

Do you need to do a thing about it ? Other than the usual. Aka, you can remove spells in the CLAB file too by the by, just add that effect via 172 at level up. This is what the Divine Remix did for the casters that didn't pass the sphere circle.

Aka, you have 21 circles, and you have 7 spell levels, you make ~147 effects that remove all the level 1 spells from sphere 1... then all the level 2 spells from that sphere. Then next sphere until you have them all, and then you apply those effects to the ones that do not pass the limitations.

Actually I don't think you need that many effects as you won't likely wish to remove the most important spells(lesser restoration, cure x wounds, raise dead) unless you make extras that are just lower level of those, in which case you need to make adjustments to the system so that you cover all your bases easily.

Link to comment

I could use opcode 172 to remove spells - my current mod already does that (I mean my other mod, which is being replaced and superseded by this one). Btw DR does *not* do that. DR removed all spells, and then adds back certain ones. (As a point of pride, I have so far refused to look at DR's code... I want to figure this out on my own without cribbing from CamDawg.)

 

The problem, and the reason that I switched from using opcode 172 to opcode 171, is that my sphere system does two more things in addition to divvying up cleric spells into spheres. 1) It converts some wizard spells for use by priests... e.g. Burning Hands goes into the sphere of Fire, and Mislead goes into the sphere of Deception. 2) It changes the level of some spells. So e.g. Goodberry becomes a 1st-level spell. Animate Dead becomes a 4th-level spell. Etc.

 

Both of those are more or less necessary to make the spheres full and balanced; but they both present problematic side-effects. I want to understand and minimize those side effects.

 

There are other options. I could have every spell in the sphere system just have a single effect, opcode 146, and cast the original spell. That would have side-effects as well, like some cleric spells bringing the Cowled Wizards down on you.

 

I could use the original spells - at least for existing priest spells, and write some arcane code to handle level changes so that it doesn't kill scripts... this would require somewhat massive updating of NPC spellbooks, and would not solve the question of converted wizard spells.

 

I could do some kind of hybrid method. But, any of these will take a ton of time and effort and I want to settle on the technique most likely to be effective before devoting what little free time I have to it.

 

Roxanne I definitely appreciate all that. But there are two sides here, if a script only checks for SpellCastOnMe('WIZARD_BLINDNESS') when it could just as easily check for STATE_BLINDNESS or something like that which would be more comprehensive and effective, that's not my problem to fix. If a mod is old and untended and its author has left the scene and no one is willing to take the reins and keep it up-to-date, then I can't bend over backwards - or, y'know, *decide not to make a new mod* - for the sake of being deferential or something like that. Maybe some things just won't be compatible.

 

Like I said, this issue is clearly broader, it might well affect some very popular and long-established mods like Spell Revisions, SpellPack B6, IWDification, Wizard Slayer Rebalancing, and more.

Link to comment

Frankly the elephant in the room is SCS. That's what really matters. And I suspect it does the same thing: look for spells like Pierce Magic, Secret Word, Breach, etc.

 

The problem is, that puts an immense straitjacket on other modders - those scripts can't work with any other spells that have similar effects. The only wanting it that's occurring to me right now, is to make a cleric spell (CLERIC_BREACH) that uses opcode 146 to cast the wizard spell identified in the scripts.

 

One problem with that, is that it will cause the cowled wizards to come attack you, for casting what appears to be a cleric spell.

Link to comment

Frankly the elephant in the room is SCS. That's what really matters. And I suspect it does the same thing: look for spells like Pierce Magic, Secret Word, Breach, etc.

 

The problem is, that puts an immense straitjacket on other modders - those scripts can't work with any other spells that have similar effects. The only wanting it that's occurring to me right now, is to make a cleric spell (CLERIC_BREACH) that uses opcode 146 to cast the wizard spell identified in the scripts.

 

One problem with that, is that it will cause the cowled wizards to come attack you, for casting what appears to be a cleric spell.

From my point of view the situation is not as bad as it initially appeared. Looking at the mods that make excessive use of looking for spells cast and thus being affected by your mod, such are *living* mods and may cooperate to achieve compatibility.

Just brainstorming, like you proposed:

- SCS wants mostly to detect offensive spells against enemies - those create effects to state that can be evaluated rather than the spell itself.

- Sandrah NPC wants to detect healing spells, so state evaluation would not work, but adding the respective spells from your mod to the script may do it

SpellCastOnMeRES("D1S5yyyy","CVSandr") put that additionally in the detection scripts and the mod would be able to both detect vanilla spells and yours in the same way. Same could be done elsewhere (or as well in SCS) by using

OR(2)

original spell

new spell

Requires just the will to do it once the mod is in some stable state and published. I would be willing to run some tests for it and report back. My NPC has your new spells in the spellbook and I will use those instead of the original and see how it works,

- I looked at the Bone Hill mod example I quoted and this one will as well work with use of a restauration scroll (just a little oddity that the scroll works but your cleric's attempt will not - but those scrolls can be found in the very same mod area anyway)

- once the *elephants* are cut into digestable slices you may focus on the remaining issues (if any)

Link to comment

Well, don't get me wrong, this has all been very good food for thought. Even if the problems are minor, it still may be worth changing the code to make it more robust against future unseen conflicts. It's still in beta after all. Grammarsalad is making a bunch cleric and paladin kits for the big, important deities (Lathander, Helm, Tempus, Talos, etc.), and Aquadrizzt is making a bunch of demihuman kits, and we're hoping to pull everything together for an initial release in January. That means I have 2 months to tune up the code for the sphere system.

 

I originally changed the system to use clone spells at the suggestion of Ardanis, but I might be able to go back to using the normal SPPR files. I think I've learned enough since then to make it work, the only thing I need to learn is how to replace spells in .CRE spellbooks. I don't know how to do that yet, but I know other mods do it, so that means I can learn it.

 

I think wizard spells will still need to be cloned (clone WIZARD_ACID_ARROW into CLERIC_ACID_ARROW), but that's probably okay. Most of them are direct-damage stuff or debuffers that you won't see much in scripts. A very few of them will appear in these kinds of scripts - Secret Word, Breach, maybe 1 or 2 more. But maybe that's okay. If I can reduce the conflicts to the point where the player doesn't notice them, then that's good enough for now. And in the future, if this mod is popular, it will be super-simple for AI mods to do as Roxanne says, just adding a line to the scripts:

OR(2)
   SpellCastOnMe('WIZARD_BREACH')
   SpellCastOnMe('CLERIC_BREACH')

So, I guess I now have a project this weekend: learn to edit NPC known spells! :)

 

EDIT - just be aware of a side-effect of using SPPR spells for this: whenever I change the level of a spell (making Flame Blade 1st-level, etc). I will have to ADD_SPELL it to give it a new IDS entry and make it work in AI "IF... HasSpell..." scripts. This mean that if the player has a big megamod install that already has 50 spells of each level, the sphere system won't install. It's easy for people using BWS to just hit "Expert Install... GO!" but really it's up to the player to be careful of what they are installing. If your game is full of junk from TDD or some mod like that, there's not much I can do about it... :(

Link to comment

@Subtledoctor... erhm, the general scripts, they shouldn't care what you cast onto them, as long as it's not long lasting or damage dealing in a long lasting time, say like Time Stop, Poison, etc Silence... things that have to be dealt with existing measures or by someone else than the caster itself.

 

So if a Cleric cast a Breach on to a mage... so what, it doesn't need to know what just happened himself, as it can see it's Protection from Magical Weapons spell is not anymore in effect and if it's hit, it can try and cast the spell back(the Silence has it's own known cure etc). This is usually done via contingency spells or other means if the mage is alone, it would happen the same if a mage casted the breach on the enemy mage. It does not tilt the SCS AI.

 

The spells that do similar things that the Silence, aka disable the normal actions, well... they need to be added to the SCS's AI's protection and so forth lists if they require special actions. But that's a different story than the Cleric Breach.

As you can also add the protections to the correct counter spells and items so that they are protected from your custom spells and effects.

Aka, most of the games liches use the lich.itm item, add via a 206 a protection from the cleric breach to it, if it's your view that it should have that. Or sec type 205 etc etc etc.....

 

It's a compromize, but if done well, a very good one. So just use the ADD_SPELL and you'll learn all this ... this is done in the SR without the ADD_SPELL, which just locks them to specific spell ids'es, yours is free from that.

Link to comment

Spell and item effects that use opcode 206 and similar ones are already handled. My mod edits every item that protects against the original spells, adding protection from my clone spells as well. Kjeron helped me optimize that code so that it runs in 45 seconds instead of 2 hours. :)

 

Some AI scripts have stuff like

IF
   SpellCastOnMe('WIZARD_BREACH')
THEN
   Response #100
   Set Local Variable (self,var,1)
Something like that. I don't know enough about this scripting to understand what that script is doing... but it is doing *something.*
Link to comment

For the record, assuming I can massage the code to use SPPR files instead of clones, here is the list of wizard spells that would be cloned into priest spells (thus causing potential issues with scripts). There are a fair amount... but I'm guessing the vast majority of these never appear in SpellCastOnMe scripts.

 

 

Cacofiend

Larloch's Minor Drain

Souls Eater

Shield

Contingency

Sleep

Ray of Enfeeblement

Greater Malison

Tenser's Transformation

Blindness

Contagion

Stinking Cloud

Chain Lightning

Death Fog

Snilloc's Snowball Swarm

Acid Arrow

Icelance

Vitriolic Sphere

Ice Storm

Cone of Cold

Acid Storm

Burning Hands

Aganazzar's Scorcher

Flame Arrow

Glitterdust

Shadow Monsters

Demishadow Monsters

Shades

Summon Shadow

Phantom Blade

Wraith Form

Power Word: Blind

Reflected Image

Blur

Invisibility

Mirror Image

Non-Detection

Invisibility 10' Radius

Mislead

Simulacrum

Secret Word

Minor Spell Turning

Breach

Globe of Invulnerability

Pierce Shield

 

Link to comment

Well, Power Word Blind, Globe of Invulnerability and a few other of those could be problematic at times... like say you go alone to a hive of beholders with GoI, if their rays won't pierce that like say with Gaunts. The cleric PWB has to be added to the lich item, like said but thats about it. Those are the ones I would find.

Besides if you take so much effort that you try to adjust the spells to be mostly compatible with the arcane spells and the protection items etc and ADD_SPELL, you are doing far more than most mods. And people of course can aid your effort when and if they find it even lacking.

 

Ouh, and you could replace the Command with Sleep. Using the same spell ids.

Erhm, Shadow Monsters, Demishadow Monsters, Shades, Summon Shadow: Can't these be Summon Shadow Monster 1, 2, 3, 4, I, II, III, IV or somethng to that sort ?

Link to comment

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...