Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID
New to the forums? Well met! Please read the following rules of conduct for the forums, and we hope you enjoy your stay. Until swords part, friend!

How to create custom AI scripts?

Oxford_GuyOxford_Guy Posts: 3,688Member, Beta Tester
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 Posts: 27Member
    Would love to have one for the bard to use song and follow the party as well
  • NoriymNoriym Posts: 5Member
    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.
    Post edited by Noriym on
    begolf00
  • begolf00begolf00 Posts: 143Member
    @Noriym

    Would love if you share them.
  • junk11junk11 Posts: 110Member
    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 Posts: 3,688Member, Beta Tester
    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
  • Oxford_GuyOxford_Guy Posts: 3,688Member, Beta Tester
    junk11 said:
    Hurrah! That one works, thanks very much! :-0
  • ImTheLawImTheLaw Posts: 10Member
    junk11 said:
    I would love to know how you've done this. I really want to learn writing scripts for BG!
    Oxford_Guy
  • junk11junk11 Posts: 110Member
    @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 Posts: 128Member
    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 Posts: 54Member
    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.
    Post edited by WabbitTwaks on
  • RavelRavel Posts: 128Member

    @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 Posts: 3,688Member, Beta Tester
    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 Posts: 434Member
    Thief Passive makes your thief always auto-detect traps....
  • smeagolheartsmeagolheart Posts: 1,541Member, Beta Tester
    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 Posts: 3,688Member, Beta Tester

    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 Posts: 10Member
    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.