Posted January 29, 2013
I think this is a very complicated topic, because Baldur's gate is an incredibly complex game, but it's an interesting topic I think. How do you generalize combat in a script?
In practice, people have had better result when they separate the scripts for different classes but generally, here is what I'm thinking, in order:
* React to being badly hurt or damage taken.
* React to being attacked.
* React to spells cast by enemy, like Invisibility, Creeping doom, Dispel magic etc.
* React to being in a bad state.
* React to someone else being in a bad state.
* React to traps nearby.
* React to seeing special creatures like mind flayers, umber hulks. dead troll, dragon, vampire etc. Add extra protection then.
* React to shouts and orders.
* Attack group with damaging magic if range to furthest enemy is > 15 and party members are close to caster.
* Attack group with disabling magic. Some spells require that range is > 15, like dispel magic.
* Attack enemy caster with magic: remove protection, disable, distract, then kill.
* Attack nearest enemy with disabling non-group spells.
* Attack nearest enemy with damage spells.
* Create ranged magical weapon.
* Attack enemy with ranged attacks.
* Create melee magical weapon.
* Cast transformation/ shapeshift spell.
* Shapeshift.
* Attack enemy with melee attacks.
It is probably a good idea to always use the best spells available, otherwise the script would be too complex. The spell order would be prioritized where the faster the spell, the better.
Any input on this?
In practice, people have had better result when they separate the scripts for different classes but generally, here is what I'm thinking, in order:
* React to being badly hurt or damage taken.
* React to being attacked.
* React to spells cast by enemy, like Invisibility, Creeping doom, Dispel magic etc.
* React to being in a bad state.
* React to someone else being in a bad state.
* React to traps nearby.
* React to seeing special creatures like mind flayers, umber hulks. dead troll, dragon, vampire etc. Add extra protection then.
* React to shouts and orders.
* Attack group with damaging magic if range to furthest enemy is > 15 and party members are close to caster.
* Attack group with disabling magic. Some spells require that range is > 15, like dispel magic.
* Attack enemy caster with magic: remove protection, disable, distract, then kill.
* Attack nearest enemy with disabling non-group spells.
* Attack nearest enemy with damage spells.
* Create ranged magical weapon.
* Attack enemy with ranged attacks.
* Create melee magical weapon.
* Cast transformation/ shapeshift spell.
* Shapeshift.
* Attack enemy with melee attacks.
It is probably a good idea to always use the best spells available, otherwise the script would be too complex. The spell order would be prioritized where the faster the spell, the better.
Any input on this?
Post edited February 06, 2013 by potato_head