Please note that new user registrations disabled at this time.

Writing AI scripts

This forum is to be used for all discussions pertaining to BioWare's Baldur's Gate II: Shadows of Amn.
Post Reply
User avatar
Radek
Posts: 322
Joined: Sun Nov 26, 2000 11:00 pm
Location: Prague, Czech Republic
Contact:

Writing AI scripts

Post by Radek »

I would like to detect the type of a weapon, melee or ranged, equipped by a character. Why? When the character switches from melee to ranged weapon, he should retreat a bit from his target not to suffer thac0 penalty. The AI script documentation does not offer any access to inventory items - nothing returns ObjectType record of an item. The only way which may work is OR together more than 40 HasItemEquipped(...) lines for all BOWxx, XBOWxx and SLNGxx items. Ridiculous? Sure.

Q: Does anybody know the way of detecting equipped weapon type (melee, ranged) in the AI script?

Note: Hotkeys do not work well. Hotkey will be sent to all active characters after unpausing the game. This is not what we usually want.
Post Reply