suy Posted September 18, 2020 Posted September 18, 2020 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: IF Global("suy#mode","LOCALS",2) ActionListEmpty() OR(2) Class(Myself,THIEF_ALL) Class(Myself,MONK) !ModalState(TURNUNDEAD) !ModalState(DETECTTRAPS) THEN RESPONSE #100 FindTraps() END 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. Quote
Jarno Mikkola Posted September 18, 2020 Posted September 18, 2020 (edited) 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 September 18, 2020 by Jarno Mikkola Quote
Bubb Posted September 18, 2020 Posted September 18, 2020 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 Quote
Jarno Mikkola Posted September 18, 2020 Posted September 18, 2020 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. Quote
suy Posted September 19, 2020 Author Posted September 19, 2020 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. Quote
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.