Salk Posted March 11, 2023 Share Posted March 11, 2023 (edited) Hello! I was wondering which is the easiest and simplest way to make sure that a neutral creature that turns hostile is just going to run from the fight in a panicked state. Also, I'd need to make sure that the panicked creature won't leave the area. Thanks! Edited March 11, 2023 by Salk Quote Link to comment
polytope Posted March 12, 2023 Share Posted March 12, 2023 17 hours ago, Salk said: Hello! I was wondering which is the easiest and simplest way to make sure that a neutral creature that turns hostile is just going to run from the fight in a panicked state. Also, I'd need to make sure that the panicked creature won't leave the area. Thanks! There are at least three ways of doing so, on a direct scripting level you can (after the desired trigger block), use the actions: THEN RESPONSE #100 Panic() END or THEN RESPONSE #100 MoraleInc(Myself,-X) END where X is some value greater than the creature's morale stat. The timing for recovery of morale is glitchy and possibly fails to happen, if you need the creature to only panic for a set period of time instead use: THEN RESPONSE #100 ApplySpellRES("XXXXXX",Myself) END XXXXXX being a filename of a .spl which applies opcode #24, the panic state, for whatever time you want, also set global timer or variable in the action if you're not checking for STATE_PANIC in the trigger block etc to ensure the script doesn't loop. 17 hours ago, Salk said: Also, I'd need to make sure that the panicked creature won't leave the area. You'll need to edit the doors of the area file and apply the NPC impassable flag. Quote Link to comment
Salk Posted March 12, 2023 Author Share Posted March 12, 2023 Hello, polytope. Thanks for the advice. I had already gone for solution 1 but I wanted to know if there were other better solutions available hence this topic. My script block was this: IF See([PC]) Allegiance(Myself,ENEMY) THEN RESPONSE #100 Panic() END I wanted to add a CheckStat for panic as trigger but I read that it only returns true for magically induced panicked state. About the impassable NPC flags for doors instead, I guess I could revert the flag when the panicked state stops (creature death). Quote Link to comment
polytope Posted March 12, 2023 Share Posted March 12, 2023 1 hour ago, Salk said: I wanted to add a CheckStat for panic as trigger but I read that it only returns true for magically induced panicked state. Actually, it will return true for morale failure (caused by a battle going badly, not by magic) but not for the Panic() which is faked like PlayDead() and which also doesn't seem to change the selection circle colour. I think that the Panic() command is like Attack() - not AttackReevaluate() or AttackOneRound() - in that the creature won't do anything else and hence won't repeat the block, but there's no harm adding a timer or variable to be sure. Quote Link to comment
polytope Posted March 12, 2023 Share Posted March 12, 2023 Further testing reveals the MoraleInc() action is also broken, if you want an actually panicked creature, have them ApplySpellRES() some silent .spl, that seems likely to be the least buggy and most easily detectable. 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.