I have an idea for a new type of interactive spell but I am having trouble at the first hurdle.
Looking through the wiki and checking all the different "event" types I want a piece of code to run only when the player enters combat so I though "OnCombatStateChanged" would be perfect and save me running an OnUpdate for every second of the game. Sadly through testing and checking the "Discussion" tab on the wiki page it looks like this doesn't work on the player!
I tried this script attached to a spell lasting 2mins...
Scriptname LFBeginCombat extends ActiveMagicEffect{Script to run for Begin Combat instance.}Actor Property PlayerRef Auto Event OnCombatStateChanged(Actor akTarget, int aeCombatState) debug.trace("aeCombatState has ACTIVATED, good to go!") EndEventI ran the game with just Skyrim.ESM and this test mod, cast the spell on myself and checked it was in the magic effects list, went up to a bandit and started fighting taking note of the time then quit the game.
But on checking my script log there was no debug entry at all, like a lot of the things I have been trying in Papyrus I presume I'll just have find a work around, probably by running a constant update every second to check when the player IsInCombat.
Any advice is greatly appreciated.
Leon
