PJMail Posted October 24, 2021 Share Posted October 24, 2021 I have a 'potion' that triggers a 'magic effect' (which just runs a script) when consumed.If I hotkey the potion I can spam that key and get many simultaneous versions of that magic effect running.This is annoying as its script brings up a menu.... Is there an easy way to block the ME starting if there is already one active? The 'hasmagiceffect' condition does nothing. Is it possible the ME terminates once it launches the script - that would explain the condition failing? I don't want to put some sort of 'lock' in the script unless I can be sure it will be released if the script terminates unexpectedly (game script dumping etc). Surely the game has a nice method of stopping 'effect spamming'? Thanks Link to comment Share on other sites More sharing options...
PJMail Posted October 24, 2021 Author Share Posted October 24, 2021 My Magic Effect is a 'fire and forget' with 0 duration so that probably explains why it is gone when the script starts. And I probably need to let each instance of the script run so it 'replaces' the consumed Ingestable. Oh well, simplest way is to move the 'AddItem(ingestable)' to the end of the script and hope noone has more than one of them... Unless someone has a better idea (or can configure an ingestable to replace itself without a script)... Link to comment Share on other sites More sharing options...
Evangela Posted October 24, 2021 Share Posted October 24, 2021 Tick the box on the magic effect "No Recast". That prevents the reapplication of the magic effect until the end of its duration. Link to comment Share on other sites More sharing options...
PJMail Posted October 24, 2021 Author Share Posted October 24, 2021 (edited) Duration is 0 as it is just there 'fire and forget' to launch a script. I suppose I could set it to a few seconds which would stop most spamming - thanks. Still has the issue that ingestables are still consumed even if the ME fails to fire. Edited October 24, 2021 by PJMail Link to comment Share on other sites More sharing options...
Evangela Posted October 24, 2021 Share Posted October 24, 2021 (edited) Still has the issue that ingestables are still consumed even if the ME fails to fire. Event OnItemEquipped(Form akBaseObject, ObjectReference akReference) ; this event will detect potions being used if akBaseObject as potion ; add the potion back Game.GetPlayer().addItem(akBaseObject) endif EndEvent Make some changes so that it only cares about the specific potion. The one issue I can see with that is they will never run out of this potion even if it succeeds. Edited October 24, 2021 by Rasikko Link to comment Share on other sites More sharing options...
PJMail Posted October 25, 2021 Author Share Posted October 25, 2021 Never running out is what I want (it is just a 'radio').I clearly had a 'stupid' moment for not thinking of putting a script on the potion itself...Thanks again Rasikko. Link to comment Share on other sites More sharing options...
Recommended Posts