It seems that you're using an outdated browser. Some things may not work as they should (or don't work at all).
We suggest you upgrade newer and better browser like: Chrome, Firefox, Internet Explorer or Opera

×
For any scripters out there:

There is a function changeAIScript which does work for scripts compiled to bcs file. The two parameters are the script name and one of 5 different priorities (DEFAULT, GENERAL, CLASS, RACE, OVERRIDE). I used changeAIScript on bs files, and the script was changed but didn't start until I manually checked what script that was active. I tested all priorities, and CLASS seems to be the one that at least changed the script (but it wasn't active).

If I instead used changeAIScript with .bcs files and put them in the override folder, I would give it the priority DEFAULT which is the lowest, and that works, but that also means that my npc's won't be using their normal DEFAULT script anymore, and my custom script will run on two threads - one script from the bs file and the other from from the bcs file, making the script messy. For example I would have to make checks that the other bcs file is not active if I did anything in my .bs file, and I would need to switch scripts depending on NPC back to their normal script if they were not in the party.

So is there any way to change my custom AI script compiled to file extension .bs?
No posts in this topic were marked as the solution yet. If you can help, add your reply
Correction: The 5 "priorities" come from scrlev.ids, and there are more than 5 of them:

0 OVERRIDE
1 AREA
2 SPECIFICS
4 CLASS
5 RACE
6 GENERAL
7 DEFAULT

I'm assuming that 7 is lowest priority and 0 is highest.

It seems like you need to use the action ChangeSpecifics(O:Object*,I:Value*Specific) and the trigger Specifics(O:Object*,I:Specifics*Specific) too so that you don't constantly call ChangeAIScript(S:ScriptFile*,I:Level*Scrlev).

I did some tests with DEFAULT scripts, and it works well enough. I just have to remember to switch script back to the old script. It's quite a few IF lines but it's okay. Something like this:

IF
!InParty(Myself)
Name("Yoshimo",Myself)
THEN
RESPONSE #100
ActionOverride(Myself,ChangeAIScript("YOSHX",DEFAULT))
END

IF
!InParty(Myself)
Name("Anomen",Myself)
THEN
RESPONSE #100
ActionOverride(Myself,ChangeAIScript("WTASIGHT",DEFAULT))
END