antstubell Posted October 8, 2019 Share Posted October 8, 2019 Decided to start a bew thread on this because things have changed.Objective - Stop player from casting ANY spell.Current State - Have a script running at stage 0, start game enabled, that should check for a magic cast.Issues - Not recieving confirmation that script has registered a magic cast. Function MagicCast()RegisterForAnimationEvent(Game.GetPlayer(), "BeginCastRight")RegisterForAnimationEvent(Game.GetPlayer(), "BeginCastLeft")EndFunctionEvent OnAnimationEvent(ObjectReference akSource, string asEventName)if (akSource == Game.GetPlayer()) && (asEventName == "BeginCastRight")Debug.MessageBox("BeginCastRight Registered!")endIfif (akSource == Game.GetPlayer()) && (asEventName == "BeginCastLeft")Debug.MessageBox("BeginCastLeft Registered!")endIfendEvent At stage 0 scripted -kmyquest.MagicCast()Help Please! Link to comment Share on other sites More sharing options...
Evangela Posted October 10, 2019 Share Posted October 10, 2019 I think there is an easier way.. is this temporary, or are you looking to permanently prevent spell casting? Link to comment Share on other sites More sharing options...
antstubell Posted October 10, 2019 Author Share Posted October 10, 2019 I've actually made some progress on this, thanks mainly to your reply to my post months ago. I have the script running on Player Alias in a quest that starts game enabled, it's a 'None' quest so can't be seen/ At stage 0 quest runs and Player alias runs this script... Quest Property My_KillMagic AutoEvent OnSpellCast(Form akSpell)If My_KillMagic.GetStage() < 100if (akSpell as Spell)(GetReference() as Actor).InterruptCast()EndifendifEndEvent Eventually player will regain the ability, somehow - haven't really worked that part of the story out yet -, to cast spells again. But because all spells were removed when the mod started, player will only have their Base Race Spells available. Setting stage to 100 in the quest ends it.It works well. I will add either some damage to the player when they try to cast or a stagger fx - something. I tested it by dropping spell tomes around where the player spawns and player can learn (again) the spells and can cast them as normal. Seems the script only prevents casting of Base Spells. EDIT: Afterthought. Maybe after player learns a new spell then the script won't work and all spells are cast-able. Need to check later. Link to comment Share on other sites More sharing options...
Evangela Posted October 10, 2019 Share Posted October 10, 2019 Nope. Should still work even for newly added spells. The script cares only about 2 things. 1. If the stage is not 1002. If the form being cast is a spell. Link to comment Share on other sites More sharing options...
antstubell Posted October 10, 2019 Author Share Posted October 10, 2019 Nope. Had to use TGM because I don't have enough magicka to cast. Watch...https://onedrive.live.com/?cid=B60C11D037429D8E&id=B60C11D037429D8E%2151474&parId=B60C11D037429D8E%21191&o=OneUp Link to comment Share on other sites More sharing options...
IsharaMeradin Posted October 10, 2019 Share Posted October 10, 2019 Maybe god mode is interfering? Try using the console to up your character's base magicka instead of entering god mode. At least that would give you confirmation one way or the other... Link to comment Share on other sites More sharing options...
antstubell Posted October 10, 2019 Author Share Posted October 10, 2019 Just tried consoling...player.setav magicka 99999 Still can cast spells other than base spells. Anyway, I am considering another approach using setactorvalue in a script so that magicka is set to 00000 until... whenever. But would be nice to know why this issue/bug/glitch occurs. Link to comment Share on other sites More sharing options...
Evangela Posted October 11, 2019 Share Posted October 11, 2019 Give a perk that increases spell cost to something ridiculous, beyond 9999 at least but not more than 32,000 as I think it will roll back to 1. Reducing (stunting magicka) is tricky because you need to account for buffs to magicka. Link to comment Share on other sites More sharing options...
maxarturo Posted October 11, 2019 Share Posted October 11, 2019 Give him an "Active Effect" that will work as a "Curse", it will detect the spell cast animation and damage X% of the player's magicka every time. This a more realistic approach and you can easily add and remove the "Curse" where ever / when ever you want. Link to comment Share on other sites More sharing options...
antstubell Posted October 11, 2019 Author Share Posted October 11, 2019 Give him an "Active Effect" that will work as a "Curse", it will detect the spell cast animation and damage X% of the player's magicka every time.This a more realistic approach and you can easily add and remove the "Curse" where ever / when ever you want. "Active Effect"? You mean like a disease? Link to comment Share on other sites More sharing options...
Recommended Posts