23. An observation (probably intended) of CharacterGet function:
Some characters are principally ignored, I noticed that for invisible characters, sneaking characters (when already sneaking; works for a short duration when sneaking status gets applied) and characters who can't fight (CanFight false). It's a bit complicated to catch these characters in scripts. For invisible characters (and analogically for sneaking characters) I save (up to two) invisible characters in variables, so I can refer to them:
EVENT SetInvisibleCharacter
ON
OnCharacterStatus(_char,INVISIBLE)
ACTIONS
IF "c1"
IsEqual(%InvisibleChar1,null)
THEN
Set(%InvisibleChar1,_char)
ELSE
Set(%InvisibleChar2,_char)
ENDIF
EVENT RemoveInvisibleCharacter1
ON
OnCharacterStatusRemoved(%InvisibleChar1,INVISIBLE)
ACTIONS
Set(%InvisibleChar1,null)
EVENT RemoveInvisibleCharacter2
ON
OnCharacterStatusRemoved(%InvisibleChar2,INVISIBLE)
ACTIONS
Set(%InvisibleChar2,null)
It's not ideal but works okay, I think.
It would be useful to add INT:CanFight=1 to the CharacterGet function in D:OS 2 and INT:Invisible/Sneaking=0 or offer an equivalent function. Or is there already a way to get those characters quickly?
24. A few more suggestions:
- OnMovementFailed as EVENT; currently it can only be checked in the INTERRUPT section of reactions. So a standard reaction on failing movement can't be scripted at the moment, as far as I see.
- An option to check CharacterIsMoving (similar to ItemIsMoving).
- Maybe checks like: CharacterCanLockpick (already in EE but seems non-functional, s. 15.) and CharacterCanDisableTrap and related commands, so an AI for companions could be implemented.
- An option to check the owner of an object.
- Way more options for ItemGetStat (see above): currently only Weight and Value.
- OnResurrect as event.
- an option to check death type (OnDie only checks damage type which doesn't correspond with death type in most cases).
25. OnCastSkill only seems to work when the character is __Me.