Please note that new user registrations disabled at this time.

How do you backstab through script?

This forum is to be used for all discussions pertaining to BioWare's Baldur's Gate II: Shadows of Amn.
Post Reply
User avatar
glenfar
Posts: 261
Joined: Mon Apr 19, 2004 9:58 am
Contact:

How do you backstab through script?

Post by glenfar »

Does anyone know how to setup a script for my thief so that she'll automatically do a backstab?

I can get her to hide in shadows and move close to the target - no problem there. But then all I can do is call attack - and chances are the target's facing my party, and therefore my thief, so it ends up being a normal attack instead of a backstab.

(Note that there is a BackStab action in script, but if I try calling that instead of attack, the game crashes ...)

I can't see any way (through script) to determine if I'm behind the target, let alone how to move there.

Of course, I know I can control her manually and make sure, but I'd rather have the script do that so I don't need to handle that everytime.

So ... anybody know how to do this?
User avatar
glenfar
Posts: 261
Joined: Mon Apr 19, 2004 9:58 am
Contact:

Post by glenfar »

OK - couldn't figure out how to do it through script, but at least I've got it working a little easier for myself:

IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
StateCheck(Myself,STATE_INVISIBLE)
!Range(NearestEnemyOf(Myself),10)
THEN
RESPONSE #100
MoveToObject(NearestEnemyOf(Myself))
END

IF
ActionListEmpty()
See(NearestEnemyOf(Myself))
StateCheck(Myself,STATE_INVISIBLE)
THEN
RESPONSE #100
PauseGame()
END


Basically, when invisible, my thief will move towards the nearest enemy. Once close, the script will automatically pause the game. Then I can direct her to the enemy's back and do my backstab. Works well enough ...
User avatar
Luther
Posts: 262
Joined: Sun Aug 19, 2001 10:00 pm
Location: Marin County, CA
Contact:

Post by Luther »

There's a Thief-aggressive script that is supposed to do this too. Should be in the cusomize--script list.
User avatar
glenfar
Posts: 261
Joined: Mon Apr 19, 2004 9:58 am
Contact:

Post by glenfar »

Supposed to ... but it doesn't.

I've looked at that script - all it does is try to hide, and once hidden, attack nearest enemy. But it's only a backstab if you attack from behind. So probably 90% of the time, that 'Thief - Aggressive' script will not do a backstab. You'll get the +4 to hit for being invisible, but that's it - no backstab multiplier.
User avatar
Luther
Posts: 262
Joined: Sun Aug 19, 2001 10:00 pm
Location: Marin County, CA
Contact:

Post by Luther »

Hmmm. Yeah, I think you're right. I don't use a lot of scripts so I haven't tested this fully. In Icewind Dale II they changed the backstab function so that any attack gives a backstab, not just ones from behind.

In my experience scripts only seem to work well for enemies. For characters they are very predictable and not very bright. I had Tashia set on Wizard--aggressive and all she would ever do is run up to enemies and cast burning hands on them. She would then be stuck in the middle of a huge melee desperately trying to get her mantle, etc. up.
User avatar
glenfar
Posts: 261
Joined: Mon Apr 19, 2004 9:58 am
Contact:

Post by glenfar »

Personally I don't use scripts to cast spells. My preference is to have the scripts take care of 'normal' combat (i.e: just attacking with weapons). If I want to cast a spell, or use a special ability, I'll do that manually.

I find it a nice middle-ground - usually letting me concentrate on spells while the fighters do their stuff.

I'd seen a post before that enemy thief's in BGII can do a backstab from anywhere ... I suspect they couldn't get a script working either, so just let them do a backstab anyway. Probably changed it for PC's in Icewind to be fair. That's just a guess though ...
User avatar
kopywrite
Posts: 945
Joined: Mon Mar 12, 2001 11:00 pm
Location: West London, UK
Contact:

Post by kopywrite »

Yeah, the rune assassins seem to stretch the definition of the word 'back'...grrr.
Post Reply