Charging Crossbowmen

Discussion in 'The Temple of Elemental Evil' started by Gaear, Nov 12, 2009.

Remove all ads!
  1. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    I saw that happen with those guys too - took away their melee weapons and they behaved normally.
     
  2. Kalshane

    Kalshane Local Rules Geek

    Joined:
    Aug 6, 2004
    Messages:
    1,653
    Likes Received:
    4
    Hey, Gaear, have you tried loading 5.6.1 game using the 5.5 strategy.tab (if 5.5 was the last time the AI worked correctly)? That should give you an idea if it's a problem with the strategy.tab or with something else.

    I know if the protos.tab gets corrupted the game simply won't run (as I ran into it alot during the protos.tab overhaul) but I have no clue what happens if the strategy.tab gets corrupted. Could be Excel borked some stuff that's not readily apparent.
     
  3. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Well I went through strategy.tab very carefully after the Hedrack thing and made sure there were no other discrepencies from the older version, so it shouldn't be that. Strategy.tab isn't a show-stopper like protos.tab or invensource.mes as far as launching the game goes.

    I have tried using the 5.5 version with 5.6 and it makes no difference.

    You mentioned that one of the witches in the broken tower approached ... I saw Falrinth do that once (in the tweaked version) - foolishly run into the fray and then run back out again. Were he and the witch trying to cast ranged touch attack spells? I don't have their spell lists in front of me to check atm.
     
  4. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    1
    Just thinking out loud here, could it something coming over from KotB? I noted in the 5.6.1 thread that a zombie said "Dont hit me dad" when I attacked it, and Ted said that was a mix up from KotB files.

    Another idea from my modding experience, a screwed up DLG can mess with a whole lot of things, including battles (aka screwing up my archer leaders turn in my mod). Since 5.6.0/1 changed Black Jays DLG for the sheep quest, is it possible there is a screw up in his DLG that is messing with his Strategy protocol?

    Have you tried attacking Black Jay in Hommlet and seeing if he charges?
     
  5. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    1
    Also, all functions in Black Jays PY files have a return called correct? I had problems with the default return and other things.

    EDIT1:
    Looking at my 5.6.1 files, what is a PYC file? I haven't played in weeks and Blackjay has a PY and a PYC file (which is mostly illegible). I thought that PYC files were created during the game and were deleted afterward.

    EDIT2: Some of BlackJays Code
    Code:
    def san_start_combat( attachee, triggerer ):
    	if (attachee.name == 14238 and (not attachee.has_wielded(4099) or not attachee.has_wielded(4100))):
    		attachee.item_wield_best_all()
    #		game.new_sid = 0
    	if (attachee.name == 14336 and (not attachee.has_wielded(4081) or not attachee.has_wielded(4126))):
    		attachee.item_wield_best_all()
    		attachee.item_wield_best_all()
    #		game.new_sid = 0
    	if (attachee.name == 14357 and (not attachee.has_wielded(4156) or not attachee.has_wielded(4159))):
    		attachee.item_wield_best_all()
    #		game.new_sid = 0
    	if (attachee.name == 14747 and (not attachee.has_wielded(4040) or not attachee.has_wielded(4159))):
    		attachee.item_wield_best_all()
    
    ## ALSO, THIS IS USED FOR BREAK FREE
    	while(attachee.item_find(8903) != OBJ_HANDLE_NULL):
    		attachee.item_find(8903).destroy()
    	if (attachee.d20_query(Q_Is_BreakFree_Possible)):
    		create_item_in_inventory( 8903, attachee )
    ##		attachee.d20_send_signal(S_BreakFree)
    	return RUN_DEFAULT
    Why is the breakfree code:
    1) creating an item,
    2) commenting "attachee.d20_send_signal(S_BreakFree)", and what does that line mean?
     
    Last edited: Nov 19, 2009
  6. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    The break-free stuff is Livonya's. The item creation is creating a 'potion of break-free,' which was Liv's way of getting NPCs to do that very thing (attempt to break free of webs, etc. by using a potion, which NPCs can do.) I don't know what that other line was for or why it's commented out, but the code hasn't changed since way back in the day and it's always worked fine.

    A .pyc file is a .py file compiled in-game. They lay around until they get deleted, either by manually running the deletepyc app in the scripts folder or at game launch if you've got 'clean map cache' selected in TFE-X.

    Yes, I like the idea that we could blame Ted for all of this. :transform Seriously though, anything's possible but it seems unlikely that some KotB bit is to blame. There were no wholesale file transfers from KotB over to ToEE, and I don't know that what Ted has is fundamentally different from ToEE in terms of combat-related scripts anyway.

    Not so sure about dialogs messing up scripts unless the scripts are fired from the dialog or the scripts refer to a dialog (if x then start dialog y).

    I haven't tested Black Jay himself, no.
     
  7. Ranth

    Ranth Established Member

    Joined:
    Jan 26, 2008
    Messages:
    829
    Likes Received:
    1
    Well, if the zombie thing is now saying "Dont hit me dad" it seems like a script somewhere is running a DLG file (granted, he said this in a overhead bubble, not a conversation box). It may be that this is occurring for all 00002.py related mobs but it is only having an effect on ranged attackers.

    Has anyone noticed if these charging crossbowmen charge immediately in combat, or if you need to attack them first (which would cue said 'dont hit me dad' response)?
     
  8. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    I think that function actually references some generic comments file (something.mes from memeory), not a dilaog file. There is no dialog file for zombies anyway.

    The chargers I've seen charge immediately on their first turn.
     
  9. Kalshane

    Kalshane Local Rules Geek

    Joined:
    Aug 6, 2004
    Messages:
    1,653
    Likes Received:
    4
    Okay. It was worth a shot. I seem to recall the switching to daggers (not so sure about the charging crossbowmen) problem being in a previous version of Co8 as well (it was one of the earlier versions. Pre-4, I'm pretty sure.)

    Maybe. Though why they'd close for a ranged touch spell, I don't know. A regular touch spell is possible, though you'd think they'd not run into the middle of the party to do it, but then the AI isn't always smart. I think the witch does have some of the Cause Wounds spells.

    I had a fight in the Temple last night that was aided greatly by both Ogres suddenly deciding in the middle of the fight to start running back and forth so I could AoO them to death. I'm also seeing some enemies on the periphery of battles get added to the initiative list at the top of the screen, but not actually act on their turn until after I've attacked them once. (This happened with the gnolls in the SW corner of the Earth Temple and the Ghouls in the room with the "Ghast's Chest".)
     
  10. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,038
    Likes Received:
    42
    Presumably for the same reason that crossbowmen are doing it, which would seem to indicate it's a problem with targeting or something, not an AI command snafu or something to do with weapons.
     
  11. Ausdoerrt

    Ausdoerrt Veteran Member

    Joined:
    Oct 6, 2008
    Messages:
    1,233
    Likes Received:
    0
    On a side note, I noticed some characters (most, actually) attempt break free even if they're within attack range of an enemy. Makes for a giant exploit. It seems to be the same type of problem as prioritizing summons for attacking - the action priority seems to be wrong.
     
  12. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    • Removing the start_combat script didn't work (made a duplicate proto of guardsman without any san_start_combat script, got daggerswitch again)
    • Again, in a test I've done, most guardsmen would switch to daggers, some would just stay put, and maybe a couple would stick to their initial loadout.
     
  13. Kalshane

    Kalshane Local Rules Geek

    Joined:
    Aug 6, 2004
    Messages:
    1,653
    Likes Received:
    4
    Ran into some charging crossbow skeletons in the bone room in the Temple. Also, I didn't see any of the Earth Temple Guards with crossbows charge, but they never 5-foot stepped away from melee characters to shoot at them.

    Speaking of 5-foot stepping, did monsters used to do that before drinking a potion, or am I imagining things?
     
  14. The Royal Canadian

    The Royal Canadian Established Member

    Joined:
    Oct 29, 2005
    Messages:
    741
    Likes Received:
    4
    Hi
    I also noticed the exact same things. One thing I have noticed about the bugbears, is what they do about drinking potions. It is my observation that the "melee" bugbears will drink a potion without taking a 5 foot step, but the archer bugbears (at least the few times I noticed) won't drink a potion, but will instead attempt to either 5' step and shoot or switch to melee weapon and swing.
    The Royal Canadian
     
  15. Sitra Achara

    Sitra Achara Senior Member

    Joined:
    Sep 1, 2003
    Messages:
    3,622
    Likes Received:
    538
    • The item_wield_best_all() function actually equips a proper weapon, rather than the dagger. It seems to get overridden in the first round, though, as if the daggerswitch occurs after the san_start_combat executes.
    • Daggerswitching seems to be triggered by hostile effects on the first round, too (e.g. start off combat with web)
    • Earth Temple Guards:
      • They use the strategy Flanker (with ranged), which is:
        Code:
        Flanker (with ranged)    coup de grace            use potion            target closest            target bad reflex            target bad will            target damaged            target low ac            target prone            target threatened            flank            use potion            attack            flank            coup de grace            target closest                                                            
      • 5-foot step: As you can see, there is no 5-foot step or sniper command in there, thus they don't take a 5-foot step.
      • Daggerswitching: Just to be sure, I tested them in an outdoors map, and they switched to daggers as well (while in their native habitat they used their crossbows normally).
    • Bugbears:
      • They use a variety of strategies, from Sniper (obj_f_critter_strategy = 175 for my version of strategy.tab), to Flanker (no ranged), Flanker (no ranged) (target dying), Berzerker, and Tripper (full) (203, 202, 189 and 212 respectively).
      • Except for Sniper, none of those strategies feature a 5 foot step / sniper command, thus they don't take 5 foot steps.
        Sniper does contain the sniper command, which is responsible for taking a 5 foot step when threatened, and switching to melee if the 5 foot step doesn't take it outside the threatened zone.
      • If you want to check out what strategy a critter uses, extract the attached file to data\scr folder, and in the game console type:
        Code:
        from t import *
        dsb(500,ec='s')
        [code]
        
        This will flash the creature's name and strategy index, as in the attached image.
        You can then check out its strategy in strategy.tab (the number flashing above the creature is the strategy.tab line number minus 1)
        [/LIST]
         
        [*]Solution using Livonya combat scripting:
        [LIST]
        [*]The ranged attackers seem to be working properly (get_ranged_weapon(attachee) in the start_combat script).
        [*]The melee attackers cause slowdowns after a few rounds, however. Will have to investigate and work it out.
        [/LIST]
        [/LIST]
     

    Attached Files:

    Last edited: Nov 21, 2009
Our Host!