Jump to content

Script Triggers and detecting invisibility (EEs and IWD2)


Recommended Posts

I noticed some inconsistent behavior with how triggers interact with invisibility, so I did some testing. This was with a party script, with the targets being PCs. I didn't do any testing with enemy scripts.


EEs: tested on BG2EE v2.6.6 and IWDEE v2.5 with EEex

Target object: [PC]
Must be visible: See(), Range(), LOS(), Exists()
Can detect if invisible: Detect()

Range(), LOS(), Exists() triggers:
Must be visible: [PC], NearestAllyOf()
Can detect if invisible: Player1, Myself, StrongestOf

Notes:
- I only checked a few identifiers, but you get the idea
- See() trigger will only see visible creatures (of the ones I tested)


IWD2

Target object: [PC]
Must be visible: See(), Range(), SetLastMarkedObject()
Can detect if invisible: Detect(), LOS(), Exists()

See(), Range(), SetLastMarkedObject() triggers:
Must be visible: [PC], NearestPC
Can detect  if invisible: Player1, Myself, StrongestOf

LastMarkedObject (see below)

 

EDIT: reworded some things and added some notes

About LastMarkedObject (IWD2)

I originally had this as must be visible for See() or Range() triggers. After further testing, these triggers can see LastMarkedObject if invisible. However, the SetLastMarkedObject trigger has the same restrictions as See() and Range(). It cannot mark a [PC] or NearestPC target that is invisible. This also applies to the SetSpellTarget() trigger.

 

Method: This is just how I tested this, in case you're wondering. I made the party invisible, then had them attack an enemy if a PC target was seen. I used blocks like this, just changing the trigger or target object for detecting PCs:

IF
	!StateCheck(Myself,STATE_INVISIBLE)
	!See([EVILCUTOFF])
THEN
	RESPONSE #100
		ApplySpell(Myself,WIZARD_INVISIBILITY)
END

IF
	ActionListEmpty()
	See([PC])
THEN
	RESPONSE #100
		AttackOneRound([EVILCUTOFF])
END

 

Edited by Dan_P
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.   Restore formatting

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