Jump to content

Activate the FindTraps action but without stop attacking?


Recommended Posts

I am creating my own AI script for the party, so I can learn some scripting. I have this block adapted from the built-in AI scripts:


But I thought it would be cool if the character could find traps/illusions EVEN if fighting. The user can do it manually: attack someone, then press the button. Will be finding traps as long as you don't switch target, but if you do it, you can press again the button in the UI.

Now, if I remove the ActionListEmpty line, the character starts finding traps while attacking, but it also stops attacking. Is there some way to prevent this?

Maybe the current target can be saved in a variable, then use it to attack and activate the find traps in the same response? Or just not possible at all?

Thank you.

Link to post

So you are trying to cheat ? The thing is, the finding traps supposed to be a modal state, aka it reguires your complete consentration and is effective only as long as that consentration is there. Aka, you can walk, but nothing else... no casting spells, attacking others or even talking to anyone; as your brain is not there to consentrate to it anymore...that's how it supposed to be at least. The same applies to the clerics/paladins turn undead, and shamans spiritual dance. 

Edited by Jarno Mikkola
Link to post

The engine is hardcoded to deactivate modals whenever the creature starts taking another action. There is a small list of (hardcoded) actions the engine will allow to be started without disrupting modals:

0 NoAction
18 Hide
22 MoveToObject
23 MoveToPoint
63 Wait
83 SmallWait
84 Face
89 Follow
90 MoveToPointNoRecticle
93 LeaveAreaName
99 WAITINLINE (unlisted, defunct)
215 FollowObjectFormation


Link to post

One also needs to remember that with the 18 Hide -action, the resulting invisibility from the Hide in Shadows action actually is one that stops the modal state, and it takes about the 6 real seconds to be applied.. so it will eventually interrupt the modal state, without the EEex at least, as I would remember having read about a tweak that removes that feature.

Link to post

Thank you Bubb! I did a few tries with something else, and it indeed seemed like it wasn't possible, but I really wanted a definitive answer.

Jarno: I do know that's kinda cheesy, but first I wanted to know if it's possible, and try it out in practice. This idea pretty much spurred when thinking about the Find Traps spell, as I think the best use of it (which I learnt from watching Mivsan_NT's playthrough) is using it when facing opponents in trapped areas. It's a pain to start fighting and using items, while keeping the trap finding activated manually, or have a party member only looking for traps in the first round(s). So the spell might come handy, now that my doubt is settled.

Link to post
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...