Break free and AI questions

Discussion in 'General Modification' started by Spellslinger, Jul 14, 2006.

Remove all ads!
  1. Spellslinger

    Spellslinger Established Member

    Joined:
    Jul 14, 2006
    Messages:
    158
    Likes Received:
    0
    Hi,

    first of all, great work with this fan project here. Stumbling upon it actually prompted me to dig out the olde TOEE again :).

    So, to the questions:
    1. Searching the forums I wasn't able to clarify if the break free fix for NPCs is supposed to handle entangle as well. It is not working here. I get no strength check messages and the entangled monsters just show their attack animation full attack times. And that leads me to:

    2. Trying to learn something about question 1 I tried to locate the appropriate scripts that handle this, but to no avail. I found py00310livonya3f.py and py00310livonya9f.py but strangely enough the attachee.d20_send_signal(S_BreakFree) is commented out. At least I think that ## is a comment in Python. I also read somewhere that the flanking script was improved, and I can't find that either. Could someone please give me a hint where I can find the AI scripts?

    TIA
     
  2. Kalshane

    Kalshane Local Rules Geek

    Joined:
    Aug 6, 2004
    Messages:
    1,653
    Likes Received:
    4
    There is no break free animation, so the "attack" animation you're seeing is them attempting to break free.

    Livonya's work around for NPCs not trying to break free was to a create a "Break Free Potion" that appears in the inventory of any trapped creature, which they then use and causes the break free attempt.
     
  3. rufnredde

    rufnredde Established Member Veteran

    Joined:
    Apr 8, 2006
    Messages:
    266
    Likes Received:
    1
    What your looking at there is a call to a d20 function. All of the d20 scripting is done in the .dll in C (I use C generically here to include C, C++ and any other C derived lang.) and then called by a script. Python is an object oriented language and it sees the compiled C code object and interprets it as if it was a python function. Unfortunately this makes it very difficult to look at the actual code that is being interpreted

    You can look at a disassemble version of the compiled code or look at the code in Hex. In the past there were some modders who could do this quite well. However at this time none of them frequent the boards, so .dll modding is for the moment beyond the capabilities of co8. Agetian has made great strides in interpreting and manipulating the objects themselves with the World Builder and other tools that he has created. So the future actually looks pretty bright on this front.
    Back to your question the d20_send_signal(S_BreakFree) does not work properly so as a bandaide
    which is rather ingenious and does accomplish what it was designed for. The drawbacks being that there is no animation for the break free, and the savings throws and strength checks are accomplished in the saves for the potion. Examples of the breakfree scripting can be found in the definition of the san_start_combat script attachment point in py00002black jay.py or many of the individual scripts associated with various characters. The characteristics of the break free potion protos number 8903 can be viewed in either the World Builder or Proto Editor. You will notice that the Elixir of break free that is called in the spell section of the protos is listed as INTERNAL which means that it is scripted in the .dll.

    A comment in Python is actually a single #. A ## defines a stringeol (string end of line) but since there is not really much difference, that is just me splitting hairs:)
    Again the AI functions are internal and passed to the object, by a definition in the protos.tab. The individual functions that are passed can be viewed and manipulated in the strategy.tab file which is in the data\rules directory and can be viewed using the protos editor tool.
    This is my understanding of how the pieces fit together anyway, from reading the posts here and what is contained in the directories and files themselves. It helps to have the .dat files extracted if you really want to take a look at the program structure. I may be wrong about some or all of this I haven’t really been doing this that long. So hopefully if any of my assumptions are wrong here, one of the more experienced modders will come through and correct me.
     
    Last edited: Jul 14, 2006
  4. Spellslinger

    Spellslinger Established Member

    Joined:
    Jul 14, 2006
    Messages:
    158
    Likes Received:
    0
    Well, that sure sounds like trying to code for TOEE gets yourself entangled ;). I'll have to look into the .tab files a bit.

    But still, back to my question 1: Do the NPCs in your game try to break free from an entangle spell(druid lvl 1)? They do NOT in my game. And as I said the difference is quite clear: With a web spell I get the strength check rolls (twice as mentioned by Liv somewhere) and a floating text message over the NPC about success/failure. This does not happen when the NPCs are entangled. Is that an isolated problem I have, or can someone else reproduce it?
     
  5. rufnredde

    rufnredde Established Member Veteran

    Joined:
    Apr 8, 2006
    Messages:
    266
    Likes Received:
    1
    To know whether that NPC specifically is coded to break free you would have to look at the protos for the druid in question and see if the code is included. Since I don't know from your post which druid you are talking about its impossible to say.
     
  6. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    I have never had any of my party subjected to an entangle spell. Can party members break free from entangle in the game? It may just be that the d20 querry does not work for entangle. The game designers never put in a break free ability for NPCs in the game, and no NPC in the game casts entangle on the party, so maybe it just doesn't work.
     
  7. Spellslinger

    Spellslinger Established Member

    Joined:
    Jul 14, 2006
    Messages:
    158
    Likes Received:
    0
    Sorry, it seems I wasn't clear enough in my description. For me NPCs are everything I don't control, so it includes all opposing AI controlled critters, monsters and whatnots. The NPCs you can include in your party are controlled by yourself in combat and you control their break free attempts (I think, most of the time I like to play my own created PCs only), so I didn't think about them when I described the problem. Again, now clearer:

    One of my PCs casts entangle on enemies (just try it with any random encounter). They don't try to break free as described in my previous posts. They do when I cast web on them. Through this "tactic" I easily won against the hill giant. Or for example hunting that fish near Nulb: I activated both the frog behemoth and the seahag/lizardman encounters at once. Not an easy situation, fighting on two fronts. But the entangle spell took out the seahag and 90% of the lizardmen, because after failing their reflex checks they never tried to break free. Makes for one overpowered lvl1 save or die spell ;). I hope I managed to make it clearer now, I'm no english native speaker.
     
  8. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    I understood. My question was do PC's get the chance to break free when hit with an entangle spell? I've never tried it, and was wondering if anyone else had.

    If PCs don't, then that explains why NPCs don't. It would mean that the game does not consider Entangle a spell you can break free from. And that is something we cannot fix at the moment.
     
  9. Spellslinger

    Spellslinger Established Member

    Joined:
    Jul 14, 2006
    Messages:
    158
    Likes Received:
    0
    I don't know if there are any enemies who would use entangle on the party, but I just tested again to run into my own entangle spell. And I can attempt to break free from it. So it seems that the engine recognizes entangled as "break free"-able.
     
  10. Cerulean the Blue

    Cerulean the Blue Blue Meanie Veteran

    Joined:
    Apr 23, 2005
    Messages:
    1,962
    Likes Received:
    0
    That's what I wanted to know. I will look into it.

    For the record, there are no enemies who cast Entangle.
     
  11. Lord_Spike

    Lord_Spike Senior Member Veteran

    Joined:
    Mar 25, 2005
    Messages:
    3,151
    Likes Received:
    1
    Side note: Freedom of Movement (or whatever Free Action is called now) works well with Entangle. I tie up the enemy & wade in to kill them. I start with those not trapped, then go to work on any missile armed troops, as they can still fire while affected by this.
     
  12. Spellslinger

    Spellslinger Established Member

    Joined:
    Jul 14, 2006
    Messages:
    158
    Likes Received:
    0
    Yes, that's a valid tactic, but as long as the enemies cannot break free from entangle... it feels a bit like cheating too me. Better to use web then, but of course this spell lacks a bit in the radius department (at least compared to the all encompassing entangle).
     
  13. Shiningted

    Shiningted I want my goat back Administrator

    Joined:
    Oct 23, 2004
    Messages:
    12,655
    Likes Received:
    352
    The fact that NPCs can break free from Web now is great, but the fact PCs stand there like idiots, or worse still, make a saving throw on the cast, only to get webbed at the start of their turn, and almost never try to break free, annoys the heck out of me. I don't suppose there is much we can do but dang it bugs me. Add in the spiders getting first go each time, and it makes some encounters farcical. :rant:
     
  14. Gaear

    Gaear Bastard Maestro Administrator

    Joined:
    Apr 27, 2004
    Messages:
    11,029
    Likes Received:
    42
    The final nail in the coffin is the curiously mercurial edge of the effect, which often ensnares PCs who seem to be well out of its range.
     
  15. Cujo

    Cujo Mad Hatter Veteran

    Joined:
    Apr 4, 2005
    Messages:
    3,636
    Likes Received:
    1
    @Ted; when was the last time you sneaked up on a spider instead of it sneaking up on you
     
Our Host!