Skip to content

How to create custom AI scripts?

How do you create custom AI scripts? I'd like to have some more thief specific ones, e.g. always searching for traps (for use in dungeons etc.), but am not sure how to do this
Noriym

Comments

  • knasknas Member Posts: 50
    Would love to have one for the bard to use song and follow the party as well
  • NoriymNoriym Member Posts: 5
    edited December 2012
    Good question. I have spent more time trying to find a working AI compiler than playing this game. Why wasn't one packaged with the EE version? I can't seem to run the old ones under Win7. I would have expected an updated, perhaps more user friendly script creation tool with EE.

    Making custom scripts was half the fun of the old Infinity Engine games. And I can't seem to find my old scripts I made (hell, it has been 8+ years).

    Dammit, I need my Find Traps/auto-unlock chest script.
    begolf00
  • begolf00begolf00 Member Posts: 152
    @Noriym

    Would love if you share them.
  • junk11junk11 Member Posts: 117
    edited December 2012

    u don't really need a compiler for ai script
    BGEE can read baf file as well (which is basically txt file with high level language code)
    but of couse a compiled file have better performance..if you have large amount of codes..

    EDIT: BGEE can detect BAF file..but didn't work as I expected :/

    anyway i have this easy find trap only script if you want it
    http://www.mediafire.com/?440o6uw05dd4ksb
    just drop into \00766\scripts
    and choose the script, then your character will find trap when exploring,
    but won't do anything when hiding or in combat

    or just copy below code into baf file and convert into bs

    IF
    ActionListEmpty()
    !ActuallyInCombat()
    !ModalState(DETECTTRAPS)
    !StateCheck(Myself,STATE_INVISIBLE)
    THEN
    RESPONSE #100
    FindTraps()
    END
    UPDATE: new bs file, working
    Post edited by junk11 on
  • Oxford_GuyOxford_Guy Member Posts: 3,729
    junk11 said:

    u don't really need a compiler for ai script
    BGEE can read baf file as well (which is basically txt file with high level language code)
    but of couse a compiled file have better performance..if you have large amount of codes..

    anyway i have this easy find trap only script if you want it
    http://www.mediafire.com/?7j72mk3f6os76k3
    just upzip and drop ONE of the file into \00766\scripts
    and choose the script, then your character will find trap when exploring,
    but won't do anything when hiding or in combat

    or just copy below code into txt file, change the file into baf file type.


    IF
    ActionListEmpty()
    !ActuallyInCombat()
    !ModalState(DETECTTRAPS)
    !StateCheck(Myself,STATE_INVISIBLE)
    THEN
    RESPONSE #100
    FindTraps()
    END

    Thanks, though neither version of the script seems to work (have tried putting either, in the folder, not both at the same time), it's listed and I can select it, but my thief doesn't try to find traps
    Earnest_ernest
  • Oxford_GuyOxford_Guy Member Posts: 3,729
    junk11 said:
    Hurrah! That one works, thanks very much! :-0
  • ImTheLawImTheLaw Member Posts: 10
    junk11 said:
    I would love to know how you've done this. I really want to learn writing scripts for BG!
    Oxford_Guy
  • junk11junk11 Member Posts: 117
    @ImTheLaw
    you can try it with NearInfinity,
    basically, all the commends for this language code is in IDS files, like action.ids gives you all the working response action (even cheating ones)
    if you are not sure how to write it, you can read it from the script section, nearinfinity does help you change script code back to source file

    or you can try to look http://iesdp.gibberlings3.net/
    most of the actions still work the same way in the old ones, and the site has plenty of example to look at
  • RavelRavel Member Posts: 140
    How difficult would it be to make a script which basically has your thief constantly attempt to hide in shadows unless in combat or detecting traps?
  • WabbitTwaksWabbitTwaks Member Posts: 54
    edited December 2012
    @Ravel
    I forget which one of them does, but one of the game provided scripts has them do just that. (Edit: Well they are constantly trying to Hide in Shadows anyway) I turned it off because I found it annoying. lol.
  • RavelRavel Member Posts: 140

    @Ravel
    I forget which one of them does, but one of the game provided scripts has them do just that. (Edit: Well they are constantly trying to Hide in Shadows anyway) I turned it off because I found it annoying. lol.

    It's very close to what I want, but not quite. The in-game provided script (assuming I'm thinking of the correct one), will attempt to have them hide in shadows when not in combat, but then the character will continue to attack the nearest enemy. Maybe I'll just try to alter that one & hope not to break it :)
  • Oxford_GuyOxford_Guy Member Posts: 3,729
    Ravel said:

    @Ravel
    I forget which one of them does, but one of the game provided scripts has them do just that. (Edit: Well they are constantly trying to Hide in Shadows anyway) I turned it off because I found it annoying. lol.

    It's very close to what I want, but not quite. The in-game provided script (assuming I'm thinking of the correct one), will attempt to have them hide in shadows when not in combat, but then the character will continue to attack the nearest enemy. Maybe I'll just try to alter that one & hope not to break it :)
    Yes having a more passive hide in shadows script would be good. The only probably with constantly hiding in shadows, though, is that you can't have a healing spell cast on you whilst hidden, so would have to turn the script off and wait to come out of shadows to be healed.
  • MedullaOblongataMedullaOblongata Member Posts: 434
    Thief Passive makes your thief always auto-detect traps....
  • smeagolheartsmeagolheart Member Posts: 7,963
    there is a script like this in the rogue rebalancing mod for hiding in shadows and detecting traps and for paladins/clerics turning undead among other things. highly recommended mod
  • Oxford_GuyOxford_Guy Member Posts: 3,729

    there is a script like this in the rogue rebalancing mod for hiding in shadows and detecting traps and for paladins/clerics turning undead among other things. highly recommended mod

    Indeed, but I want to keep BGEE unmodded for now
  • ImTheLawImTheLaw Member Posts: 10
    junk11 said:

    @ImTheLaw
    you can try it with NearInfinity,
    basically, all the commends for this language code is in IDS files, like action.ids gives you all the working response action (even cheating ones)
    if you are not sure how to write it, you can read it from the script section, nearinfinity does help you change script code back to source file

    or you can try to look http://iesdp.gibberlings3.net/
    most of the actions still work the same way in the old ones, and the site has plenty of example to look at

    Thank you. It doesn't seem as easy as I would hope.
Sign In or Register to comment.