Larian Banner: Baldur's Gate Patch 9
Previous Thread
Next Thread
Print Thread
Joined: Jan 2009
Stabbey Offline OP
veteran
OP Offline
veteran
Joined: Jan 2009
I'm thinking of making a thieving-based campaign, and the first part is to see if parts of what I need are even actually possible.

One thing I want is use of light sources (in combination with patrolling/stationary guards) to restrict the movements of sneaking players some of those the players might be able to turn off with a switch, others they might extinguish with water arrows.

So as far as anyone knows, is it possible to force a sneaking player out of stealth if they enter the radius of an object (preferably a special light source)?

Joined: May 2017
enthusiast
Offline
enthusiast
Joined: May 2017
Sneaking characters have a status called "SNEAKING", so you can check for that and remove it when appropriate.

One idea for going about that is to have your object emit a hidden aura status. When that status is applied to a player, you check the player (with scripting) for SNEAKING.

Something like:

(Disclaimer: I wrote these externally in notepad, so there may be a typo or compile error I missed)

Story version:
Code
IF
CharacterStatusApplied(_Character, "MYMOD_REMOVE_SNEAKING", _)
AND
CharacterIsPlayer(_Character, 1) // Optional
AND
HasActiveStatus(_Character, "SNEAKING", 1)
THEN
RemoveStatus(_Character, "SNEAKING");


Or:

Behavior (gameScript) version:
Code
EVENT MyMod_RemoveSneaking
VARS
	CHARACTER:_Character
ON
	OnCharacterStatusApplied(_Character, MYMOD_REMOVE_SNEAKING)
ACTIONS
IF "c1&c2"
	CharacterIsPlayer(_Character)
	CharacterHasStatus(_Character, SNEAKING)
THEN
	CharacterRemoveStatus(_Character, SNEAKING)
ENDIF

Joined: Jan 2009
Stabbey Offline OP
veteran
OP Offline
veteran
Joined: Jan 2009
Thanks! So then all I'll have to so is add a way to toggle when the object emits the aura or not. I think I should definitely make a crude, tiny test level first to make sure I can get it to work.


Link Copied to Clipboard
Powered by UBB.threads™ PHP Forum Software 7.7.5