Tweaking enemy spellcasting - some leads and request for help

Discussion in 'General Modification' started by zhuge, Feb 19, 2004.

Remove all ads!
  1. zhuge

    zhuge Established Member Veteran

    Joined:
    Sep 27, 2003
    Messages:
    484
    Likes Received:
    0
    Enemy spellcasting has been one of the key AI alterations at the back of my mind for some time but never really got round to it, due to fixing other stuff. My apologies for delaying this important modding issue and thanks to Crichton for the reminder.

    The files involved here are protos.tab and strategy.tab
    All Col references are based on Phalzyr's ToEE Proto Editor.

    Taking Falrinth as an example, look at his entry in strategy.tab and you will see that he starts with casting Stoneskin, then Greater Invisibility and next Lesser Globe of Invulnerability. Actually this strategy isn't too bad but later on he could slide in a Fireball or two for more offensive punch once his defenses are secured.

    However to make things easier for testing purposes I have simply replaced Stoneskin with Fireball instead of putting Fireball somewhere later in his list of spells to cast.

    So first I replaced 'Stoneskin' class_wizard 4 in Col12 of strategy.tab
    with 'Fireball' class_wizard 3
    Tested and nothing happened. The spellcasting skipped straight to Greater Invisibility.

    So I went to protos.tab and saw that Falrinth didn't have Fireball among his list of known spells. D'oh!
    Naturally I added 'Fireball' class_wizard 3 to Col326 (Spell) for {14237}{Wizard}// Falrinth
    in protos.tab
    Tested again and now my Sorc is able to pick up that Falrinth is trying to cast Fireball via Spellcraft (float line) but no ball of fire emerges from his fingers.

    Thinking that I was close but the Fireball was not properly targeted/cast, I made another modification to strategy.tab for Falrinth's entry:
    In Col10, I changed:
    cast single

    to:
    cast fireball

    Upon retesting, success at last!!! Falrinth casts Fireball and nails my party as is fitting for a level 10 Wizard of his experience and stature!
    There maybe are a couple of residual issues though, it appears that I have some permanent graphics problems with Fireball after making all the modifications above. However this disappeared when I left and reentered Falrinth's room. Perhaps we need another tweak or two before the modifications are fully stable.

    To summarize, what we need to do to enable a certain spell is:
    1)Put the spell in strategy.tab for the appropriate character
    2)Ensure that the spell is known to the character in protos.tab
    3)Put the right targeting/casting command for the new spell you have just enabled in strategy.tab

    But anyway the bottom line is it's possible to mod AI to a certain extent and I hope this news will spur more efforts to get things going along this line.

    I strongly urge anyone interested to work together as a team to develop a good AI mod. The way is open. We need active modders! If we are fast enough we might even be able to slide this into Co8's next patch update as an optional mod to tweak AI.
     
Our Host!