Hide in shadows stops thief
Hide in shadows stops thief
Heres the problem, whenever I set a thief to aggressive via party AI, they sometimes have problems moving around unless I turn the AI off. What happens is that they hide in shadows and then stop moving, and it's fairly aggravating to walk all the way across a zone and realize that I can't get to another one because my thief stopped moving half-way. Is this a bug or I am doing something wrong?
Tact is for people not witty enough to be sarcastic
It's not your fault. Baldur's Gate AI scripts can get pretty frustrating at times. I leave all of my characters with the default script. That way, they do exactly what I tell them to do, all of the time. They defend themselves when attacked, but that's about it. It takes a little more conscious effort on your part, but it saves you a lot of trouble. Just get into the habit of pausing constantly. (helps your reflexes, too.)
- Minute Mirage
- Posts: 12
- Joined: Sun Jun 20, 2004 3:54 am
- Contact:
I think the problem is that the original script doesn't have an ActionListEmpty() check before trying to hide. This check ensures that the character doesn't try to do anything anything if it already has some orders (like moving). Here's the original script:
// * aggressive attack, always trying to hide
//*Combat*
IF
Delay(10)
!StateCheck(Myself,STATE_INVISIBLE)
THEN
RESPONSE #100
Hide()
END
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
AttackReevaluate(NearestEnemyOf(Myself),30)
END
Simply adding ActionListEmpty() there seems to take care of the problem:
// * aggressive attack, always trying to hide
//*Combat*
IF
ActionListEmpty()
Delay(10)
!StateCheck(Myself,STATE_INVISIBLE)
THEN
RESPONSE #100
Hide()
END
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
AttackReevaluate(NearestEnemyOf(Myself),30)
END
Btw, I also used to use the general script (aGen), but it also has the problem of no ActionListEmpty(). Nothing is more infuriating than trying to move a character manually when he's constantly overriding your orders and attacking the nearest enemy.
// * aggressive attack, always trying to hide
//*Combat*
IF
Delay(10)
!StateCheck(Myself,STATE_INVISIBLE)
THEN
RESPONSE #100
Hide()
END
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
AttackReevaluate(NearestEnemyOf(Myself),30)
END
Simply adding ActionListEmpty() there seems to take care of the problem:
// * aggressive attack, always trying to hide
//*Combat*
IF
ActionListEmpty()
Delay(10)
!StateCheck(Myself,STATE_INVISIBLE)
THEN
RESPONSE #100
Hide()
END
IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
THEN
RESPONSE #100
AttackReevaluate(NearestEnemyOf(Myself),30)
END
Btw, I also used to use the general script (aGen), but it also has the problem of no ActionListEmpty(). Nothing is more infuriating than trying to move a character manually when he's constantly overriding your orders and attacking the nearest enemy.
Wait, if this happen's wont the character just go into shadows and then not ever do it again? I thought the code makes it so that they won't do anything if shadows is on ...i.e. moving
Oh yeah? Where are you editing the script from? Program or just going into the game?
Oh yeah? Where are you editing the script from? Program or just going into the game?
Tact is for people not witty enough to be sarcastic
- Minute Mirage
- Posts: 12
- Joined: Sun Jun 20, 2004 3:54 am
- Contact:
I'm not sure what you mean, actually. If the character hides succesfully, he should not try to rehide before he's visible again. However, you can move him normally when he's hiding and he will also attack the nearest enemy whether he's hiding or not.
I'm editing the script from the script compiler\source folder. You can just open the file you want to edit in notepad or similar and compile the file after you've made the changes.
I'm editing the script from the script compiler\source folder. You can just open the file you want to edit in notepad or similar and compile the file after you've made the changes.
You can also get a scripting program if you want - you can get one here
It gives you a bit nicer of an interface, and will compile the script for you (although you still have to copy it to from the compiled folder to the override folder). The only problem I found with it is it expects the "script compiler" folder to have no spaces in the path ... note that the folder itself has a space in it! Personally I got around that by sharing the folder and setting up a mapped drive. But I suspect it would work if you just copied it somewhere else. Or you can just stick to notepad ...
It gives you a bit nicer of an interface, and will compile the script for you (although you still have to copy it to from the compiled folder to the override folder). The only problem I found with it is it expects the "script compiler" folder to have no spaces in the path ... note that the folder itself has a space in it! Personally I got around that by sharing the folder and setting up a mapped drive. But I suspect it would work if you just copied it somewhere else. Or you can just stick to notepad ...
It probably stops because it fails ...
Every so often (every turn probably) it checks to see if you successfully hide in shadows - this won't stop you because it's not considered an 'action' - no new command was given, it's just re-checking a pre-existing command.
However, if you fail your hide in shadows check, then you become visible. At that point, the script is probably kicking in and trying to hide again - this time it's considered an 'action' so will stop you.
Every so often (every turn probably) it checks to see if you successfully hide in shadows - this won't stop you because it's not considered an 'action' - no new command was given, it's just re-checking a pre-existing command.
However, if you fail your hide in shadows check, then you become visible. At that point, the script is probably kicking in and trying to hide again - this time it's considered an 'action' so will stop you.