I placed a duplicate of the script I posted in its own quest running at maximum speed (.001).
As it is only about 11 lines of code this should not be any trouble for the CPU and it will then run the GetPlayerSpell check is once every frame.
I set the priority of the quest at 0 so if the hot-key quest is set at a lower priority (higher number like 70 ) hopefully my quest will run before the hot key quest each frame (that is how it works right TheNiceOne ?)
This will be in the next alpha update I will upload it sometime tonight.
I have noticed that the OS feels overpowered as a feature when it is NOT used in combination with the Combat Magic spell set. I was able to hold off several Vampires at once from my Nosferatu mod without a lot of trouble and then throw holy water and other vampire specific magic attacks at them with almost no fear. I am worried about allowing the player to use the OS by itself and not restrict it to the combat magic kit.
How do others feel about this? I guess I could leave in the ini choice for this, but I am also concerned about the player getting confused as to why the OS is not working sometimes. As it is now with all the INI choices for the OS the is a lot of combinations that would turn off the OS leaving the player to think the OS script is not working.
Some of the reasons the OS may not trigger when you press your block button:
You did not set it awake with your toggle key (if turn on the toggle option in the ini file .)
You are not assigning the right KEY to the Toggle button.
There is a conflicting mod (such as a Hot Key or keyboard mod) that interferes with the hot key button you selected for the toggle.
You did not select the Combat Magic Kit. (if turn on this option in the ini file .)
Your PC is not performing a block animation (for many reasons such as being paralyzed or not being in the defense "alert" state for combat).
Your PC is in the tale end of an attack animation, the attack looks like it is over to the player but the game still considers your PC to be attacking.
You are out of Magicka.
You are currently being silenced.
You are using a physical shield (if turn on the this option in the ini file .)
I am predicting I will be getting a lot player questions/posts saying the OS mod is buggy, the same way I get a lot of players confused about the Arrow case in my Archery mod.
I feel like it would be better to just limit it to how I had it before where it would only work as part of the Combat magic kit.
What say you guys?
Maybe when you first get the OS it is set to only work with the Combat Magic Kit, then after you "advance" in your combat magic skill you then can use it outside of the combat magic kit. Kind of a "upgrade" thing. By then the player has used the OS as it was intended to be used enough to know the mod intentions.
Edit: I found a "test" script in the mod that was suppose to be removed already but I forgot about it. It was to give weight to spells so that they would drop down like an arrow. You may have noticed some spells dropping out of the air. This will be removed for the next Alpha's latter tonight. A few other unnoticeable but serious bugs fixed as well.
OK, I thought you were talking about detecting the changed spell in the short time between activating and autcasting, which the delay settings are for - they do nothing when you don't auto cast the spell, as there's no need for any delay.
When activating a spell through a hotkey, the spell gets active just as if you selected it from the magic menu, and GetPlayerSpell (as Duke Patrick's mod uses) does indeed detect the new active spell. So since the code he posted doesn't seem to detect it, there must be something else wrong, like that code snippet not being called regularly from GameMode or something similar, because I am 100% sure that GetPlayerSpell detects the right spell after hotkey activation.