Activating the BG2 thief AI script (not included in BGEE) called scout (or adding this function to any other script) will cause every character to turn invisible via a crit success.
In BG2 they turn invisible on their first try
In BGEE they fail most attempts but about 1/20 succeeds.
These are characters who do not have the hide in shadows skill at all. Level 1 fighter, level 1 mage, can become invisible by having an AI script that attempts to hide in shadow.
This isn't a case of "then just don't use it" because I am trying to come up with new, improved, combat scripts; and this forces me to create unnecessary duplicates of each, specifically excluding hide in shadows from one of them just for non thieves
The function in question (as copy pasted out of the scout script source files):
PS. as far as I can tell delay(3) is a second issue with BG2 but not BGEE, in BGEE the Hide() function will only attempt 1 hide per round. In BG2 it will attempt lots of time per round unless given a delay, that acts as an "honor system" of sorts where the AI script prevents cheatings. I believe the reason there is instant success in BG2 is because I had not included a delay when I called Hide() function in my custom AI