Please note that new user registrations disabled at this time.

Hide in shadows stops thief

This forum is to be used for all discussions pertaining to BioWare's Baldur's Gate II: Shadows of Amn.
Post Reply
User avatar
Ekental
Posts: 614
Joined: Mon Nov 10, 2003 12:14 am
Location: Sigil
Contact:

Hide in shadows stops thief

Post 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?
Tact is for people not witty enough to be sarcastic
User avatar
Something
Posts: 45
Joined: Tue May 08, 2001 10:00 pm
Location: home
Contact:

Post 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.
User avatar
Ekental
Posts: 614
Joined: Mon Nov 10, 2003 12:14 am
Location: Sigil
Contact:

Post 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
Tact is for people not witty enough to be sarcastic
User avatar
Shadrach
Posts: 85
Joined: Thu Jul 01, 2004 9:21 am
Contact:

Post 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.)
User avatar
Ekental
Posts: 614
Joined: Mon Nov 10, 2003 12:14 am
Location: Sigil
Contact:

Post by Ekental »

Oh well, I guess there's always the stupid macros programming options,
Tact is for people not witty enough to be sarcastic
User avatar
Minute Mirage
Posts: 12
Joined: Sun Jun 20, 2004 3:54 am
Contact:

Post 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.
User avatar
Ekental
Posts: 614
Joined: Mon Nov 10, 2003 12:14 am
Location: Sigil
Contact:

Post 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?
Tact is for people not witty enough to be sarcastic
User avatar
Minute Mirage
Posts: 12
Joined: Sun Jun 20, 2004 3:54 am
Contact:

Post 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.
User avatar
glenfar
Posts: 261
Joined: Mon Apr 19, 2004 9:58 am
Contact:

Post 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 ...
User avatar
Ekental
Posts: 614
Joined: Mon Nov 10, 2003 12:14 am
Location: Sigil
Contact:

Post 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
Tact is for people not witty enough to be sarcastic
User avatar
glenfar
Posts: 261
Joined: Mon Apr 19, 2004 9:58 am
Contact:

Post 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.
User avatar
Ekental
Posts: 614
Joined: Mon Nov 10, 2003 12:14 am
Location: Sigil
Contact:

Post 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!
Tact is for people not witty enough to be sarcastic
Post Reply