NPC inventory & AI manipulation

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

Remove all ads!
  1. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Sausage dogs for riding, perhaps? Unleash the fury!!!

    There are lots of animals in KotB, u know... :blush:
     
  2. Lord_Spike

    Lord_Spike Senior Member Veteran

    Joined:
    Mar 25, 2005
    Messages:
    3,151
    Likes Received:
    1
  3. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    ...Also, what happens if a dog attacks a ranger?

    Does Wild Empathy kick in?

    It could be very surprising that in the enemy party there was also some ranger and suddendly my loyal animal companion won't attack that damned archer that keeps shootin mi wiz two times per round...:evil_laug
     
  4. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Hmmm... does Wild Empathgy kick in? Thats an excellent question.

    I do believe that random encounters are set to KOS, so Wild Empathy would be bypassed in effect, if not reality (you may get a "wild empathy succeeded!" floatline but you would still get attacked for sure). Thats why doors, guards etc who show up in random encounters are still belligerent.

    Thats a pity, really, Wild Empathy should work just as well on random animals as set ones.

    it should NOT work on a dog who is domesticated to a bunch of bandits.
     
  5. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    Well, Handle animal skill is used for that, so Wild Empathy, is a much more powerful version, it reflects the connection between the ranger and animals (be it wild or domesticated), it's much deeper than just having your dog obey by any "unnatural" way. Have in mind that it's a unique skill, not as common as handle animal.(of course, it only works in natural, normal creatures)

    Also, a few random Owlbears encounters could be good. It's a beautiful designed monster (i mean the game graphics), and, if you feel generous, Owlbear eggs could be sell for 2000 or 3000 gp!
    Of course just a few, rare encounters...
     
  6. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    With a bit of scripting you could have it work anyway that you want. I haven't looked at the Wild Empathy script that you wrote, but I am sure that you could make it work however you want....

    Speaking of new things...

    Last night I figured out how to make doors send you to random locations. I also believe I discovered a way to make the "Job's Board" in the main Keep in KotB light up with a hand icon.

    Also, if interested it would be a simple fix to change the "locked and barred" doors in the Keep so that they have hand icons when you mouse over them.

    Anyway, a lot to do at work.... so back I go.

    - Livonya
     
  7. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Is it the identical second icon underneath idea? Because as soon as you told me about that, I thought, "Ooo the Keep could use that idea!"

    Either way, certainly! That'd be great :) But there's a lot of stuff in the Keep would need the hand - if you have a better way than doubling up, that'd also be good :)
     
  8. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0
    [edit: this is useful, but not as useful as I thought. You can't make a new icon for doors that will work with ToEE World Builder, so this will ONLY work for doors... you could do it with the message board but you would see a door icon there, and that is stupid.... though maybe you could manipulate it in a way so you wouldn't actually see the door icon, though I haven't tried it...]

    No, what you do is create a door via ToEE World Builder. You assign a jumpoint that is unique for that door.

    You add a ON_USE script to protos item 2011

    When someone goes to use the door it checks the ON_USE script BEFORE it teleports the party. You then check the map and the jumpoint destination, and IF it is the right door then you divert to a new script. So for instance:

    def san_use( attachee, triggerer ):
    _____destination = attachee.obj_get_int( obj_f_scenery_teleport_to )
    _____if (attachee.map == 5000 and destination == ###):
    __________attachee.float_mesfile_line( 'mes\\narrative.mes', 1020 )
    __________return SKIP_DEFAULT

    The SKIP_DEFAULT prevents the door from ever teleporting you anywhere. As a failsafe you might want to make the jumpoint to be set to pretty much that same location, though in my tests that wasn't necessary.

    You can do anything you want.

    So you can make doors that only work if certain conditions apply, which is what I am currently doing, and thus why I figured out how to make this work.

    - Livonya

    PS: For the message board you might try making the message board into a container, and then by-pass the looking inside part with the ON_USE trick, though I am not sure how it would work.
     
    Last edited: Nov 14, 2007
  9. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    O ok... I certainly tried a lot of different tricks to try to get the hand there: but I will give this new script a go for sure :)

    EDIT: I take it your random door is by randomising values to go into obj_f_scenery_teleport_to ? Great! I still haven't heard back from Cerulean with his list of which of the internal flags he found he could and couldn't read but I am glad someone is putting all these to good use and finding their limits :clap:
     
    Last edited: Nov 14, 2007
  10. Livonya

    Livonya Established Member

    Joined:
    Sep 25, 2003
    Messages:
    773
    Likes Received:
    0

    No, I didn't change the obj_f_scenery_teleport_to, but I suppose that would work.

    Instead I just used a teleport_with_fade to the new destination.

    If you change the obj_f_scenery_teleport_to then the check to make sure it is the right door won't work properly, but you could of course code for that.

    - Livonya

    PS: In my own tests I have determined that you can pretty much change any and all internal flags... the engine doesn't always react to the change, however. For instance if you change the name of an item it doesn't achieve anything (at least not in my tests).

    I built a test script that I use from the console that allows me to test internal flags/variables on the fly and it seems to me that they can all be changed,, though reading some of them will cause the game to crash... fun fun fun!!

    The other problem is sometimes I can't figure out the format that the flag is using to hold the information. So I can change it, but I have no idea how to control how it will be changed as I don't understand the way the data is being held.

    One thing you might try with the message board. Put a door there and then change the Icon of the door from in game with a script. Not sure if it would work, but it might.
     
  11. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Implementing Liv's stuff into KotB as we speak (and very excited about it!) :mrhappy:
     
  12. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Ok, I've hit a snag and need feedback.

    Liv's ai scripts are excellent and its great to watch melee fighters acting sensibly - stepping away to use potions at opportune times, or just defensively stepping away after hitting you so u have to step to get at them, because they are down to their last few Hp - but they have a real tendency to coup-de-grace fallen PCs. In fact, thats the default behaviour.

    I'm not complaining about Liv in saying this - 'default' means what your ordinary monster would do, and most would probably just hit the nearest individual til they stopped moving then go onto the next (and many are of course evil enough to do it deliberately anyway) - but I have been testing with the Guard Officers to make sure Liv's scripts are working compatibly with my own little efforts (summoning reinforcements) and seeing the Seargant of the Guard, while fighting for his life, waste a round finishing off an already-fallen foe just irks me on several levels.

    So, should I add some sort of check to prevent this - probably alignment-based - or am I just being precious, and would the noblest paladin indeed finish the evil scourge once and for all without hesitation (a la the recent Big Ears vs Saral Caine)?
     
  13. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    I was going to comment something else, but anyways:

    No, the coup de grace from enemies should be changed.
    The same book states that you shouldn't (as a DM) kill mercilesly your players. And besides, it makes not much logic, why would someone waste a round to hit a dying charcter, when that annoying wizard is still alive?

    Well, back on track.

    It is posible to make blinded creatures act a bit randomly?

    I mean, when you're blinded, you must guess the creature direction that you want to hit. Then you make your attack with the missing chance. This doesn't seems to work in ToEE.
    A blinded enemy runs straigth to you and throws a hit, usually, if not all of the time, bypassing the chance (damned mersenne).
    Now, i've seen that Sithra Achara implemented/recovered the listen skill, i know that making a critter have a listen check first would be a PITA (if not impossible), but it would be possible that the first round of blindness taking effect, the critter has some percentage of losing the attack or something like that? A Daze effect? a lesser confusion?

    It is annoying and frustrating to see my wiz casting blindess, and yet those damned uber-bugbears run thru all the screen, raging, and reduce him to pulp as if nothing had affected them.

    And the same goes for invisibility: if the fight starts, and your rogue is sneaking and invisible, you still get quickly surrounded, even if he didn't start the fight.
     
  14. Shiningted

    Shiningted I changed this damn title, finally! Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,740
    Likes Received:
    374
    Hmmm... well, I tihnk this sorta came up with the 'blind monk' idea (which I still want to attempt). Blindness in the game is indeed broken :(

    If you just want to fix it with regard to the Blindness spell, well yeah, maybe. Also, if we imagine every monster running (eventually) off a small number of scripts, or off one giant script with many possibilities (as Liv wote), then we can certainly put a Blindness check in there and script something.
     
  15. Half Knight

    Half Knight Gibbering Mouther

    Joined:
    May 16, 2007
    Messages:
    2,148
    Likes Received:
    1
    Well, you can avoid all problems, by simply giving him certain inmunities in the protos and be done. I'll check that when the moment comes :)
    A few lines in the dlg stating that he can't see should be enough (actually, i have part of the dlg done by Fernando, i was going to work on it as well, but i prefer to start with something simplier, since it will be a quite elaborated charcter)

    No no, i don't want to add troubles, you're already too busy. And we are few of us atm to help (i already i'm overload of things to do).
    At some point, i'll see if i could add something in the spell, i found that i can modify py files with a bit of logic. :)

    And if you still want to try opossed spells, well, Harm/Heal comes to mind...i suppose that normal healing spells too.
     
Our Host!