Can I write an AI script using LUA?
Kahenraz
Member Posts: 70
I've googled around and read that I need to use something like Near Infinity to write AI scripts. Is this the only tool available or is there a way to use LUA scripts?
0
Comments
what is LUA and what type of scripts do you want to make?
LUA cannot be used for AI scripts. Baldur's Gate (and all the Infinity Engine games) use their own type of scripting language. You can learn a lot about modding in general from the following website; it has been put together by the community after many years of research:
https://gibberlings3.github.io/iesdp/
After entering, you would want to look at the sections under "Scripting"
Technically, you don't have to use Near Infinity to write AI scripts. The AI "source code" is just text; you could write it in notepad if you really wanted. The problem is that you have to compile these source code files (.BAF) into their compiled variant (.BCS) for the game to read them. Near Infinity handles this for you, and has some handy compile-error checking built in. There are other ways to compile these source files, such as using WeiDU from the command line; but I find Near Infinity to be the easiest out of all the options.
If you are looking to learn how to write AI scripts, I would say the best way to do this would be to look at the already existing scripts in Near Infinity, and to scan over the IESDP. There are also a ton of scripting tutorials scattered around the interwebs.
Sidenote: The only place I know of where the Infinity Engine uses LUA is the UI.MENU file. (defines and controls all of the graphical interfaces of the game)
Edit: Grammar is a nice thing to use.
If you plan to distribute the scripts I would recommend to use WeiDU instead. Compiled scripts are partially dependent on the game installation, so it makes sense to compile them on the target system (which can be easily done with WeiDU scripts).
If you want to write scripts outside of Near Infinity I would recommend to use Notepad++ with a syntax highlighter for game scripts. It will make writing scripts much easier.