Jump to content


Photo

Script suggestions

script scripts

  • Please log in to reply
4 replies to this topic

#1 ark7

ark7
  • Member
  • 15 posts

Posted 07 December 2013 - 07:03 AM

First of all, I'd like to thank the creators of BP Series for the awesome scripts! I've been using them for a brief time, but they've helped a lot already  :)

 

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".

 

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.

 

Something like this:

- Automatic: Attacks enemies in detection range with whatever weapon is equipped (never switches weapons unless commanded)

- Automatically casts long-duration buffs (8h or more) on self, trying to keep them always active

- 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)

- Toggle: Enemy detection range (close, medium or unlimited)

- Toggle: Use healing potions and antidotes/elixirs (but not other items or potions)

- Toggle: Stealth mode

- Toggle: Find traps mode

- Toggle: Bard song mode

- Toggle: Party healer mode

- Toggle: Turn/Rebuke undead mode

- 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.

 

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


Edited by ark7, 07 December 2013 - 07:04 AM.

namida de nijimu yuuyake iro


#2 horred the plague

horred the plague

    Scourge of the Seven Seas

  • Modder
  • 1899 posts

Posted 08 December 2013 - 10:00 AM

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. :D

 

You could still keep the Long/Medium/Short toggles intact, though the further you go down that scale the cheesier it gets IMHO.

 

 



#3 ark7

ark7
  • Member
  • 15 posts

Posted 08 December 2013 - 06:17 PM

Thanks for giving such a detailed answer! :D

 

Now I can see how our philosophies take different paths, and I respect that. While you prefer fully automated scripts, I'd rather go for "simple and practical". I guess it's just a difference in perspective and play style. At any rate, I'll take your suggestion and setup most characters with fighter-like scripts.

 

I might try a hand in scripting for BG2:EE, but considering the mods I intend to create in the not-so-distant future, it's very unlikely I'll have the time to work on scripts as well. Besides, the limitation on the number of available hotkeys is such a bummer =/


namida de nijimu yuuyake iro


#4 horred the plague

horred the plague

    Scourge of the Seven Seas

  • Modder
  • 1899 posts

Posted 08 December 2013 - 08:46 PM

Yeah, a while back I got hooked on the idea of fully-automated. With an enemy AI mod out there as well (BP), it was a bit of spy-vs-spy. I could sit back, munch some popcorn, and watch the action unfold like a digital puppetmaster. But mostly hands-free--that's my idea of "simple & practical." :D

 

At any rate, getting a stealth check into the Shout-for-Party system was pretty quick & easy, so I've already got it included for next version. :) I think I'll add the "No Weapon Switching" toggle next--it's almost as quick and easy. I'll probably also go ahead with the Healing Disposable Only toggle as described above, but that will take longer to implement. On second thought, it was better to do it now (before) than after I add the remaining bulk of magical item support in for all 3 games. (Speaking of differing philosophies...hehe).

 

I've heard of some people that use these scripts for their companions, but not for their main PC. That way they can have the funand involvement of the battle. At the same time, they're not trying to keep track of six ppl at once, distracting their focus. With these scripts, there's a reasonable chance the NPC isn't doing anything too stupid (and possibly, even useful) if left alone for a few seconds or more.

 

 

EDIT: I also got enhancements to the weapon-switching system last night. It might prove a bit clunky, but worth trying out I guess. The weapon switch hotkey (K) now switches between:

 

Melee -- Intuitive (same as it was)

Ranged -- Intuitive

Melee -- Locked (Won't switch auto. If you manually switch, should switch back after enemies are cleared)

Ranged -- Locked

No Weapon Switching (rigid as it gets--manual weapon switching only)

 

Just so Intuitive mode is understood better, here's some of the things that can cause a  weapon switch:

 

---Melee: Switch to ranged if your opponent is inside a cloud (gas, web, etc) and you're not

---Melee: Switch to ranged if your opponent is under a fire shield spell

---Melee: Switch to Ranged if enemy has a blade barrier, and back off if too close

---Ranged: Switch to melee if opponent has Protection / Missiles

---A check  when 1+ opponent is in melee range (4) &/or a second is close by (w/in range 6). This varies by script/class; Fighters 90% likely to switch to melee from ranged, to an Archer kit who is 80% likely to keep his bow (the extreme case). Most are in the 70-80% likely to melee range.

---A check when our target is w/in range 10, but not range 5. Small chance of switching to melee then.

---Another separate check when an enemy is in melee range AND attacking us. Fighter types will always switch to a melee weapon, other ranged types are about 50/50 for switch/back away

 

All the above is subject to some other minor factors. e.g., you won't stop an action in the middle (spellcasting, an attack in motion) just to switch a blade.

 

EDIT 2:

 

Thanks to Notepad++, explicit (Windows) hotkey use, a great Replace function, and the fact that all healing pot's were at the top of the script---the last chore wasn't that bad to set up after all. I've added Healing Disposables Only to the Item Mode toggle. :)


Edited by horred the plague, 09 December 2013 - 08:42 AM.


#5 Ithildur

Ithildur
  • Member
  • 179 posts

Posted 09 March 2015 - 11:40 AM

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.

 

 

 

 

I'm in full agreement about the two points above by the OP. A very simple solution to the second would be to toggle spellcasting on/off altogether via hotkey like item use, something I've seen on other scripts.

 

The extremely silly 'beeline to scout on the other side of the map' response can be dealt with in a number of ways as well, the simplest might be to just remove the 'feature' altogether. Reading through some of your thoughts here Horred on what a script should do, it may be shocking :) to hear that some of us actually want to play this game by moving the party ourselves for major decisions like whether to engage the enemy as a group or not; that's not something that a script should decide for you. Scripts imo are supposed to broadly deal with micromanagement stuff, things that should be naturally handled like 'there's a guy swinging a sword in my face, I'll just keep shooting at him with a bow and get mangled' (although the recent Peter Jackson movies haven't done archers any favors!), or 'I'm obviously poisoned and have antidote stashed in my pack, maybe I should drink it'; however they shouldn't handle every major tactical decision or try to RP what the characters would do in every combat situation, certainly not decisions like when, or whether to engage the enemy; that's great and awesome for enemy ai, but not party ai.

 

The BP series offers some features that are very intriguing so I do hope they continue to get refined, but currently they seem rather over the top 'I'm taking over, you go and have popcorn and watch'; basic features (weapon swapping modes, script cancels/overrides manually selected actions!!) are less than reliable which makes having a script pointless, and philosophically the overall approach seems radically different from the way I prefer to play (overly aggressive useage of spells, beeline to party member on other side of map are two features that sound like they're intentionally set up that way).

 

Much appreciation for the work put in regardless, as always. Hopefully someday the more serious issues do get fixed.


Edited by Ithildur, 09 March 2015 - 12:16 PM.






Also tagged with one or more of these keywords: script, scripts