Page 1 of 1

Hide in shadows stops thief

Posted: Fri Jul 02, 2004 4:01 pm
by Ekental
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?

Posted: Fri Jul 02, 2004 4:06 pm
by Something
I believe that whenever you take an action(hide in shadows), cast a spell, drink a potion, etc. The character stops moving to the previously clicked location. Not sure how to get around this or if you really want to.

Posted: Fri Jul 02, 2004 4:12 pm
by Ekental
I believe your right, but it doesn't always happen, sometimes he keeps moving, sometimes the said thief stops, I was just wondering if this could be prevented without having the theif stay in the shadows

Posted: Fri Jul 02, 2004 4:14 pm
by Shadrach
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.)

Posted: Fri Jul 02, 2004 4:21 pm
by Ekental
Oh well, I guess there's always the stupid macros programming options,

Posted: Sat Jul 03, 2004 5:10 am
by Minute Mirage
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.

Posted: Sat Jul 03, 2004 10:26 pm
by Ekental
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?

Posted: Sun Jul 04, 2004 5:08 am
by Minute Mirage
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.

Posted: Sun Jul 04, 2004 9:42 am
by glenfar
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 ...

Posted: Sun Jul 04, 2004 11:12 am
by Ekental
I like notepad,
Anyway, the thief periodically hides in shadows cause it needs to do that every so often for it to stay in shadows, it's not like it jus thappens once per zone, sometimes it stops, sometimes it doesn't, thats what I meant

Posted: Sun Jul 04, 2004 1:06 pm
by glenfar
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.

Posted: Tue Jul 06, 2004 8:38 pm
by Ekental
Yes, but sometimes my thief stops when it does a hide in shadows check, btw my thief does not EVER fail a hide in shadows check away from hostiles anymore, so I guess I could try scripting, gah!