NPC inventory & AI manipulation

Discussion in 'General Modification' started by Livonya, Oct 25, 2007.

Remove all ads!
  1. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    I got to agree with LS on this, and you got to remember that this is a world with different physical laws than our own. It'd be like throwing a cup of stfu at someone instead of a grenade - they dodge but the splash still goes everywhere.
     
  2. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    I never actually tested this with KotB. So you will have to adjust. When I built the routine I wasn't using the Wild Empathy check... thus the conflict. I guess I didn't fit it into that correctly... so you will have to adjust it.

    A good point. I forgot about Diehard. Some of those checks could be changed to critter_is_unconscious(npc) and some shouldn't... as you pointed out even a raging diehard fighter that is below 0 might be a little cautious.

    But yeah, that needs to be considered...

    The get_melee_strategy(npc) could probably have literally hundreds more things added to it. There are so many Feats, I am sure lots, and lots could be added. Plus there are hundreds of checks that could be added. This one script could eventually be 10,000 lines long or more. The possibilities are endless.....

    The one thing that absolutely has to be added is npc.d20_query(Q_AOOIncurs) or maybe it is npc.d20_query(Q_ActionTriggersAOO)... I can't remember the exact Q_ to check for, but I know there is one that will tell you if a NPC/PC standing next to you can get an AOO action on you.

    This is extremely useful, but I just haven't added it in yet.

    - Livonya
     
    Last edited: Nov 9, 2007
  3. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    yeah, wathever...:shrug:

    i won't argue because this isn't the addecuated thread plus i'm not familiar with language and it's difficult to get to the point, and I know what i meant and that's enough for me. Suffice to say, the game works as it is because it follows a mechanic, aside of any physical law, or convenient rule.

    End.
     
  4. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    diehard it's useful because in that situation the character could run away AND drink a potion or cast a life-saving spell. I've seen some enemy spellcasters cast a spell and fall to the ground dying of exhaustion...it would have sense that someone like Hedrack run away to try to heal or something.

    A 0 hp character can take just one action: if you run, AoO, if you drink a potion, AoO...you are in serious trouble.
     
  5. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Thats why Liv's script gives the option (or potentially could give the option) of taking a 5' step first: melee NPCs can't normally be set to do that, since they would take the step every single round, and thus step away from combat as often as anything else. (If you ever see an NPC in KotB who does that, thats why -report it as a bug).
    Not a problem, Liv. Btw, feel free to use my little Wild Empathy thing if you think you might have a lot of animals in your mod :)
     
  6. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    My script absolutely does make it so NPCs will take a 5' step before using a potion, provided that NPC is running the AI script I wrote.

    It works great. Anytime an NPC has less than 50% of their hit points and some potion of healing then they will take the 5' step/drink potion action.

    This CAN get screwed up if the NPC has different kinds of potions in their inventory, or if the engine can't find a safe place to step to. If there is no safe place to step to then they will drink it and get an AOO.

    The "break free" and "step/drink potion" are the 1st 2 checks that the script looks for.

    The "step/drink potion" needs a check for AOO, so that an NPC won't actually take a 5' step if the enemy they are threatened by doesn't have an AOO option. I will add that in some day... at the moment I have become side tracked by sectoring some new maps I made... damn fun.

    - Livonya

    PS: Yeah, I will use that Wild Empathy thing. I just didn't know it existed. So when I went to add in the AI commands for pets I discovered it at the last minute... thus why I didn't implement it quite right.
     
  7. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    Liv, there is another interesting (IMO) strategy thing. I don't know if it works in ToEE...

    Counterspelling.

    I could be awesome to have that, it's the tipical "rpg art box" of the two mages with clashing lightnings and bolts...it could add some interesting twists to the magical combat...

    I don't know if this could be achieved, or if you know how it works...
     
  8. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    I don't think counterspell for AI controlled NPCs was ever implemented by Troika. There might be a way to pull it off, but I haven't found it yet, though I haven't spent that much time on this issue...

    I have spent days on end trying to find new words that work in the strategy.tab but I have never found one. But there may still well be a way to do it, and there may still be commands that work that have yet to be discovered.

    There is one thing I am working on that is close, but not clearly a counterspell....

    I am working on an strategy where an enemy mage will Ready Vs. Spell and then cast Silence or some other offensive spell when you cast a spell.

    I haven't gotten it working yet, but that is the plan. It would create some interesting situations. Hopefully I will get it working. We will see.

    In the process I will be working with counterspell, so maybe I will make a break through.

    I still get amazed at some stuff I discover.

    There are COUNTLESS things that can be done with the ToEE engine that no modder/scripter/game designer has ever done before.

    I am trying to tap into those things now, and have made some great discoveries.

    I am working hard on building new actions that AI controlled NPCs can do against the player. Getting the AI swap working was the key part, and now that I am 100% positive that it works I can move forward with some of my ideas involving arcane events.

    - Livonya
     
  9. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    Cool, sounds annoyingly fun! :p

    It could be a good strategy as long the enemy group has another spellcaster...
    Also, now that you are developing that, i wonder if the bard ability against sonic effects works...
    which leads me to the fact that there aren't enemy bards and they could make for fearsome combination with all those wonderful AI scripts you are making since they're the most adaptable class...
    A pity that implement new feats is'nt possible; there are awesome metamagic feats...

    But don't start anything if it's not in your plan!
    i just throw ideas to be picked up, much like everyone could throw character ideas for portraits! :)

    Tho i must admit that arcane (and divine why not) events are my favorites. I love spellcasters classes
     
  10. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    I don't think there is much doubt that everyone wants to see more and better spellcasters in this game :)
     
  11. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    I wouldn't, evil horrible things they are, its unnatural.
     
  12. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,651
    Likes Received:
    350
    Like you mind putting them out of their misery... :p
     
  13. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    Been thinking on this...

    It could be hard having the bandits with animals?
    I mean, it would be common that a party of bandits have two or three attack dogs...they would make it for a loyal spellcaster bodyguard, fearless flankers, and fast moving trippers...
     
  14. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    Not a problem.

    In my own work there are tons of attack dogs. Most humanoid groups would have some sort of domesticated animal for companionship/protection/food/etc.... dogs and wolves can serve all of these roles at once.

    So personally, I think lots of groups should have different kinds of animals in their party.

    It seems to me that animals should be common.

    - Livonya
     
  15. Lord_Spike

    Lord_Spike Senior Member Veteran

    Joined:
    Mar 25, 2005
    Messages:
    3,151
    Likes Received:
    1
    Indeed; they are merely forgotten by many. Glad you have the insight to recognize it. :thumbsup: Dwarves & bears, for example; or gnomes & the several species of badgers. Even halfling keep dogs, which are considered as "wild" for type casting.
     
Our Host!