Jump to content

Force panic state


Salk

Recommended Posts

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 by Salk
Link to comment
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.

Link to comment

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).

Link to comment
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.

Link to comment

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.

Guest
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...