Luke Posted July 11, 2020 Share Posted July 11, 2020 Does someone know when this trigger is supposed to return true? I wanted to use it to make sure a certain creature doesn't attempt to move towards another creature if it's completely surrounded by other creatures, but it doesn't seem to work... Quote Link to comment
Ardanis Posted July 13, 2020 Share Posted July 13, 2020 There was some talk during SoD's development about using this trigger for AI, but it remained just a talk. I would assume it only, if ever, returns true when path is blocked by searchmap/doors. Quote Link to comment
Luke Posted July 13, 2020 Author Share Posted July 13, 2020 (edited) 57 minutes ago, Ardanis said: but it remained just a talk. What a pity! It'd be really handy for the aforementioned situation – I mean, it's of limited use as of now (true when path is blocked by searchmap/doors)... the 2.6 update will hopefully take that into account and improve it... In the meantime, I'm wondering if 0x4063 InWeaponRange(O:Object*) can be of any help... Edited July 13, 2020 by Luke Quote Link to comment
Bubb Posted July 13, 2020 Share Posted July 13, 2020 (edited) TargetUnreachable() only returns true if an attacker, (either using weapons or spells), suddenly loses the ability to target what it is attacking - given some specific circumstances: Attack() - Attacker can't see invisible creatures, and target either went STATE_INVISIBLE or went under sanctuary. Spell() - Target is a sprite (creature), the caster isn't the target, caster can't see invisible creatures, spellFlags & 0x1000000 == 0, and target either went STATE_INVISIBLE, STATE_IMPROVEDINVISIBILITY, or went under sanctuary. UseItem() - Target is a sprite (creature), the caster isn't the target, caster can't see invisible creatures, abilityFlags & 0x4000000 != 0, and target either went STATE_INVISIBLE, STATE_IMPROVEDINVISIBILITY, or went under sanctuary. This basically mirrors Auto-Pause: Target Gone, (listed as "Character's Target Destroyed" in the Auto-Pause menu), except it doesn't trigger on target death. Edited July 13, 2020 by Bubb Quote Link to comment
Luke Posted July 14, 2020 Author Share Posted July 14, 2020 (edited) @Bubb Thanks for the extra details (it confirms I cannot achieve what I wanted to achieve...) Just to clarify: what about opcode #211 (Imprisonment) and #213 (Maze)? Do they count as "Target Gone" along with STATE_INVISIBLE, STATE_IMPROVEDINVISIBILITY, and Sanctuary? Edited July 14, 2020 by Luke Quote Link to comment
lynx Posted July 15, 2020 Share Posted July 15, 2020 Interesting, so it doesn't trigger on inaccessibility (eg. a door being shut or other actors getting in the way) in bg2? Most uses are in the iwds, but I didn't expect this. Come to think of it, I've seen the uses before and thought it was just bad coding: IF Allegiance(Myself,ENEMY) ActionListEmpty() !TargetUnreachable([PC]) THEN RESPONSE #100 MoveToObject([PC]) END ... since it currently causes them to move to pcs hiding in shadows etc. I should test the original more before dismissing it, heh. Quote Link to comment
Recommended Posts
Join the conversation
You are posting as a guest. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.