Page 1 of 1

How do you backstab through script?

Posted: Sun May 09, 2004 10:23 pm
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?

Posted: Tue May 11, 2004 9:51 am
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 ...

Posted: Wed May 12, 2004 10:46 am
by Luther
There's a Thief-aggressive script that is supposed to do this too. Should be in the cusomize--script list.

Posted: Wed May 12, 2004 11:23 am
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.

Posted: Thu May 13, 2004 10:52 am
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.

Posted: Thu May 13, 2004 11:09 am
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 ...

Posted: Fri May 14, 2004 2:48 am
by kopywrite
Yeah, the rune assassins seem to stretch the definition of the word 'back'...grrr.