Thanks for taking the time to post your suggestions. There's a lot to comment on in here, so forgive me if I nibble at it a little at a time.
While these scripts were started over a decade ago and their predecesssors worked on by a few different pople, for about 5 years they've been handled by one person (me). Unavoidably this means they have become a bit biased as to what I feel is right and in what works well, despite open efforts to the contrary (i.e., taking suggestions & seriously considering them).
However, there's one thing that's been annoying me: I like to scout ahead with my ranger or thief, but if I see an enemy, the rest of the party comes crashing in from half the map away, even if the enemy hasn't attacked me at all (because I'm stealthed). I've had party members walking into traps and drawing undesired aggro because of this.
So I'd suggest implementing a "detection range" for all scrips, preventing the character from attacking targets outside his detection radius unless ordered to. I don't know if this is actually possible, but it would help immensely, especially if one could toggle it ON/OFF. Or maybe toggle for different ranges, such as "close" (~2/3 screen-range), "medium" (~5/3 screen-range) and "unlimited".
The screen range system you propose is impossible. We are bound by sight and sound ranges. There is such a thing as a GlobalShout that handles the whole screen, but otherwise you're looking at ~ 28 (fog of war range) and a Shout carrying maybe 2.5 - 3 times that. No way to use "half range" or "double range" etc with these.
What is required to keep the (successfully) stealthed person to keep from alerting his companions, is to be able to know if the enemy sees him or not. If the jig is up, then you call for help...
Just being in Stealth mode or Invisible is not enough--some use True Sight, or are like Dragons that see it by default (or, are supposed to). Before BG2:EE, determining this was simply not possible. In fact, determining most things from somebody else's perspective (their local variables, e.g.) was impossible.
I'm still building a proper base for all systems (inc BG2:ToB), and until I get that built I won't be exploring much of the possibilities of the new systems. That's just structural logic--believe me, it's not easy handling 3 sets of nearly 20 scripts each, keeping them in sync where they need to be and then unique in other places. Thus, build a mostly common set, get it working to desired levels, before branching off. But eventually in BG2:EE and probably BG:EE (despite rumors, they are NOT 100% the same engine yet) things will change drastically. So much more will be possible.
Be that as it may, I'll see what can be done from the universal "BG" perspective as well. Maybe I can at least minimize the occurences of scouts attracting the whole party. I agree, that this is annoying and needs to stop.
I've also noticed that some scripts (namely the casters) tend to spend precious resources unnecessarily in easy battles, so I'd like to suggest a generic semi-passive script that automatizes battle modes and basic skill use for all multiclass combinations, but leaves spell-use and advanced item use in the player's hands.
The majority disagrees with you, and actually requested more aggressive spellcasting. This I very recently catered to with a Battlemage script, still in testing.
How can you define what is basic, and what is advanced, usages--so that it satisfies every set of tastes? The defining lines also change as your character gains experience/levels/items/abilities. It seems that all or nothing is the only safe bet. There are usually several conditional checks too, so that All doesn't translate to Free-For-All.
There already is a toggle for item use--All Items/ No Disposables/ No Item Use at all (more on this below). You could probably already achieve close to what you're aiming for, by using the Pure Fighter script for a Mage or Cleric, or the Fighter/Thief script for a Cleric/Thief or Mage/Thief--and setting this No Use toggle. The fighter scripts also tend to run faster, w/o all the HaveSpell checks to slow them down.
- Automatic: Attacks enemies in detection range with whatever weapon is equipped (never switches weapons unless commanded)
This actually is possible w/o much changes. I'll consider it. All I do is add a third slot to the Melee/Ranged toggle, like "No Switching". The Monk script already has no weapon switching, but that's because of an engine flaw.
First thing about the toggles/hotkeys---there's very few available for custom use, and in the EE there's one less than in BG2:ToB (L is used for Auto Load). So, there's only so much that can be done.
- Automatically casts long-duration buffs (8h or more) on self, trying to keep them always active
There is some of this already (stoneskin e.g.), but it's not complete. Nor am I sure that it should be entirely automated. You can acheve this with a couple passes of the Buff Hotkey, Long Duration. Granted, it's not as convenient as your proposal--but it also isn't forced upon you (except Stoneskin). Apples vs. Oranges, perhaps?
Toggle: Melee adaptation (automatically switches to a melee weapon if attacked in melee)
- Toggle: Keep distance (tries to move away if attacked in melee and switches to a ranged weapon when no enemies are adjacent)
The weapon switching system essentially does this already, though not in such a forced manner. It also tries to apply logic to the situation. Does the talented archer facing a signle foe really want to switch to a knife? Not necessarily, but possibly. Swarmed with a group, or getting wounded? Probably. here's a bit of random (weighted) chancery involved. Different scripts are weighted differently. The Ranged scripts much more likely to retain the bow (and even back up), the Spellcaster somewhat likely (and back up), the Fighter scripts more likely to don a blade (and charge). I agree the system needs improvement, especially in responsiveness--but I doubt I'd choose a draconian approach to it. If there were a dozen more hotkeys to use, I'd glady allow for Forced and Intuitive modes. Barring that, I'd rather keep Intuitive but include the NO Switching option, and then let the players decide for themselves.
A quick note about "backing up from an enemy". It's handled by a loose function called RunAwayFrom, which is dodgy at best. So sometimes even when you try to make them fall back, it doesn't work out right.
- Toggle: Enemy detection range (close, medium or unlimited)
Bound by Sight Range and Sound (scripted Shouts only--not actual footsteps), as described above.
- Toggle: Use healing potions and antidotes/elixirs (but not other items or potions)
Possible, but would require a fourth setting on an already-crowded toggle hotkey. Not as murky a toggle as the Buffing hotkey though (see below). Just subset of the No Disposables setting. A fair amount of work to implement it fully across 57 (and growing) scripts, on top of my current plans. Specifically, lots of number values to change--there's one in every item block. But I'll consider it--I like the idea.
Makes more sense in a script where the user wouldn't normally have curative spells. In either case, using renewable resources when possible (including calling on the party healers' for those lacking spells) is still the more logical step and the AI should be weighted to reflect this.
- Toggle: Stealth mode
- Toggle: Find traps mode
- Toggle: Bard song mode
- Toggle: Party healer mode
- Toggle: Turn/Rebuke undead mode
These are already covered in various scripts, and in some cases w/ better detail. Guessing this was included as "blanket coverage".
- Hotkey: Casts self-buffs (all classes supported)
- Hotkey: Casts party-buffs (all classes supported)
About the party-buffs hotkey, I'd suggest single-target buffs to be used if enough slots are memorized to buff the whole party. In this case, the character would cast the multi-target buffs then go about using single-target buffs on each party member in turn.
A fair idea, but not enough hotkeys to implement it. Especially to differentiate with all the single-party buffs, as described. How to do you determine whom you're going to target? w/ yet another toggling hotkey (Player 1 - Player 6)?
Best I could do was a lump-together, which targets first one's self and then looks for whom should be the best candidate from others. Even this on a single hotkey toggle (Long/Medium/Short) is quite a stretch, and already doesn't always work for an entire party in game play. Sometimes clicking twice in a second moves 3-4 people to Medium, and leaves the other 2-3 on Long. Adding more to this already crowded toggle could be catastrophic.
I've added to this lump, in the best ways I could think of. One example is the conditional checks, so you don't throw some buffing spells w/o a decent reason (some might disagree with this, but most agree). Another is the Enemy shout system, that you (rightfully) criticised for drawing in the party to stealthed scouts. Under other circumstances, it seems to be working rather well now. Fighters charge on in to offer their aid. I added code to spellcasters and rogues, to give them a chance to try something else before blindly charging. Spellcasters can buff and summon first, where rogues may try to slip into shadows so they can sneak a backstab. It doesn't work perfectly, and there's engine reasons for this--but I think it's better than the blind charge or the Ignoring.
The engine reason is the one-second delay between setting an integer variable, and having it actually be set to that value. 1 script round = 1 second. If you set x to value 1 at beginning of the script, it still remains 0 until the next script round begins. This makes latter responses in a script dependent on what was read a second before, not by what is currently happening. Same fault remained in the NWN/NWN2 game engines.
In the old BG2, there was a script that did something like this, but it forced buffs to be cast instantly, to save their duration (and the player's time). I like this idea very much, but some people could find it cheesy, so I'd suggest implementing two versions if you guys decide to make use of this script idea =P
I won't be implementing the auto-cheese methods into my main set, though I can see how this could be a mere convenience timesaver. But these scripts are strict adherers to the Cast n' Attack method. One spell is cast per round (except w/ aura cleanse, & accounted for), a round is six seconds--you do something w/ the other 5 besides stand there and wait to cast. It would take a separate script to do what you suggest, because its basic premise would be unravelled. Night vs Day...
That said, it's not really that hard to do. You just take the buffing section as it exists, and change a few lines in each block. Instead of Casting with:
Spell(Myself,xxxxxx)
You cast with:
ReallyForceSpell(Myself,xxxxx) // or ApplySpell(Myself,xxxxxx)
RemoveSpell(xxxxxxx)
Continue()
Remove the 6-second SetGlobalTimer and TimerExpired checks. You could remove the other conditional checks too, if you're going all-out--they're just Waste Precautions. In theory (not tested), that should make a 1-second blurring sensation of too-many-spells-at-once.
You could still keep the Long/Medium/Short toggles intact, though the further you go down that scale the cheesier it gets IMHO.